Repository Forums Support WooCommerce Extended Coupon Features PRO Need page refresh to see "Select free product"

Topic Resolution: Resolved
Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #497
    plc_ratm
    Participant

    Hello,

    We use WooCommerce Extended Coupon Features PRO to display a range of products after typing in a coupon. All is working fine but to see ‘Select free products’ I need to manually reload the checkout page..

    Any idea what might be the cause of it? I tried deactivating plugins, no luck..

    Any help is much appreciated!
    Jan

    #498
    Soft79
    Keymaster

    Please send me url and instructions on how to reproduce.

    #503
    plc_ratm
    Participant

    The site is not public yet, use these temporary login details:

    *** PRIVATE DETAILS HIDDEN ***

    1. After logging in, go to the checkout (*** PRIVATE DETAILS HIDDEN ***) and enter the coupon.
    2. Message will pop up confirming validity of the coupon.
    3. Refresh the whole page and now you will see the whole “wjecf-select-free-products”
    4. It is the same way backwards – i.e. remove coupon and you still see free products too choose from. Refreshing the page will fix that..

    Thanks,
    Jan

    #506
    plc_ratm
    Participant

    BTW, should you need admin access, let me know – I will update the testing account.

    Jan

    #507
    Soft79
    Keymaster

    Not needed. It’s an issue with WC Ajax. Will build a fix but can take a week or so.
    Is disabling ajax an option for now?

    #508
    plc_ratm
    Participant

    Thanks for the update. Could I disable ajax selectively, only for coupons?
    I would need pointers since I am able find my way around code – but only just ;]

    I need ajax for the rest of the checkout (mainly shipping options) so a way of forcing a page refresh just for coupons would be acceptable.

    Thanks,
    Jan

    #509
    Soft79
    Keymaster

    Find the following line in woocommerce/assets/js/frontend/checkout.min.js:

    $( 'form.checkout_coupon' ).hide().submit( this.submit );

    The .submit( this.submit ) part enables AJAX for the apply coupon form. So you could remove that part (WARNING: core change!!!) or find some other workaround for it.

    #510
    plc_ratm
    Participant

    Good evening and thanks for the suggestion – I tried deleting the part of the code but unfortunately that breaks all AJAX actions on that page..

    I will probably have to hold out for the mentioned fix. Do you think that it could be ready next Friday?

    Thank you for your swift reactions and have a nice weekend!
    Jan

    #511
    Soft79
    Keymaster

    Bummer. No errors in javascript console?

    Dont know if I can fix it before friday

    #512
    plc_ratm
    Participant

    Hello, so I gave the workaround another try and having deleted the part of the code plus the “.hide()” preceding it [.hide().submit(this.submit)] entering the coupon now works with a page refresh.

    Nonetheless removing the coupon does not work – not even after manually refreshing the page.
    This might (have to) be acceptable for a few days but removing coupon should be possible. Do you have any estimates for the finalisation of the regular fix?

    Thanks!
    Jan

    #513
    Soft79
    Keymaster

    I sent you a (preliminary) fix by email, maybe it’s in the spam folder because of the ZIP attachment? Otherwise, please send me an email address (using the contact form) to which I can send the file.

    #514
    plc_ratm
    Participant

    That’s great news – will definitely try the fix. I’ve just sent you the email address through the contact form.

    Jan

    #515
    Soft79
    Keymaster

    Sent, have you received it this time?

    #517
    plc_ratm
    Participant

    Yup, thanks, arrived this time. I will deactivate & delete the plugin, install the new one, revert checkout.min.js to its original form and test the coupon behaviour.

    Will let you know how it went!
    Jan

    #518
    plc_ratm
    Participant

    Hello, I tried the preliminary update and it did not work. Reverting to the previous version proved quite the headeache..

    Since nothing worked on the checkout page I decided to move the entire coupon submitting part to the Cart page. Not an ideal solution but at least adding [and removing(!)] coupons works here.

    There is one glitch/misbehaviour in Cart as well, though:
    1. When you select one of the free gifts you have to click on “Update cart” only then is the Free gift really selected..
    2. If you just select the free gift and go to Checkout, submitting your order in Checkout will show an error “You have to choose your Free gift”..

    So, the solution would be: Clicking on a free gift in Cart refreshes the Cart page and adds the gift to your Order.

    Is that behaviour possible to invoke?

    Cheers,
    Jan

Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.