Plugin Directory

Changeset 2786898


Ignore:
Timestamp:
09/19/2022 11:14:58 AM (4 years ago)
Author:
shelfyio
Message:

Fix Merge Cart Update

Location:
shelfy-mobile-commerce-platform
Files:
42 added
3 edited

Legend:

Unmodified
Added
Removed
  • shelfy-mobile-commerce-platform/trunk/README.txt

    r2774890 r2786898  
    1 === Shelfy - Mobile App Builder - Dev ===
     1=== Shelfy - Mobile App Builder ===
    22Contributors: itziksn
    33Tags: woocommerce, mobile, application, android, ios
    44Requires at least: 5.8
    55Tested up to: 6.0
    6 Stable tag: 1.0.3
     6Stable tag: 1.0.4
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • shelfy-mobile-commerce-platform/trunk/includes/controllers/class-shelfy-cart-rest-api.php

    r2774890 r2786898  
    2626     */
    2727    private $api_base = 'cart';
     28    private static $user_id = 0;
    2829
    2930    /**
     
    3132     */
    3233    public function __construct() {
     34        Shelfy_Cart_Rest_Api::$user_id=get_current_user_id();
    3335        add_action( 'rest_api_init', array( $this, 'shelfy_init_cart_rest_api' ) );
    3436        add_filter( 'woocommerce_is_rest_api_request', array( $this, 'simulate_as_not_rest' ) );
     
    141143     */
    142144    public static function get_cart_response() {
     145        wp_set_current_user(Shelfy_Cart_Rest_Api::$user_id);
    143146        /**
    144147         * The SchemaController
     
    172175     */
    173176    public function empty_cart() {
     177        wp_set_current_user(Shelfy_Cart_Rest_Api::$user_id);
    174178        WC()->cart->empty_cart();
    175179        WC()->cart->calculate_totals();
     
    183187     */
    184188    public function batch_update_item_quantity( $request ) {
     189        wp_set_current_user(Shelfy_Cart_Rest_Api::$user_id);
    185190        $requests       = $request['products'];
    186191        $batch_response = array();
     
    209214     */
    210215    public function calculate_cart( $request ) {
     216        wp_set_current_user(Shelfy_Cart_Rest_Api::$user_id);
    211217        $old_cart = clone WC()->cart;
    212218        $cart     = WC()->cart;
     
    240246     */
    241247    public function update_item_quantity( $request, $add_always = false ) {
     248        wp_set_current_user(Shelfy_Cart_Rest_Api::$user_id);
    242249        $product_id = $request['productId'];
    243250        $variant_id = $request['variantId'];
  • shelfy-mobile-commerce-platform/trunk/shelfy.php

    r2774890 r2786898  
    77 * Plugin Name:       Shelfy - Mobile App Builder - Dev
    88 * Description:       Build fast mobile apps that you control — no coding is required.
    9  * Version:           1.0.3
    10  * Stable tag:        1.0.3
     9 * Version:           1.0.4
     10 * Stable tag:        1.0.4
    1111 * WC requires at least: 5.0
    1212 * WC tested up to: 6.7
     
    2424}
    2525
    26 define( 'SHELFY_VERSION', '1.0.3' );
     26define( 'SHELFY_VERSION', '1.0.4' );
    2727define( 'SHELFY_MAIN_PLUGIN_FILE', __FILE__ );
    2828define( 'SHELFY_REQUIRED_WOOCOMMERCE_VERSION', '5.8.0' );
Note: See TracChangeset for help on using the changeset viewer.