Changeset 3355528
- Timestamp:
- 09/03/2025 03:03:28 PM (7 months ago)
- Location:
- mailchimp-for-woocommerce/trunk
- Files:
-
- 13 edited
-
CHANGELOG.txt (modified) (1 diff)
-
README.txt (modified) (2 diffs)
-
blocks/package-lock.json (modified) (1 diff)
-
bootstrap.php (modified) (1 diff)
-
includes/api/assets/class-mailchimp-cart.php (modified) (4 diffs)
-
includes/api/class-mailchimp-api.php (modified) (4 diffs)
-
includes/class-mailchimp-woocommerce-hpos.php (modified) (1 diff)
-
includes/class-mailchimp-woocommerce-service.php (modified) (3 diffs)
-
includes/class-mailchimp-woocommerce.php (modified) (1 diff)
-
includes/processes/class-mailchimp-woocommerce-cart-update.php (modified) (4 diffs)
-
languages/mc-woocommerce-newsletter.pot (modified) (2 diffs)
-
mailchimp-woocommerce.php (modified) (2 diffs)
-
public/js/mailchimp-woocommerce-public.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mailchimp-for-woocommerce/trunk/CHANGELOG.txt
r3346450 r3355528 1 1 == Changelog == 2 = 5.6 = 3 * Adds support for HPOS Data Caching 4 * Bump tmp from 0.2.1 to 0.2.4 5 * Adds support for syncing based on Mailchimp list interests with a new filter 6 * Adds support for Multi-currency with a new filter 2 7 = 5.5.1 = 3 8 * Guest checkout sync logic fix -
mailchimp-for-woocommerce/trunk/README.txt
r3346473 r3355528 8 8 Requires PHP: 7.4 9 9 WC requires at least: 8.2 10 WC tested up to: 10. 010 WC tested up to: 10.1 11 11 License: GPLv2 or later 12 12 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 79 79 80 80 == Changelog == 81 = 5.5.1 = 82 * Guest checkout sync logic fix 83 * Site Performance update - Disabled mailchimp_landing_site cookie by default. 81 = 5.6 = 82 * Adds support for HPOS Data Caching 83 * Bumps tmp from 0.2.1 to 0.2.4 84 * Adds support for syncing based on Mailchimp list interests with a new filter 85 * Adds support for Multi-currency with a new filter -
mailchimp-for-woocommerce/trunk/blocks/package-lock.json
r3343001 r3355528 21131 21131 }, 21132 21132 "node_modules/tmp": { 21133 "version": "0.2.1", 21134 "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", 21135 "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", 21136 "dev": true, 21137 "dependencies": { 21138 "rimraf": "^3.0.0" 21139 }, 21140 "engines": { 21141 "node": ">=8.17.0" 21142 } 21143 }, 21144 "node_modules/tmp/node_modules/rimraf": { 21145 "version": "3.0.2", 21146 "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", 21147 "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", 21148 "dev": true, 21149 "dependencies": { 21150 "glob": "^7.1.3" 21151 }, 21152 "bin": { 21153 "rimraf": "bin.js" 21154 }, 21155 "funding": { 21156 "url": "https://github.com/sponsors/isaacs" 21133 "version": "0.2.4", 21134 "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.4.tgz", 21135 "integrity": "sha512-UdiSoX6ypifLmrfQ/XfiawN6hkjSBpCjhKxxZcWlUUmoXLaCKQU0bx4HF/tdDK2uzRuchf1txGvrWBzYREssoQ==", 21136 "dev": true, 21137 "license": "MIT", 21138 "engines": { 21139 "node": ">=14.14" 21157 21140 } 21158 21141 }, -
mailchimp-for-woocommerce/trunk/bootstrap.php
r3346450 r3355528 313 313 } 314 314 315 function get_woo_session($key, $default = null) 316 { 317 if (!function_exists('WC')) return $default; 318 319 if (!($woo = WC()) || empty(WC()->session)) { 320 return $default; 321 } 322 323 // not really sure why this would be the case, but if there is no session we can't get it anyway. 324 if (!is_object($woo->session) || !method_exists($woo->session, 'get')) { 325 return $default; 326 } 327 328 return $woo->session->get($key, $default); 329 } 330 315 331 /** 316 332 * @return bool -
mailchimp-for-woocommerce/trunk/includes/api/assets/class-mailchimp-cart.php
r3006868 r3355528 13 13 protected $store_id; 14 14 protected $id; 15 protected $session_id; 15 16 protected $customer; 16 17 protected $checkout_url; … … 30 31 } 31 32 33 public function setSessionId( $session_id ) { 34 $this->session_id = $session_id; 35 36 return $this; 37 } 38 32 39 /** 33 40 * @return mixed … … 104 111 */ 105 112 public function setCurrencyCode() { 106 $this->currency_code = get_woocommerce_currency(); 113 $default_currency = get_woocommerce_currency(); 114 $this->currency_code = apply_filters('mailchimp_woocommerce_cart_currency_code', $default_currency, $this->session_id); 107 115 108 116 return $this; … … 114 122 public function getCurrencyCode() { 115 123 if ( empty( $this->currency_code ) ) { 116 $this->currency_code = get_woocommerce_currency(); 124 $default_currency = get_woocommerce_currency(); 125 $this->currency_code = apply_filters('mailchimp_woocommerce_cart_currency_code', $default_currency, $this->session_id); 117 126 } 118 127 -
mailchimp-for-woocommerce/trunk/includes/api/class-mailchimp-api.php
r3343001 r3355528 281 281 } 282 282 283 $data = $this->cleanListSubmission( 283 $list_interests = apply_filters('mailchimp_sync_user_list_interests', $list_interests, $email); 284 285 $data = $this->cleanListSubmission( 284 286 array( 285 287 'email_type' => 'html', … … 287 289 'status' => $status, 288 290 'merge_fields' => $merge_fields, 289 'interests' => $list_interests,291 'interests' => is_array($list_interests) ? $list_interests : array(), 290 292 'language' => $language, 291 293 'marketing_permissions' => $gdpr_fields, … … 347 349 } 348 350 351 $list_interests = apply_filters('mailchimp_sync_user_list_interests', $list_interests, $email); 352 349 353 $payload = array( 350 354 'email_address' => $email, 351 355 'status' => $status, 352 356 'merge_fields' => $merge_fields, 353 'interests' => $list_interests,357 'interests' => is_array($list_interests) ? $list_interests : array(), 354 358 'language' => $language, 355 359 'marketing_permissions' => $gdpr_fields, … … 565 569 } 566 570 567 $data = array( 571 $list_interests = apply_filters('mailchimp_sync_user_list_interests', $list_interests, $email); 572 573 $data = array( 568 574 'email_address' => $email, 569 575 'status' => $status, 570 576 'status_if_new' => $status_if_new, 571 577 'merge_fields' => $merge_fields, 572 'interests' => $list_interests,578 'interests' => is_array($list_interests) ? $list_interests : array(), 573 579 'language' => $language, 574 580 ); -
mailchimp-for-woocommerce/trunk/includes/class-mailchimp-woocommerce-hpos.php
r3343001 r3355528 62 62 } else { 63 63 $order_c = wc_get_order( $order_id ); 64 $order_c->update_meta_data( $meta_key, $meta_value ); 65 $order_c->save_meta_data(); 64 65 if ($order_c) { 66 $order_c->update_meta_data( $meta_key, $meta_value ); 67 $order_c->save_meta_data(); 68 } else { 69 update_post_meta($order_id, $meta_key, $meta_value); 70 } 66 71 } 67 72 } -
mailchimp-for-woocommerce/trunk/includes/class-mailchimp-woocommerce-service.php
r3346450 r3355528 285 285 $language = $this->user_language ?: substr(get_locale(), 0, 2); 286 286 287 $session_id = function_exists('WC') ? WC()->session->get_customer_id() : null; 288 287 289 // fire up the job handler 288 $handler = new MailChimp_WooCommerce_Cart_Update($uid, $user_email, $this->cart, $language );290 $handler = new MailChimp_WooCommerce_Cart_Update($uid, $user_email, $this->cart, $language, $session_id); 289 291 290 292 // if they had the checkbox checked - go ahead and subscribe them if this is the first post. … … 368 370 * @return void 369 371 */ 370 public function handleProductUpdated( int $post_ID, WP_Post $post_after, WP_Post $post_before ) 371 { 372 public function handleProductUpdated( int $post_ID, ?WP_Post $post_after, ?WP_Post $post_before ) 373 { 374 if (is_null($post_after) || is_null($post_before)) { 375 return; 376 } 377 372 378 if ('product' !== $post_after->post_type) { 373 379 return; … … 551 557 } 552 558 559 public function handleProductVariationUpdated($variation_id, $product) 560 { 561 try { 562 if (!mailchimp_is_configured()) { 563 return; 564 } 565 566 mailchimp_handle_or_queue(new MailChimp_WooCommerce_Single_Product_Variation($variation_id), 5); 567 } catch (Exception $e) { 568 mailchimp_error('update product variation', $e->getMessage()); 569 } 570 } 571 553 572 /** 554 573 * Fire new order and order save handling/queueing events when a shop_order post is saved. -
mailchimp-for-woocommerce/trunk/includes/class-mailchimp-woocommerce.php
r3343001 r3355528 432 432 $this->loader->add_action('woocommerce_delete_coupon', $service, 'handlePostTrashed'); 433 433 $this->loader->add_action('woocommerce_trash_coupon', $service, 'handlePostTrashed'); 434 434 435 $this->loader->add_action('woocommerce_update_product_variation', $service, 'handleProductVariationUpdated', 10, 2); 436 435 437 $this->loader->add_action('woocommerce_rest_delete_shop_coupon_object', $service, 'handleAPICouponTrashed', 10, 3); 436 438 $this->loader->add_action('woocommerce_rest_insert_shop_coupon_object', $service, 'handleAPICouponUpdated', 10, 3); -
mailchimp-for-woocommerce/trunk/includes/processes/class-mailchimp-woocommerce-cart-update.php
r3253510 r3355528 13 13 public $id; 14 14 public $email; 15 public $session_id; 15 16 public $previous_email; 16 17 public $cart_data; … … 28 29 * @param null $user_language 29 30 */ 30 public function __construct($uid = null, $email = null, array $cart_data = array(), $user_language = null )31 public function __construct($uid = null, $email = null, array $cart_data = array(), $user_language = null, $session_id = null) 31 32 { 32 33 if ($uid) { … … 42 43 if ($user_language) { 43 44 $this->user_language = $user_language; 45 } 46 47 if ($session_id) { 48 $this->session_id = $session_id; 44 49 } 45 50 … … 119 124 $cart = new MailChimp_WooCommerce_Cart(); 120 125 $cart->setId($this->id); 126 $cart->setSessionId($this->session_id); 121 127 $cart->setCheckoutUrl($checkout_url); 122 128 $cart->setCurrencyCode(); -
mailchimp-for-woocommerce/trunk/languages/mc-woocommerce-newsletter.pot
r3141736 r3355528 1 # Copyright (C) 202 41 # Copyright (C) 2025 2 2 # This file is distributed under the same license as the package. 3 3 msgid "" … … 5 5 "Project-Id-Version: \n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/blocks\n" 7 "POT-Creation-Date: 202 4-07-30 14:12:30+00:00\n"7 "POT-Creation-Date: 2025-08-20 08:03:29+00:00\n" 8 8 "MIME-Version: 1.0\n" 9 9 "Content-Type: text/plain; charset=utf-8\n" 10 10 "Content-Transfer-Encoding: 8bit\n" 11 "PO-Revision-Date: 202 4-MO-DA HO:MI+ZONE\n"11 "PO-Revision-Date: 2025-MO-DA HO:MI+ZONE\n" 12 12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 13 13 "Language-Team: LANGUAGE <LL@li.org>\n" -
mailchimp-for-woocommerce/trunk/mailchimp-woocommerce.php
r3346450 r3355528 17 17 * Plugin URI: https://mailchimp.com/connect-your-store/ 18 18 * Description: Connects WooCommerce to Mailchimp to sync your store data, send targeted campaigns to your customers, and sell more stuff. 19 * Version: 5. 5.119 * Version: 5.6 20 20 * Author: Mailchimp 21 21 * Author URI: https://mailchimp.com … … 28 28 * Tested up to: 6.8 29 29 * WC requires at least: 8.2 30 * WC tested up to: 10 30 * WC tested up to: 10.1 31 31 */ 32 32 -
mailchimp-for-woocommerce/trunk/public/js/mailchimp-woocommerce-public.js
r3209992 r3355528 39 39 if (!mailchimp_cart.valueEmail(b) || mailchimp_submitted_email === b) { return false; } 40 40 mailchimp_cart.setEmail(b); 41 console.log(b); 42 console.log(mailchimp_cart); 41 43 42 var c = mailchimp_public_data.ajax_url + "?action=mailchimp_set_user_by_email"; 44 43 var d = new XMLHttpRequest; 45 44 d.open("POST", c, !0); 46 45 d.onload = function () { 47 console.log(d);48 46 var successful = d.status >= 200 && d.status < 400; 49 47 var msg = successful ? "mailchimp.handle_billing_email.request.success" : "mailchimp.handle_billing_email.request.error"; … … 187 185 188 186 mailchimpReady(function () { 189 190 console.log('mailchimp ready');191 187 // if they've told us we can't do this - we have to honor it. 192 188 if (!mailchimp_public_data.allowed_to_set_cookies) return;
Note: See TracChangeset
for help on using the changeset viewer.