PluginProbe
MailerLite – WooCommerce integration / trunk
MailerLite – WooCommerce integration vtrunk
3.1.27 3.1.25 3.1.26 3.1.24 3.1.23 3.1.22 3.1.21 3.1.20 3.1.19 3.1.18 3.1.17 3.1.16 3.1.15 1.8.7 1.8.8 2.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 All 148 releases
← All changes | includes/WooMailerLiteService.php +5 -4 3.1.26 → trunk View file →
@@ -29,8 +29,9 @@
29 29 * @return true
30 30 */
31 31 public function handleCartUpdated()
32 32 {
33 + WooMailerLiteLanguageService::capture();
33 34 WooMailerLiteSession::set('woo_mailerlite_cart_hash', WC()->session->get_customer_id());
34 35 $cart = WooMailerLiteCart::where('hash', WooMailerLiteSession::getMLCartHash())->first();
35 36 $data = WooMailerLiteSession::cart();
36 37 $data = json_decode($data, true);
@@ -75,8 +76,9 @@
75 76 * @return void
76 77 */
77 78 public function handleCheckoutPage()
78 79 {
80 + WooMailerLiteLanguageService::capture();
79 81 if (is_user_logged_in()) {
80 82 $this->sendCart();
81 83 }
82 84 }
@@ -101,8 +103,10 @@
101 103 if (!WooMailerLiteSession::getMLCartHash()) {
102 104 $this->handleCartUpdated();
103 105 }
104 106
107 + WooMailerLiteLanguageService::capture();
108 +
105 109 WooMailerLiteSession::set('woo_mailerlite_customer_data', ['customer' => $_POST, 'cart' => WC()->session->get( 'woo_mailerlite_cart_hash')]);
106 110 // find the cart by cart id
107 111 $cart = WooMailerLiteCart::where('hash', WooMailerLiteSession::getMLCartHash())->first();
108 112
@@ -172,12 +176,9 @@
172 176 },
173 177 ARRAY_FILTER_USE_BOTH
174 178 );
175 179
176 - if (isset($checkoutData['language'])) {
177 - $orderCustomer['subscriber_fields']['subscriber_language'] = $checkoutData['language'];
178 - $orderCustomer['subscriber_fields']['language'] = $checkoutData['language'];
179 - }
180 + $orderCustomer['subscriber_fields'] = WooMailerLiteLanguageService::applyTo($orderCustomer['subscriber_fields']);
180 181
181 182 $orderCart = [
182 183 'resource_id' => (string)$checkoutData['id'],
183 184 'checkout_url' => $checkoutData['abandoned_checkout_url'],