Tagged: checkout page
-
AuthorPosts
-
June 3, 2021 at 11:38 pm #1303894
With help from you guys, I moved the coupon apply code down to the top of the Order section using this code:
ccs style:
#order_review > p.form-row.form-row-first, #order_review > p.form-row.form-row-last, .woocommerce-form-coupon-toggle + p {
display: none; }functions.php:
remove_action( ‘woocommerce_before_checkout_form’, ‘woocommerce_checkout_coupon_form’, 10 );
add_action( ‘woocommerce_checkout_order_review’, ‘woocommerce_checkout_coupon_form’, 5 );function ava_custom_script_mod() {
if ( wp_script_is( ‘avia-default’, ‘registered’ ) ) {
wp_add_inline_script( ‘avia-default’, ‘
(function($) {
$(“.showcoupon”).on(“click”, function() {
$(“#order_review > p.form-row.form-row-first, #order_review > p.form-row.form-row-last, .woocommerce-form-coupon-toggle + p”).toggle();
});
})(jQuery);
‘);
}
}
add_action( ‘wp_enqueue_scripts’, ‘ava_custom_script_mod’, 9999);However, now when I input a coupon code it drops down to the credit card section and gives me an error:
Also, Entering the coupon code on the cart page does work.
Can you please help me resolve this issue. Thanks in advance.- This topic was modified 3 years, 5 months ago by advteksol.
June 4, 2021 at 3:46 pm #1304080You can use coupon code:
June 8, 2021 at 4:50 am #1304516Hi,
Thank you for the inquiry.
We are able to properly checkout using Stripe’s default credit card number, which is use for testing. Please check the screenshot below.
Screenshot: https://imgur.com/3iKkaIB
Best regards,
IsmaelJune 8, 2021 at 3:15 pm #1304662The credit card processing works fine, it’s the coupon code that doesn’t allow the credit card option to work (or applies the discount)..
June 11, 2021 at 4:53 am #1305177Hi,
Thank you for the clarification.
We tried to check the issue again, applied the coupon code but we cannot use Stripe’s test card anymore because it is already in live mode. Do you have a staging site where we can still use the test cards?
Best regards,
IsmaelJune 16, 2021 at 1:35 am #1305902Ok, had to set up a staging site so I could make the live site work for now. Please check it out the issue at the address below.
Thanks.
June 17, 2021 at 6:52 am #1306123Hi,
Does the coupon or discount work correctly when you remove the previous script? Have you tried asking the plugin authors for additional help?
The coupon field should be hidden by default but for some reason it is showing immediately in your installation, so we suggested the previous script. The initial issue might be due to a particular plugin or a custom script.
Best regards,
IsmaelJune 17, 2021 at 3:41 pm #1306199The only plug-in associated with this I’m using is Woo Commerce. Removing the script does make it work, but the coupon code reverts to the top, not the Order section. You guys helped me with moving it and making it a clickable to expand, but it’s just not allowing the credit card entry now.
June 20, 2021 at 9:22 pm #1306590Hi,
Would you mind removing the previous script that we recommended previously? We would like to test it again without the script. Maybe we could come up with a solution without altering the order of the elements in the checkout container. And please post the login details in the private field.
Best regards,
IsmaelJune 21, 2021 at 3:17 pm #1306748OK, I’ve commented out the added code in the style.css sheet and functions.php file.
Thanks.
June 23, 2021 at 7:26 am #1307080Hi,
Looks like the coupon toggle is now working correctly even without the previous script that we recommended previously. Please try to remove the cache and visit the checkout page.
Thank you for your patience.
Best regards,
IsmaelJune 23, 2021 at 4:15 pm #1307181I had removed all the scripts, including the one to move it down. If you put back the one to move it down, the coupon toggle is open and when you enter a coupon it immediately tries to run the payment and does not apply any discounts.
June 25, 2021 at 7:17 am #1307404Hi,
Thank you for the info.
Why do you need to move it down again? The issue occurs because when you move the coupon container down or relocate it, the default script that is responsible for the coupon field toggle cannot find the appropriate element anymore. We recommend keeping it in its default place.
Best regards,
IsmaelJune 25, 2021 at 7:20 am #1307405Hey!
UPDATE: If you really need to move the coupon, try the solution provided here instead.
// https://www.cloudways.com/blog/move-woocommerce-coupon-field/
Cheers!
IsmaelJune 29, 2021 at 12:02 am #1307827Thanks, that works except there’s a close button that isn’t styled. Can you tell me how to style it or even remove it?
July 2, 2021 at 4:00 am #1308435Hi,
We cannot find the button when we checked the site, and the coupon container is still in its default place. Did you add the code from the article?
Best regards,
IsmaelJuly 2, 2021 at 7:47 pm #1308539Definitely added the code and moved it down (as seen in the picture). Maybe you need to clear the browser cache. Make sure you are using the developmental website below.
July 5, 2021 at 8:59 am #1308724Hi,
Thank you for the info.
Try to use this css code to remove the button and the space above the coupon field.
#coupon-anchor .ui-dialog-titlebar-close, #coupon-anchor #ui-id-2 { display: none; }
Best regards,
IsmaelJuly 7, 2021 at 1:11 am #1308995Close, but that also removes the Apply Coupon button after the code section…
July 8, 2021 at 9:12 am #1309214Hi,
Sorry about that. We adjusted the code a bit. Please try it again.
Best regards,
IsmaelJuly 8, 2021 at 5:44 pm #1309284Thank you – that seems to work as needed.
July 10, 2021 at 1:18 am #1309453Hi,
If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Fix Coupon Code Not Accepted’ is closed to new replies.