Changeset 2750161
- Timestamp:
- 06/30/2022 10:42:04 AM (4 years ago)
- Location:
- chirpyweb
- Files:
-
- 4 edited
-
tags/1.2/includes/class-chirpyweb-init.php (modified) (5 diffs)
-
tags/1.2/readme.txt (modified) (1 diff)
-
trunk/includes/class-chirpyweb-init.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
chirpyweb/tags/1.2/includes/class-chirpyweb-init.php
r2749139 r2750161 584 584 public function chirpyweb_cart_data() { 585 585 $cart_session = WC()->session->get( 'cw_cart_token' ); 586 586 587 $wpurl = get_bloginfo( 'wpurl' ); 587 588 $cart_contents = WC()->cart->get_cart_contents(); … … 608 609 'value' => $total, 609 610 'is_abandoned' => true, 611 'is_empty_cart' => false, 610 612 'cart_url' => $cart_url, 611 613 'website_key' => $tokan, … … 624 626 $cart_val = $response_code->detail; 625 627 } 628 629 if( empty( $cart_contents ) ) { 630 $total = WC()->cart->get_subtotal(); 631 $temp = array( 632 'subscription_id' => $sub_id, 633 'cart_id' => $cart_session, 634 'value' => $total, 635 'is_abandoned' => true, 636 'is_empty_cart' => true, 637 'cart_url' => $cart_url, 638 'website_key' => $tokan, 639 ); 640 $response = wp_safe_remote_post( 641 CHIRPY_WP_API . 'wp/cart/', 642 array( 643 'headers' => array( 644 'x-website-key' => $tokan, 645 'x-website-url' => $wpurl, 646 ), 647 'body' => $temp, 648 ) 649 ); 650 $response_code = json_decode( wp_remote_retrieve_body( $response ) ); 651 $cart_val = $response_code->detail; 652 } 653 626 654 } 627 655 … … 669 697 $tokan = $settings['token']; 670 698 $cart_url = wc_get_cart_url(); 671 $cart_id = $order->get_meta( 'cw_cart_token' );699 $cart_id = WC()->session->get( 'cw_cart_token' ); 672 700 update_post_meta( $order_id, 'subscription_id', $sub_id ); 673 701 $order->save; … … 678 706 'value' => $total, 679 707 'is_abandoned' => false, 708 'is_empty_cart' => true, 680 709 'cart_url' => $cart_url, 681 710 'website_key' => $tokan, -
chirpyweb/tags/1.2/readme.txt
r2749139 r2750161 83 83 * Change the Short Description 84 84 * Update error message 85 86 87 = 1.2 = 88 * Added All the Woocommerce push notification functionality 89 * Abandoned Cart Notifications 90 * Back in Stock Alerts 91 * Price Drop Alerts 92 * Shipping Order Tracking Alerts -
chirpyweb/trunk/includes/class-chirpyweb-init.php
r2749139 r2750161 584 584 public function chirpyweb_cart_data() { 585 585 $cart_session = WC()->session->get( 'cw_cart_token' ); 586 586 587 $wpurl = get_bloginfo( 'wpurl' ); 587 588 $cart_contents = WC()->cart->get_cart_contents(); … … 608 609 'value' => $total, 609 610 'is_abandoned' => true, 611 'is_empty_cart' => false, 610 612 'cart_url' => $cart_url, 611 613 'website_key' => $tokan, … … 624 626 $cart_val = $response_code->detail; 625 627 } 628 629 if( empty( $cart_contents ) ) { 630 $total = WC()->cart->get_subtotal(); 631 $temp = array( 632 'subscription_id' => $sub_id, 633 'cart_id' => $cart_session, 634 'value' => $total, 635 'is_abandoned' => true, 636 'is_empty_cart' => true, 637 'cart_url' => $cart_url, 638 'website_key' => $tokan, 639 ); 640 $response = wp_safe_remote_post( 641 CHIRPY_WP_API . 'wp/cart/', 642 array( 643 'headers' => array( 644 'x-website-key' => $tokan, 645 'x-website-url' => $wpurl, 646 ), 647 'body' => $temp, 648 ) 649 ); 650 $response_code = json_decode( wp_remote_retrieve_body( $response ) ); 651 $cart_val = $response_code->detail; 652 } 653 626 654 } 627 655 … … 669 697 $tokan = $settings['token']; 670 698 $cart_url = wc_get_cart_url(); 671 $cart_id = $order->get_meta( 'cw_cart_token' );699 $cart_id = WC()->session->get( 'cw_cart_token' ); 672 700 update_post_meta( $order_id, 'subscription_id', $sub_id ); 673 701 $order->save; … … 678 706 'value' => $total, 679 707 'is_abandoned' => false, 708 'is_empty_cart' => true, 680 709 'cart_url' => $cart_url, 681 710 'website_key' => $tokan, -
chirpyweb/trunk/readme.txt
r2749139 r2750161 83 83 * Change the Short Description 84 84 * Update error message 85 86 87 = 1.2 = 88 * Added All the Woocommerce push notification functionality 89 * Abandoned Cart Notifications 90 * Back in Stock Alerts 91 * Price Drop Alerts 92 * Shipping Order Tracking Alerts
Note: See TracChangeset
for help on using the changeset viewer.