Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Tom

    (@jeffreeeeey)

    I should note that I’ve tried:

    add_action( 'woocommerce_review_order_before_payment', 'woocommerce_checkout_coupon_form', 10 );

    It kinda’ works.
    It adds the Coupon form where I want it to be, but it also includes the blue “notice” box above it, along with the text “Have a coupon? Click here to enter your code”. The notice/form is OPEN by default, so I suppose I could just hide the .woocommerce-info notice using CSS, but this seems a little “hacky”.

    Open to opinions on this

    Jesse Pearson (a11n)

    (@jessepearson)

    Automattic Happiness Engineer

    Hey there!

    You could always create your own template from /woocommerce/templates/checkout/form-coupon.php and remove lines 26-29, which is the part that outputs the notice. This would be cleaner and less hacky.

    This should work with your code:

    remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );
    add_action( 'woocommerce_review_order_before_payment', 'woocommerce_checkout_coupon_form', 10 );

    Templates and overrides are covered here:
    https://docs.woothemes.com/document/template-structure/

    Thread Starter Tom

    (@jeffreeeeey)

    Thanks Jesse, yeah it’s looking like I’ll need to create a custom template to handle this because nothing else seems to work as expected.

    The action you mentioned above does display the coupon form (though complete with the notice part) to the desired location… however if the customer has filled in their name/address etc – once they enter their coupon code and click apply, they are instantly directed to PayPal.

    In other words the form doesn’t work as it should (apply code then leave them on the page so that they can select their shipping method and payment option)

    Jesse Pearson (a11n)

    (@jessepearson)

    Automattic Happiness Engineer

    Ah, that’s my error for not noticing that. The form for payment begins at the first Billing Address field and ends after the payment information, so you are basically placing a form within a form… which is most likely why the coupon form appears above the address fields.

    The only other idea that I have would be to place a notice and link below the address fields, and when the link is clicked it opens the div/form above the address fields and also scrolls up to it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Improving the Login and Coupon notices/forms on the checkout page’ is closed to new replies.