Plugin Directory

Changeset 3469845


Ignore:
Timestamp:
02/26/2026 04:28:20 AM (10 days ago)
Author:
rermis
Message:

v1.0.7 = * Fix assign orderid on checkout

Location:
view-carts/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • view-carts/trunk/readme.txt

    r3461083 r3469845  
    66Requires at least: 6.6
    77Tested up to: 6.9
    8 Stable tag: 1.0.6
     8Stable tag: 1.0.7
    99
    1010A simple, fast, lightweight admin tool to share or recreate recent WooCommerce carts. Label carts, adjust pricing, and manage coupons.
     
    3737
    3838== Changelog ==
     39= 1.0.7 = * Fix assign orderid on checkout
    3940= 1.0.6 = * Fix cart save when variation selected
    4041= 1.0.5 = * Only display unexpired coupons in admin dropdown
  • view-carts/trunk/vc_functions.php

    r3461083 r3469845  
    99Author URI: https://richardlerma.com/contact/
    1010Requires Plugins: woocommerce
    11 Version: 1.0.6
     11Version: 1.0.7
    1212Text Domain: view-carts
    1313Copyright: (c) 2019-2025 rldd.net - All Rights Reserved
     
    1515License URI: http://www.gnu.org/licenses/gpl-3.0.html
    1616WC requires at least: 9.0
    17 WC tested up to: 10.3
     17WC tested up to: 10.5
    1818*/
    1919
     
    7575function wcvsc_save_cart(){
    7676  if(is_admin()||wp_doing_cron()||!function_exists('WC')||!WC()->cart)return;
    77   if(defined('REST_REQUEST')&&REST_REQUEST)return;
    78   if(function_exists('wp_is_json_request')&&wp_is_json_request())return;
     77  $uri=$_SERVER['REQUEST_URI']??'';
     78  if((defined('REST_REQUEST')&&REST_REQUEST)&&($uri&&(stripos($uri,'/wp-json/wc/store/')!==false||stripos($uri,'/wc/store/')!==false)))return;
     79  if(!empty($_GET['rest_route'])&&stripos((string)$_GET['rest_route'],'/wc/store/')!==false)return;
    7980  if(empty($_COOKIE['wcvsc_active'])||$_COOKIE['wcvsc_active']!=='1')return;
    8081  if(WC()->session&&!WC()->session->has_session())WC()->session->set_customer_session_cookie(true);
    8182  $c=WC()->cart->get_cart();if(!$c)return;
    8283  $ip=wcvsc_ip();
    83   $k=wcvsc_cart_key();
     84  $k='';
     85  if(function_exists('WC')&&WC()->session&&method_exists(WC()->session,'get')){
     86    $k=WC()->session->get('wcvsc_key');
     87    if(!$k)$k=wcvsc_cart_key();
     88    WC()->session->set('wcvsc_key',$k);
     89  }else $k=wcvsc_cart_key();
    8490  if(get_transient("wcvsc_update_$k"))return;
    8591  $wcvsc_cart=wcvsc_get_cart($k);
     
    365371function wcvsc_order_thankyou($order_id){
    366372  if(!$order_id)return;
    367   $k=wcvsc_cart_key();
     373  $k='';
     374  if(function_exists('WC')&&WC()->session&&method_exists(WC()->session,'get'))$k=WC()->session->get('wcvsc_key');
     375  if(!$k)$k=wcvsc_cart_key();
    368376  $t=wcvsc_get_cart($k);if(!$t)return;
    369377  $t['order_id']=(int)$order_id;
     
    380388  }
    381389  wcvsc_set_cart($k,$t);
     390  set_transient('wcvsc_refresh','1');
    382391}
    383392add_action('woocommerce_thankyou','wcvsc_order_thankyou',10,1);
Note: See TracChangeset for help on using the changeset viewer.