Changeset 3484689
- Timestamp:
- 03/17/2026 11:01:17 AM (10 days ago)
- Location:
- woo-mailerlite
- Files:
-
- 14 edited
- 1 copied
-
tags/3.1.12 (copied) (copied from woo-mailerlite/trunk)
-
tags/3.1.12/README.txt (modified) (2 diffs)
-
tags/3.1.12/includes/api/WooMailerLiteRewriteApi.php (modified) (1 diff)
-
tags/3.1.12/includes/common/WooMailerLiteOptions.php (modified) (2 diffs)
-
tags/3.1.12/includes/common/traits/WooMailerLiteResources.php (modified) (2 diffs)
-
tags/3.1.12/includes/controllers/WooMailerLiteOrderController.php (modified) (2 diffs)
-
tags/3.1.12/includes/models/WooMailerLiteCustomer.php (modified) (3 diffs)
-
tags/3.1.12/woo-mailerlite.php (modified) (2 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/includes/api/WooMailerLiteRewriteApi.php (modified) (1 diff)
-
trunk/includes/common/WooMailerLiteOptions.php (modified) (2 diffs)
-
trunk/includes/common/traits/WooMailerLiteResources.php (modified) (2 diffs)
-
trunk/includes/controllers/WooMailerLiteOrderController.php (modified) (2 diffs)
-
trunk/includes/models/WooMailerLiteCustomer.php (modified) (3 diffs)
-
trunk/woo-mailerlite.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-mailerlite/tags/3.1.12/README.txt
r3470352 r3484689 6 6 Tested up to: 6.8.2 7 7 Requires PHP: 7.2.5 8 Stable tag: 3.1.1 18 Stable tag: 3.1.12 9 9 License: GPLv3 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 84 84 85 85 == Changelog == 86 = 3.1.12 (17th March 2026) = 87 * Bug fixes 86 88 87 89 = 3.1.11 (26th February 2026) = -
woo-mailerlite/tags/3.1.12/includes/api/WooMailerLiteRewriteApi.php
r3415073 r3484689 89 89 public function syncOrder($shopId, $orderId, $customer, $cart, $status, $totalPrice, $createdAt) 90 90 { 91 $orderStatus = 'pending'; 92 // if order status from woocommerce is wc-completed or wc-processing, set order status to completed 93 if (in_array($status, ['wc-completed', 'wc-processing'])) { 94 $status = 'completed'; 95 } else if (in_array($status, ['completed', 'processing'])) { 96 $orderStatus = 'complete'; 97 } 98 91 $orderStatus = WooMailerLiteOptions::isCompleteOrderStatus($status) ? 'complete' : 'pending'; 99 92 if ( ! isset($cart['resource_id'])) { 100 93 $cart['resource_id'] = (string)$orderId; -
woo-mailerlite/tags/3.1.12/includes/common/WooMailerLiteOptions.php
r3462363 r3484689 6 6 private static $apiKey = 'apiKey'; 7 7 protected static $toJson = false; 8 9 public const COMPLETE_ORDER_STATUSES = [ 10 'wc-completed', 11 'wc-processing', 12 'completed', 13 'processing', 14 'wc-iscrizione-ok', 15 ]; 16 17 public const PENDING_ORDER_STATUSES = [ 18 'wc-pending', 19 ]; 8 20 9 21 public static function all() … … 98 110 return new self; 99 111 } 112 113 public static function allSupportedOrderStatuses() 114 { 115 return array_merge(self::COMPLETE_ORDER_STATUSES, self::PENDING_ORDER_STATUSES); 116 } 117 118 public static function isCompleteOrderStatus($status) 119 { 120 return in_array($status, self::COMPLETE_ORDER_STATUSES); 121 } 122 123 public static function isPendingOrderStatus($status) 124 { 125 return in_array($status, self::PENDING_ORDER_STATUSES); 126 } 100 127 } -
woo-mailerlite/tags/3.1.12/includes/common/traits/WooMailerLiteResources.php
r3415073 r3484689 85 85 case 'WooMailerLiteCustomer': 86 86 $this->args = array_merge([ 87 'status' => ['wc-completed', 'wc-processing'],87 'status' => WooMailerLiteOptions::COMPLETE_ORDER_STATUSES, 88 88 'type' => 'shop_order', 89 89 'orderby' => 'date', … … 280 280 $orders = wc_get_orders([ 281 281 'billing_email' => $item->get_billing_email(), 282 'status' => ['wc-processing', 'wc-completed'],282 'status' => WooMailerLiteOptions::COMPLETE_ORDER_STATUSES, 283 283 'customer_id' => $item->get_customer_id(), 284 284 'limit' => -1 -
woo-mailerlite/tags/3.1.12/includes/controllers/WooMailerLiteOrderController.php
r3420776 r3484689 26 26 ->getFromOrder() 27 27 ->where("email", $order->get_billing_email()) 28 ->whereIn("status", ["wc-completed", "wc-processing", "wc-pending"])28 ->whereIn("status", WooMailerLiteOptions::allSupportedOrderStatuses()) 29 29 ->first(); 30 30 } … … 166 166 if (isset($response) && $response->success) { 167 167 $order->add_meta_data('_woo_ml_order_data_submitted', true); 168 if ( in_array($order->get_status(), ['wc-completed', 'wc-processing','completed','processing']) && !empty($cart)) {168 if (WooMailerLiteOptions::isCompleteOrderStatus($order->get_status()) && !empty($cart)) { 169 169 if ($cart instanceof WooMailerLiteCart) { 170 170 if ($this->apiClient()->isRewrite()) { -
woo-mailerlite/tags/3.1.12/includes/models/WooMailerLiteCustomer.php
r3377455 r3484689 50 50 ") 51 51 ->from("wc_order_stats") 52 ->whereIn("status", ['wc-processing','wc-completed'])52 ->whereIn("status", WooMailerLiteOptions::COMPLETE_ORDER_STATUSES) 53 53 ->groupBy("wc_order_stats.customer_id"); 54 54 … … 94 94 'wc_order_stats.status' => [ 95 95 'in' => [ 96 'wc-processing', 'wc-completed'96 WooMailerLiteOptions::COMPLETE_ORDER_STATUSES 97 97 ] 98 98 ] … … 126 126 sum(({$prefix}wc_order_stats.total_sales)) AS total_spent") 127 127 ->join('wc_order_stats', 'wc_order_stats.customer_id', 'wc_customer_lookup.customer_id') 128 ->whereIn('wc_order_stats.status', ['wc-processing', 'wc-completed']);128 ->whereIn('wc_order_stats.status', WooMailerLiteOptions::COMPLETE_ORDER_STATUSES); 129 129 if (self::builder()->customTableEnabled() && $sync) { 130 130 $query->where('wc_order_stats.customer_id', '>', WooMailerLiteOptions::get('lastSyncedCustomer', 0)); -
woo-mailerlite/tags/3.1.12/woo-mailerlite.php
r3470352 r3484689 16 16 * Plugin URI: https://mailerlite.com 17 17 * Description: Official MailerLite integration for WooCommerce. Track sales and campaign ROI, import products details, automate emails based on purchases and seamlessly add your customers to your email marketing lists via WooCommerce's checkout process. 18 * Version: 3.1.1 118 * Version: 3.1.12 19 19 * Author: MailerLite 20 20 * Author URI: https://mailerlite.com … … 40 40 * Update when you release new versions. 41 41 */ 42 define( 'WOO_MAILERLITE_VERSION', '3.1.1 1' );42 define( 'WOO_MAILERLITE_VERSION', '3.1.12' ); 43 43 44 44 define('WOO_MAILERLITE_ASYNC_JOBS', false); -
woo-mailerlite/trunk/README.txt
r3470352 r3484689 6 6 Tested up to: 6.8.2 7 7 Requires PHP: 7.2.5 8 Stable tag: 3.1.1 18 Stable tag: 3.1.12 9 9 License: GPLv3 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 84 84 85 85 == Changelog == 86 = 3.1.12 (17th March 2026) = 87 * Bug fixes 86 88 87 89 = 3.1.11 (26th February 2026) = -
woo-mailerlite/trunk/includes/api/WooMailerLiteRewriteApi.php
r3415073 r3484689 89 89 public function syncOrder($shopId, $orderId, $customer, $cart, $status, $totalPrice, $createdAt) 90 90 { 91 $orderStatus = 'pending'; 92 // if order status from woocommerce is wc-completed or wc-processing, set order status to completed 93 if (in_array($status, ['wc-completed', 'wc-processing'])) { 94 $status = 'completed'; 95 } else if (in_array($status, ['completed', 'processing'])) { 96 $orderStatus = 'complete'; 97 } 98 91 $orderStatus = WooMailerLiteOptions::isCompleteOrderStatus($status) ? 'complete' : 'pending'; 99 92 if ( ! isset($cart['resource_id'])) { 100 93 $cart['resource_id'] = (string)$orderId; -
woo-mailerlite/trunk/includes/common/WooMailerLiteOptions.php
r3462363 r3484689 6 6 private static $apiKey = 'apiKey'; 7 7 protected static $toJson = false; 8 9 public const COMPLETE_ORDER_STATUSES = [ 10 'wc-completed', 11 'wc-processing', 12 'completed', 13 'processing', 14 'wc-iscrizione-ok', 15 ]; 16 17 public const PENDING_ORDER_STATUSES = [ 18 'wc-pending', 19 ]; 8 20 9 21 public static function all() … … 98 110 return new self; 99 111 } 112 113 public static function allSupportedOrderStatuses() 114 { 115 return array_merge(self::COMPLETE_ORDER_STATUSES, self::PENDING_ORDER_STATUSES); 116 } 117 118 public static function isCompleteOrderStatus($status) 119 { 120 return in_array($status, self::COMPLETE_ORDER_STATUSES); 121 } 122 123 public static function isPendingOrderStatus($status) 124 { 125 return in_array($status, self::PENDING_ORDER_STATUSES); 126 } 100 127 } -
woo-mailerlite/trunk/includes/common/traits/WooMailerLiteResources.php
r3415073 r3484689 85 85 case 'WooMailerLiteCustomer': 86 86 $this->args = array_merge([ 87 'status' => ['wc-completed', 'wc-processing'],87 'status' => WooMailerLiteOptions::COMPLETE_ORDER_STATUSES, 88 88 'type' => 'shop_order', 89 89 'orderby' => 'date', … … 280 280 $orders = wc_get_orders([ 281 281 'billing_email' => $item->get_billing_email(), 282 'status' => ['wc-processing', 'wc-completed'],282 'status' => WooMailerLiteOptions::COMPLETE_ORDER_STATUSES, 283 283 'customer_id' => $item->get_customer_id(), 284 284 'limit' => -1 -
woo-mailerlite/trunk/includes/controllers/WooMailerLiteOrderController.php
r3420776 r3484689 26 26 ->getFromOrder() 27 27 ->where("email", $order->get_billing_email()) 28 ->whereIn("status", ["wc-completed", "wc-processing", "wc-pending"])28 ->whereIn("status", WooMailerLiteOptions::allSupportedOrderStatuses()) 29 29 ->first(); 30 30 } … … 166 166 if (isset($response) && $response->success) { 167 167 $order->add_meta_data('_woo_ml_order_data_submitted', true); 168 if ( in_array($order->get_status(), ['wc-completed', 'wc-processing','completed','processing']) && !empty($cart)) {168 if (WooMailerLiteOptions::isCompleteOrderStatus($order->get_status()) && !empty($cart)) { 169 169 if ($cart instanceof WooMailerLiteCart) { 170 170 if ($this->apiClient()->isRewrite()) { -
woo-mailerlite/trunk/includes/models/WooMailerLiteCustomer.php
r3377455 r3484689 50 50 ") 51 51 ->from("wc_order_stats") 52 ->whereIn("status", ['wc-processing','wc-completed'])52 ->whereIn("status", WooMailerLiteOptions::COMPLETE_ORDER_STATUSES) 53 53 ->groupBy("wc_order_stats.customer_id"); 54 54 … … 94 94 'wc_order_stats.status' => [ 95 95 'in' => [ 96 'wc-processing', 'wc-completed'96 WooMailerLiteOptions::COMPLETE_ORDER_STATUSES 97 97 ] 98 98 ] … … 126 126 sum(({$prefix}wc_order_stats.total_sales)) AS total_spent") 127 127 ->join('wc_order_stats', 'wc_order_stats.customer_id', 'wc_customer_lookup.customer_id') 128 ->whereIn('wc_order_stats.status', ['wc-processing', 'wc-completed']);128 ->whereIn('wc_order_stats.status', WooMailerLiteOptions::COMPLETE_ORDER_STATUSES); 129 129 if (self::builder()->customTableEnabled() && $sync) { 130 130 $query->where('wc_order_stats.customer_id', '>', WooMailerLiteOptions::get('lastSyncedCustomer', 0)); -
woo-mailerlite/trunk/woo-mailerlite.php
r3470352 r3484689 16 16 * Plugin URI: https://mailerlite.com 17 17 * Description: Official MailerLite integration for WooCommerce. Track sales and campaign ROI, import products details, automate emails based on purchases and seamlessly add your customers to your email marketing lists via WooCommerce's checkout process. 18 * Version: 3.1.1 118 * Version: 3.1.12 19 19 * Author: MailerLite 20 20 * Author URI: https://mailerlite.com … … 40 40 * Update when you release new versions. 41 41 */ 42 define( 'WOO_MAILERLITE_VERSION', '3.1.1 1' );42 define( 'WOO_MAILERLITE_VERSION', '3.1.12' ); 43 43 44 44 define('WOO_MAILERLITE_ASYNC_JOBS', false);
Note: See TracChangeset
for help on using the changeset viewer.