Changeset 2354434
- Timestamp:
- 08/07/2020 08:36:34 AM (6 years ago)
- Location:
- woorule/trunk
- Files:
-
- 6 edited
-
README.md (modified) (1 diff)
-
README.txt (modified) (1 diff)
-
includes/admin/settings/class-wc-admin-settings-woorule.php (modified) (5 diffs)
-
includes/api/class-wc-rulemailer-api.php (modified) (3 diffs)
-
includes/class-wc-woorule.php (modified) (1 diff)
-
woorule.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
woorule/trunk/README.md
r2338430 r2354434 72 72 Bugfixes 73 73 Visual Adjustments 74 75 ### 1.2 76 Bugfixes -
woorule/trunk/README.txt
r2338430 r2354434 60 60 Bugfixes 61 61 Visual Adjustments 62 63 = 1.2 = 64 Bugfixes -
woorule/trunk/includes/admin/settings/class-wc-admin-settings-woorule.php
r2338430 r2354434 84 84 if ($enabled) { 85 85 $which_event = get_option($rule['occurs']['id']); 86 $ is_opt_in_rule= false;87 $ want_in = true;86 $optInCheckboxIsShown = false; 87 $acceptsOptIn = false; 88 88 89 89 if (isset($rule['show_opt_in'])) { 90 $ is_opt_in_rule= get_option($rule['show_opt_in']['id']) === 'yes' ? true : false;90 $optInCheckboxIsShown = get_option($rule['show_opt_in']['id']) === 'yes' ? true : false; 91 91 } 92 92 93 if ($ is_opt_in_rule) {94 $ want_in = get_post_meta($id, 'woorule_opt_in_'.$k, false);95 96 if (! empty($ want_in)) {97 $ want_in = $want_in[0] === 'yes' ? true : false;93 if ($optInCheckboxIsShown) { 94 $acceptsOptIn = get_post_meta($id, 'woorule_opt_in_'.$k, false); 95 96 if (! empty($acceptsOptIn)) { 97 $acceptsOptIn = $acceptsOptIn[0] === 'yes' ? true : false; 98 98 } 99 99 } 100 100 101 if ($ want_in && $new_status === $which_event) {101 if ($new_status === $which_event) { 102 102 $integration = new WC_Integration_RuleMailer(); 103 103 $order = new WC_Order($id); … … 149 149 $phone = $order->get_billing_phone(); 150 150 151 $newphone = '';152 if ((preg_match('/\+(0|\+?\d{2})(\d{7,8})/', $phone))) {153 $newphone = array('key' =>'Subscriber.Tele', 'value' => $phone);154 }155 156 151 // I feel bad for this, but no other methods was working. 157 152 $newtags = explode(',', get_option($rule['tags']['id'])); 158 153 if (!(strlen($newtags[0])>1)) { 159 154 $newtags[0]='OrderComplete'; 155 } 156 157 if ($acceptsOptIn) { 158 array_push($newtags, 'Newsletter'); 160 159 } 161 160 … … 167 166 'auto_create_tags' => get_option($rule['auto_create_tags']['id']) === 'yes' ? true : false, 168 167 'auto_create_fields' => get_option($rule['auto_create_fields']['id']) === 'yes' ? true : false, 169 'automation' => get_option($rule['automation']['id']) === 'reset' ? 'reset' : 'force',168 'automation' => get_option($rule['automation']['id']), 170 169 171 170 'async' => true, … … 221 220 'key' => 'Subscriber.Company', 222 221 'value' => $order->get_billing_company() 223 ), 222 ), 223 array( 224 'key' => 'Subscriber.Source', 225 'value' => 'WooRule' 226 ), 224 227 array( 225 228 'key' => 'Order.Date', … … 516 519 'default' => 'reset', 517 520 'options' => array( 521 'default' => __('Default', 'woorule'), 518 522 'force' => __('Force', 'woorule'), 519 'reset' => __('Reset', 'woorule') 523 'reset' => __('Reset', 'woorule'), 520 524 ), 521 525 ), -
woorule/trunk/includes/api/class-wc-rulemailer-api.php
r2099597 r2354434 29 29 public static function new_subscription($email) 30 30 { 31 $sourceData = array( 32 'key' => 'Subscriber.Source', 33 'value' => 'WooRule' 34 ); 35 31 36 $subscription = array( 32 37 'apikey' => get_option('woocommerce_rulemailer_settings')['woorule_api_key'], … … 36 41 'async' => true, 37 42 'tags' => array('Newsletter'), 38 'subscribers' => array('email' => $email )43 'subscribers' => array('email' => $email, 'fields' => array($sourceData)) 39 44 ); 40 45 … … 72 77 if (is_array($msg) || is_object($msg)) { 73 78 $logger->add('woorule', print_r($msg, true)); 74 //$logger->add('woorule', print_r( json_encode($body_data), true ) );75 79 } else { 76 80 $logger->add('woorule', $msg); 77 //$logger->add('woorule', json_encode($body_data) );78 81 } 79 82 } -
woorule/trunk/includes/class-wc-woorule.php
r2338430 r2354434 78 78 'default' => 'reset', 79 79 'options' => array( 80 'default' => __('Default', 'woorule'), 80 81 'force' => __('Force', 'woorule'), 81 82 'reset' => __('Reset', 'woorule') -
woorule/trunk/woorule.php
r2338430 r2354434 9 9 * Plugin URI: http://github.com/rulecom/woorule 10 10 * Description: RuleMailer integration for WooCommerce. 11 * Version: 1. 111 * Version: 1.2 12 12 * Author: RuleMailer, Neevalex 13 13 * Author URI: http://rule.se
Note: See TracChangeset
for help on using the changeset viewer.