• Resolved kjztuning

    (@kjztuning)


    Would it be possible after editing the variations to add it to the cart as a new item and leaving the original item there too?

    As an example: I add a BLACK, MEDIUM, Skull T-shirt to my cart.

    When I get to the cart the button from the plugin reads ADD SIMILAR

    I click which brings up the edit function

    I change the item to PINK, SMALL, Skull T-shirt and press ok.

    My cart now has 1x BLACK, MEDIUM, Skull T-Shirt and 1x PINK, SMALL, Skull T-Shirt

Viewing 1 replies (of 1 total)
  • Thread Starter kjztuning

    (@kjztuning)

    go to

    woo-update-variations-in-cart/front/class-wc_update-variation_in-cart_ck.php

    Find the text and comment out the remove function.

    public function woo_ck_wuvic_update_product_in_cart() {
    
    		parse_str( $_POST[ 'form_data' ] );
    
    		global $wpdb,$woocommerce;
    
    		$cart_url = wc_get_cart_url();
    
    		if( '' != $variation_id){
    
    			//$woocommerce->cart->remove_cart_item($_POST['old_key']);
    			//Commented out to add new item to cart rathen than replace
    			//Keith - 23.6
    
    		}
    
    		wp_redirect($cart_url.'?'.$_POST['form_data']);die();

    Comment out remove function to leave the older item

    • This reply was modified 5 years, 5 months ago by kjztuning. Reason: wrong position of code tag
Viewing 1 replies (of 1 total)
  • The topic ‘Appending Edit rather than replacing’ is closed to new replies.