Plugin Directory

Changeset 2400799


Ignore:
Timestamp:
10/16/2020 09:33:11 AM (5 years ago)
Author:
rulecom
Message:

1.3. Fixes for orders

Location:
woorule/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • woorule/trunk/README.md

    r2354434 r2400799  
    7575### 1.2
    7676Bugfixes
     77
     78### 1.3
     79Bugfixes
  • woorule/trunk/README.txt

    r2360956 r2400799  
    1 === WooRule ===
    2 Contributors: lurig, neevalex
    3 Tags: rulemailer, woocommerce, newsletter
    4 Requires at least: 5.0.0
    5 Tested up to: 5.5.0
    6 License: MIT
    7 License URI: http://opensource.org/licenses/MIT
     1# WooRule
    82
    9 A [RuleMailer](https://www.rule.se/) integration with WooCommerce.
     3A [Rule Communication](https://www.rule.se/) integration with WooCommerce.
    104
    11 == Description ==
     5## Requirements
    126
    13 Subscribe your customers on various order events.
    14 Supports multiple and different events.
     7- Wordpress >= 5.1
     8- WooCommerce >= 3.5
    159
    16 == Installation ==
     10## Installation
    1711
    18 1. Upload and extract to your `/wp-content/plugins/` directory and activate it from Wordpress Admin panel.
    19 Or upload and activate it from wordpress catalog.
     121. Either download the latest release and upload it to your `/wp-content/plugins/`
     13directory or grab it from [Wordpress Plugin
     14Directory](http://wordpress.org/plugins/woorule/).
    2015
    21 2. Go to Woocommerce -> Settings -> Integration -> RuleMailer and fill in an `API Key`, and click 'save' button. You can find your RULE API key inside developer tab in [user account settings](http://app.rule.io/#/settings/developer)
     162. Activate the plugin under the _Plugins_  from Wordpress Admin panel.
    2217
    23 == Shortcode ==
     183. Go to _Woocommerce_ -> _Settings_ -> _Integration_ -> _RuleMailer_, fill in your `API Key`, and click the 'save' button. You can find your RULE API key on the developer tab in your [Rule account settings](http://app.rule.io/#/settings/developer).
    2419
    25 You can embed a Newsletter sign-up form in your posts, or on any page with a simple shortcode [woorule]
     20## Usage
     21
     22_NOTE: By default WooRule will create the "Defaul Rule" that will trigger the data sync for all new orders, tagged as "New Order"_
     23
     241. Go to the _RuleMailer tab_ and click _Add new_ and a new Rule appears in the
     25   list.
     26
     272. Press _Edit_ on the new Rule.
     28
     293. Give it a good name and fill in the rest according to your _RuleMailer_ setup.
     30
     31### Shortcode
     32
     33You can embed a Newsletter sign-up form in your posts, or on any page with a simple shortcode `[woorule]`
    2634 
    27 You can also customise the subscribe form with the shorcode options:
    28 [woorule text="This is a new title text" button="New submit button text!" success="New Success message"]
     35You can also customise the subscribe form with the shortcode options:
     36`[woorule text="This is a new title text" button="New submit button text!" success="New Success message"]`
    2937
    3038
    31 = Usage =
    32 NOTE: By default WooRule will create the "Defaul Rule" that will trigger the data sync for all new orders, tagged as "New Order"
    33 1. Enable your plugin
    34 2. Go to WooCommerce -> Settings -> Integrations -> RuleMailer and submit an API key and URL.
    35 3. A new tab should appear in the WooCommerce Settings called WooRule (if not, try refresh the page).
    3639
    37 == Changelog ==
     40### Resources
    3841
    39 = 0.0.1 =
    40 * Non-public release.
     42- [Rule documentation](https://docs.rule.se/).
     43- [WooCommerce](http://docs.woothemes.com/documentation/plugins/woocommerce/).
    4144
    42 = 0.2 =
    43 * New Version public release
     45## License
    4446
    45 = 0.3 =
    46 * Bugfixes
     47Please see [LICENSE.txt](/LICENSE.txt).
    4748
    48 = 0.4 =
    49 * Bugfix. Missing assets.
     49## Changelog
    5050
    51 = 0.5 =
    52 * New features. Bugfixes. Newest WP support
     51### 0.0.1
     52- Not yet released
    5353
    54 = 0.6 =
    55 * New features. Bugfixes.
     54### 0.2
     55New Version public release. (New API, Shortcode, Settings)
    5656
    57 = 1.1 =
     57### 0.3
     58Bugfixes
     59
     60### 0.4
     61Missing Assets
     62
     63### 0.5
     64New features. Bugfixes. Newest WP support
     65
     66### 0.6
     67New features. Bugfixes.
     68
     69### 1.1
    5870User\order meta fields.
    5971Default data improvements
     
    6173Visual Adjustments
    6274
    63 = 1.2 =
     75### 1.2
    6476Bugfixes
     77
     78### 1.3
     79Bugfixes
  • woorule/trunk/includes/admin/settings/class-wc-admin-settings-woorule.php

    r2354434 r2400799  
    4242    public static function save_checkout_fields($order_id)
    4343    {
    44         // @TODO: fix, this is st0pid
    4544        foreach ($_POST as $k => $v) {
    4645            if (substr($k, 0, 15) === 'woorule_opt_in_') {
     
    125124                          );
    126125
    127                         // this is bullshit
    128126                        $categoriesString = strip_tags(wc_get_product_category_list(
    129127                            $item['product_id'],
     
    147145
    148146                    $order_data = $order->get_data();
    149                     $phone = $order->get_billing_phone();
    150147
    151148                    // I feel bad for this, but no other methods was working.
     
    173170               
    174171                            'email'                 => $order->get_billing_email(),
    175                             'phone_number'      => $order_data['billing']['phone'],
     172                            'phone_number'      => $order_data['billing']['phone'] ?? '',
    176173                            'language' => $language,
    177174
     
    227224                                array(
    228225                                    'key'           => 'Order.Date',
    229                                     'value'     => date_format($order->get_date_completed(), "Y/m/d H:i:s")
     226                                    'value'     => $order->get_date_completed()
     227                                        ? date_format($order->get_date_completed(), "Y/m/d H:i:s") : ''
    230228                                ),
    231229                                array(
     
    251249                                array(
    252250                                    'key'           => 'Order.Currency',
    253                                     'value'     => $order_data['currency']
     251                                    'value'     => $order_data['currency'] ?? ''
    254252                                ),
    255253                                array(
    256254                                    'key'           => 'Order.PaymentMethod',
    257                                     'value'     => $order_data['payment_method'],
     255                                    'value'     => $order_data['payment_method'] ?? '',
    258256                                    "type" => "multiple"
    259257                                ),
    260258                                array(
    261259                                    'key'           => 'Order.DeliveryMethod',
    262                                     'value'     => $order_data['delivery_method'],
     260                                    'value'     => $order_data['delivery_method'] ?? '',
    263261                                    "type" => "multiple"
    264262                                ),
    265263                                array(
    266264                                    'key'           => 'Order.BillingFirstname',
    267                                     'value'     => $order_data['billing']['first_name']
     265                                    'value'     => $order_data['billing']['first_name'] ?? ''
    268266                                ),
    269267                                array(
    270268                                    'key'           => 'Order.BillingLastname',
    271                                     'value'     => $order_data['billing']['last_name']
     269                                    'value'     => $order_data['billing']['last_name'] ?? ''
    272270                                ),
    273271                                array(
    274272                                    'key'           => 'Order.BillingStreet',
    275                                     'value'     => $order_data['billing']['address_1']
     273                                    'value'     => $order_data['billing']['address_1'] ?? ''
    276274                                ),
    277275                                array(
    278276                                    'key'           => 'Order.BillingCity',
    279                                     'value'     => $order_data['billing']['city']
     277                                    'value'     => $order_data['billing']['city'] ?? ''
    280278                                ),
    281279                                array(
    282280                                    'key'           => 'Order.BillingZipcode',
    283                                     'value'     => $order_data['billing']['postcode']
     281                                    'value'     => $order_data['billing']['postcode'] ?? ''
    284282                                ),
    285283                                array(
    286284                                    'key'           => 'Order.BillingState',
    287                                     'value'     => $order_data['billing']['state']
     285                                    'value'     => $order_data['billing']['state'] ?? ''
    288286                                ),
    289287                                array(
    290288                                    'key'           => 'Order.BillingCountry',
    291                                     'value'     => $order_data['billing']['country']
     289                                    'value'     => $order_data['billing']['country'] ?? ''
    292290                                ),
    293291                                array(
    294292                                    'key'           => 'Order.BillingTele',
    295                                     'value'     => $order_data['billing']['phone']
     293                                    'value'     => $order_data['billing']['phone'] ?? ''
    296294                                ),
    297295                                array(
    298296                                    'key'           => 'Order.BillingCompany',
    299                                     'value'     => $order_data['billing']['company']
     297                                    'value'     => $order_data['billing']['company'] ?? ''
    300298                                )
    301299                            )
     
    622620
    623621}
     622
  • woorule/trunk/woorule.php

    r2354481 r2400799  
    99 * Plugin URI:      http://github.com/rulecom/woorule
    1010 * Description:     RuleMailer integration for WooCommerce.
    11  * Version:         1.2
     11 * Version:         1.3
    1212 * Author:          RuleMailer, Neevalex
    1313 * Author URI:      http://rule.se
     
    159159    exit;
    160160}
     161
Note: See TracChangeset for help on using the changeset viewer.