Fix redirection after submit discount code - woocommerce

I am using "Display a WooCommerce coupon input field anywhere with a shortcode" answer code to add a coupon form on my homepage (via a shortcode).
It works but I've got a problem with the redirection after input the value.
The code runs on this path: www.nameofthesite.com/folder/but the redirection is on www.nameofthesite.com instead of www.nameofthesite.com/folder/ after validation…
Any help Is welcome.

Related

WooCommerce - a single product url without permalink

I recently discovered that a single product in my WooCommerce shows up in search results without its permalink. I cannot find this product anywhere, and therefore I cannot fix the permalink issue.
The link should read as: /nb/butikk/adheseal-2/
But it reads as: /nb/?product_variation=adheseal-2
Which of course just reroutes to the main page. I cannot find this entry in the system so I have noway of fixing the issue. It's a single post problem because every other item works as expected. Not just this particular link. Seeing as clicking the link doesn't work, I cannot find the post ID either.
I have tried to clean up the DB, resetting permalinks etc. but to no awail.
Any ideas?
It was a cache issue that prevented the permalink update.

Woocommerce show me that coupon is not exist, but its in database?

I noticed one strange issue that dont can resolve myself. I have created coupon "welcome10" that i inserted into coupon area in Woocommerce dashboard.. But for some reason, when try to insert coupon in checkout page, write me that coupon is is not exist.
I contacted woocommerce, but they tell me too basic informations in style:
check if coupon exist in DB.
Check if coupon have valid expiring date.
check if have particular product settings
but from that i cant debug nothing. Allready tryed all possible debug things like:
changing the theme, disabling all plugins (except woo) etc, and problem is still there.
Current coupon settings:
But still same error occured. Any tips how to fix this? Link to site where problem is showing.

Problems Customising WooCommerce Checkout Page

I'm having major problems customising the checkout page on a WooCommerce site for a client.
They have asked me to move a heap of fields around and, for the most part, I've got it done but the login form is causing me no end of grief.
They have asked that I create something similar to the checkout at www.adairs.com.au and would like the login form to be part of the "Billing Fields" section, and only displayed when a customer clicks the "Existing Member" tab.
I've got everything moved around but when clicking on the "Existing Member" tab to display the login form, and then logging in I get errors saying "Billing First Name", "Billing Last Name" and "Billing Address" are required.
Digging into it, it seems that when I call do_action( 'woocommerce_before_checkout_form', $checkout ) it is creating all the necessary form fields but it is not wrapping it in a form, so there is no data being posted.
I've tried moving the hook around to different parts of both the form-checkout.php and the form-billing.php files but get the same result.
When I call the same hook in the payment.php file, or leave it as it was originally coded the form is created as it should be, but is not rendered to the section of the checkout I am hoping for.
I can't for the life of me figure out why the form is created some times when I call the hook and not others.
I hope this makes sense. Any help would be greatly appreciated.
Thanks in advance,
Don
Sounds like all the "moving around" is breaking the logic. I would look into WooCommerce plugins that allow you to customize the checkout. There are lots of them
Another possibility... if you want the login form "only displayed when a customer clicks the Existing Member tab" why not leave the form where it is -- code wise -- and use JS/JQ to show/hide the actual form inputs. Look at this woo demo theme and click "Returning customer? Click here to login" for one idea.

I don't know why Wordpress worked follow that way

I have a problem with a Wordpress permalink.
These are my steps to show the problem:
1) in admin > pages: I create new page call "GoodMorning" and I have slug "goodmorning", on frontend, I run ://my_domain/goodmorning will show the content of this page
2) Now, I run ://my_domain/find-me/goodmorning it will auto redirect to ://my_domain/goodmorning
/find-me/ : this is any name and this text does not exist on wordpress slug, category, page, post, ....
Please let me know why. I want it to show a 404 page when I run ://my_domain/find-me/goodmorning.
Thanks All.
Adding this (to functions.php) should stop that redirect.
remove_action('template_redirect', 'redirect_canonical');
If you look at the documentation for redirect_canonical here:
Will also attempt to find the correct link when a user enters a URL that does not exist based on exact WordPress query. Will instead try to parse the URL or query in an attempt to figure the correct page to go to.
I assume that's what you're trying to prevent based on your question.
If you need the other functionality of redirect_canonical you can just cancel the redirect by returning false to this filter, like so:
add_filter('redirect_canonical', '__return_false');
You need to flush your permalinks configuration afterwards:
In the main menu find "Settings > Permalinks".
Scroll down if needed and click "Save Changes".
Rewrite rules and permalinks are flushed.

Gravity form wordpress

I am using gravity form in wordpress with ajax.
It is working fine when all field are correct.
When I submit form it show a ajax spinner and show success message.
But when there is some error in any field, it show validation errors after spin.
But after it does nothing. Even if we correct all the fields it is not working.
PLease help

Resources