• Resolved chelder86

    (@gmh2000)


    Hi! I have realised some client get confused when they click on “pay now”, it redirects to the cart page thanks to your beautiful plugin, and they see a quantity much bigger than the one of the previous step. So they feel cheated and abandon the website. Let me give you an example:

    step1: 30€ PAY NOW <– User click (so it is added to the cart)
    step2: user left because whatever reason
    step3: 30€ PAY NOW <— User comes back. User clicks again.
    step4: PRICE TO PAY 60€ <— User does not seem the quantity of 2, so he feels cheated. He abandons

    Is there any way to reset the cart so each time the user clicks on PAY NOW, it reset the quantity of items to 1?

    Thanks for your simple and perfect plugin!

    Carlos

Viewing 2 replies - 1 through 2 (of 2 total)
  • This would be a great addition. It also appears to block jumping to the checkout when attempting to re-add a product that can only be purchased individually.

    Can do it with the following answer from stackoverflow. I quoted it here to save you a click or in case whatever reason the link fails in the future.

    Unfortunately there is no ‘action’ hook before WooCommerce adds an item to the cart. But they have a ‘filter’ hook before adding to cart. That is how I use it:

    add_filter( 'woocommerce_add_cart_item_data', 'woo_custom_add_to_cart' );
    
    function woo_custom_add_to_cart( $cart_item_data ) {
    
        global $woocommerce;
        $woocommerce->cart->empty_cart();
    
        // Do nothing with the data and return
        return $cart_item_data;
    }

    Source:
    http://stackoverflow.com/questions/21363268/need-woocommerce-to-only-allow-1-product-in-the-cart-if-a-product-is-already-in

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding a single product to the cart without adding the previous ones’ is closed to new replies.