• Hi, I searched through 35 pages of posts but could not find this issue, so apologies if it’s been raised.
    After making a purchase, the cart still displays the product already purchased. Is there a way to clear the cart after the purchase is complete? I would think that would be automatic, so is this an error or a problem that needs a solution? ie do I need to purchase another plugin to fix this?
    Regards,

    Jam

    https://www.ads-software.com/plugins/woocommerce/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    It should be clearing itself after an order. See https://github.com/woothemes/woocommerce/blob/efd390e9510d168ae730b05504225aa21b2a99cc/includes/wc-cart-functions.php#L154

    Could be related to the payment gateway plugin you are using.

    Also make sure you aren’t caching the page: https://docs.woocommerce.com/document/configuring-caching-plugins/

    Thread Starter Jamncream

    (@jamncream)

    Thank you Caleb, that’s great news that it should be clearing. Now I just have to work out why it isnt. I just read (my apologies) that support is only for Wootheme users?
    I am not using any caching plugins.
    I am using a custom built (themeframe) theme, and to get Woo to work I had to create a woocommerce.php (as per instructions I found somewhere).

    Then replace:
    <?php if ( have_posts() ) :
    and usually ends with:
    <?php endif; ?>

    With:
    <?php woocommerce_content(); ?>
    It’s all working perfectly except for the cart not clearing after a purchase has been made.

    I am using the standard PayPal gateway.
    Website shop: https://www.waterairwisdom.com.au/shop

    If your help does not extend to non Wootheme users, can you suggest how I can get support for this issue?
    Thanks again.

    Thread Starter Jamncream

    (@jamncream)

    I found that section in /wc-cart-functions.php and all looks correct.
    ***********
    /**
    * Clear cart after payment.
    *
    * @access public
    */
    function wc_clear_cart_after_payment() {
    global $wp;

    if ( ! empty( $wp->query_vars[‘order-received’] ) ) {

    ***********

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    If your help does not extend to non Wootheme users, can you suggest how I can get support for this issue?

    Support here in the forums is community support. Anybody can post / help. You’re referring to WooCommerce.com support which is for paying customers, yes.

    I found that section in /wc-cart-functions.php and all looks correct.

    Did you check on caching? I’m fairly sure that is the problem here: https://docs.woocommerce.com/document/configuring-caching-plugins/. Talk with your web host.

    Thread Starter Jamncream

    (@jamncream)

    Thanks again for your help Caleb. I am not using any caching plugins so I will check with my host, thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Update cart after purchase’ is closed to new replies.