Support » Plugin: Direct Checkout for WooCommerce » After use buy now button & login it adds double to cart

  • Resolved Derek Wilcox

    (@themassapothecary)


    I have the pro version and have buy now buttons on product pages. The problem I am having is that if you click buy now button and then log in on the checkout page it double adds the products. One time when you 1st get to the checkout page and then it adds the product again when the page re loads from logging in.

    How can I fix this?

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Please debug as following if you haven’t done yet:

    • Deactivate all plugins one by one checking each time.
    • Switch to Storefront theme and test
    • Disable any custom scripts you might have
    • .

    Thread Starter Derek Wilcox

    (@themassapothecary)

    @sebastopolys already did. The problem is that when you click buy now button it adds to the checkout URL something like – ?add-to-cart=34574&quantity=1

    Once on the checkout page if you log in it brings you right back to the same url which has ?add-to-cart=34574&quantity=1 at the end so it repeats the add to cart.

    How can I fix it so that after login on the checkout page it redirects to /checkout without the added task?

    Might be a server issue.

    If possible, test on a fresh WP installation on the same server.

    In addition, you can try editing the login functionality, so users can login on a different page before acceding to the checkout.

    Thread Starter Derek Wilcox

    (@themassapothecary)

    @sebastopolys I have tried with several sites and spoken to a few developers. Everyone is saiyng the same thing. It is because the query string is there. No matter what you do the query string does what it does so if the customer logs in then when page refreshes the query string will work for a second time.

    Thread Starter Derek Wilcox

    (@themassapothecary)

    @sebastopolys there has to be some php we can add in that strips the query string after the checkout page loads for the first time.

    Please try reflush permalinks:

    Whenever a new Custom Post is added through a plugin or code; usually WordPress permalinks needs to be flushed.

    • Step 1: In the WordPress admin area, go to “Settings > Permalinks”
    • Step 2: Click “Save Changes”
    • Step 3: Permalinks and rewrite rules are flushed.
    Thread Starter Derek Wilcox

    (@themassapothecary)

    @sebastopolys I did what you said to flush the permalinks, no difference.

    Thread Starter Derek Wilcox

    (@themassapothecary)

    I need help please @sebastopolys . This is confirmed 100% a bug within the plugin and not from conflicting with another plugin or theme.

    Thread Starter Derek Wilcox

    (@themassapothecary)

    We even wrote a code snippet to take away the query string after the page loads but Direct Checkout has this hardcoded in somehow that it doesn’t matter. With the below snippet it you hit buy now button and go to checkout you can see the query string with add to cart disappear but still when you login it readds the product to the cart

    add_action( 'wfacp_internal_css', function () {
    	?>
    	<script>
            window.addEventListener('bwf_checkout_load', function () {
                window.history.pushState(null, null, window.location.origin + window.location.pathname);
                jQuery('.woocommerce-form-login [name="_wp_http_referer"]').val('')
            });
    	</script>
    	<?php
    } );
    Thread Starter Derek Wilcox

    (@themassapothecary)

    @sebastopolys. ???????

    This is very frustrating. I paid for the premium version and tp this day support never answered me back and you only answer once every other week it seems.

    This is 100% an issue with the Direct Checkout plugin. Please help me resolve this

    Thread Starter Derek Wilcox

    (@themassapothecary)

    @sebastopolys am I just being ignored at this point? Please help fix the issue with the plugin (which has already been confirmed it is not a conflict with other plugins or a theme) or how do I get a refund? Please keep in mind I don’t want a refund, but if I am just going to be ignored that is only other option.

    Sorry, as support agent there’s not much I can do for the moment.

    The dev team is already aware of this issue and will be fixed if possible.

    However, we think it’s a minor issue since it can be undone by the user on frontend easily.

    • This reply was modified 1 year, 8 months ago by sebastopolys.
    Thread Starter Derek Wilcox

    (@themassapothecary)

    @sebastopolys thank you for your response
    It’s far from a minor issue though (I understandwhy you would think it would be though). I’ve had customers accuse us of trying to “slip” in extra products to charge them for.

    Yes, I understand that.

    I’m sure it will be fixed on next updates. Please be patient.

    Thread Starter Derek Wilcox

    (@themassapothecary)

    @sebastopolys its been a few months now and I had to get a different plugin to have a buy now button working properly. Can I please have a refund?

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘After use buy now button & login it adds double to cart’ is closed to new replies.