Changeset 2336028
- Timestamp:
- 07/06/2020 12:35:23 PM (6 years ago)
- Location:
- platformly-for-woocommerce/trunk
- Files:
-
- 4 edited
-
includes/class-abandoned-cart.php (modified) (1 diff)
-
includes/class-platformly-woocommerce-rest-api.php (modified) (3 diffs)
-
platformly-for-woocommerce.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
platformly-for-woocommerce/trunk/includes/class-abandoned-cart.php
r2304947 r2336028 51 51 } 52 52 53 $cart_data = json_encode($current_cart);54 53 $user_id = get_current_user_id(); 54 // Get cart total data 55 $current_cart_totals = WC()->session->cart_totals; 56 if(empty($current_cart_totals)){ 57 $current_cart_totals = []; 58 } 59 60 $cart_data = json_encode([ 61 'cart' => $current_cart, 62 'cart_totals' => $current_cart_totals, 63 ]); 55 64 56 65 global $wpdb; -
platformly-for-woocommerce/trunk/includes/class-platformly-woocommerce-rest-api.php
r2304947 r2336028 179 179 180 180 $cart_data = json_decode($abandoned_cart->cart_data, true); 181 181 182 $cart = array(); 182 foreach ($cart_data as $_item) { 183 if(isset($cart_data['cart'])){ 184 $data = $cart_data['cart']; 185 }else{ 186 $data = $cart_data; 187 } 188 foreach ($data as $_item) { 183 189 $product = wc_get_product( $_item['product_id'] ); 184 190 … … 191 197 'price' => $product->get_price(), 192 198 'currency' => get_woocommerce_currency_symbol(), 193 'quantity' => $_item['quantity'] 199 'quantity' => $_item['quantity'], 200 'subtotal' => $_item['line_subtotal'], 201 'total' => $_item['line_total'], 202 'tax' => $_item['line_tax'] 194 203 ); 195 204 $cart[$product_id] = $item; … … 203 212 'last_name' => $user_meta['last_name'][0], 204 213 'cart' => $cart, 205 'ply_wc_restore_cart' => $restore_cart_key 214 'ply_wc_restore_cart' => $restore_cart_key, 215 'cart_totals' => isset($cart_data['cart_totals']) ? $cart_data['cart_totals'] : [] 206 216 ); 207 217 -
platformly-for-woocommerce/trunk/platformly-for-woocommerce.php
r2304947 r2336028 4 4 * Plugin Name: Platform.ly for WooCommerce 5 5 * Description: Easily connect WooCommerce to your Platformly CRM, set up abandoned cart campaigns and access detailed customer reporting: lifetime value and more... 6 * Version: 1. 06 * Version: 1.1 7 7 * Author: Platform.ly 8 8 * Author URI: https://www.platform.ly/ 9 9 * 10 10 * WC requires at least: 3.5.0 11 * WC tested up to: 4. 0.111 * WC tested up to: 4.2.2 12 12 * 13 13 * License: GPL-2.0+ … … 867 867 868 868 private function set_ply_activity($event) { 869 if (session_id() === '') {870 session_start();871 }872 869 $event['time'] = time(); 873 $_SESSION['ply_activity'][] = $event; 870 $ply_activity = $this->get_ply_activity(); 871 if(!is_array($ply_activity)){ 872 $ply_activity = []; 873 } 874 $ply_activity[] = $event; 875 platform_wc_set_wc_session('ply_activity', $ply_activity); 874 876 } 875 877 876 878 private function get_ply_activity() { 877 if (session_id() === '') { 878 session_start(); 879 } 880 return !empty($_SESSION['ply_activity']) ? $_SESSION['ply_activity'] : false; 879 return platform_wc_get_wc_session('ply_activity'); 881 880 } 882 881 883 882 private function unset_ply_activity() { 884 if (isset($_SESSION['ply_activity'])) { 885 unset($_SESSION['ply_activity']); 886 } 883 platform_wc_unset_wc_session('ply_activity'); 887 884 } 888 885 -
platformly-for-woocommerce/trunk/readme.txt
r2304947 r2336028 118 118 119 119 = 1.0 = 120 Initial release. No previous versions are available. 120 * Initial release. No previous versions are available. 121 122 = 1.1 = 123 * Updated abandoned cart functionality 121 124 122 125 == Upgrade Notice == 123 126 124 127 = 1.0 = 125 Initial release. No previous versions are available. 128 * Initial release. No previous versions are available. 129 130 = 1.1 = 131 * Updated abandoned cart functionality
Note: See TracChangeset
for help on using the changeset viewer.