[Skip to main content](#vessel-content)

#   if coupon invalid then wrong redirection

##

- **[olivnewton](/forum/user/9482-olivnewton "View olivnewton's Profile")**
- [![olivnewton's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9482-olivnewton "View olivnewton's Profile") Topic Author
- [ Offline](/forum/user/9482-olivnewton)

Less More

- Posts: 154
- Thank you received: 4
-
-

12 years 4 months ago -  12 years 4 months ago [\#164246](#164246) by [olivnewton](/forum/user/9482-olivnewton "View olivnewton's Profile")  *[if coupon invalid then wrong redirection](/forum/27-checkout/869731-if-coupon-invalid-then-wrong-redirection#164246 "-- url of the page with the problem -- : same as last posts (test server) -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.0  dear team, i encountered the following strange behavior with &quot;coupons&quot;: - i am at &quot;/checkout&quot; or &quot;/checkout/step-0&quot; or &quot;/checkout/task-step/step-0&quot; (= which are basically all the same) and entering a wrong coupon code - the page redirects to &quot;/checkout/task-step/step-1&quot; and the error message appears  this is strange because i am in page &quot;/checkout/step-0&quot; and wrong coupons redirect to &quot;step-1&quot;... ...but contents here after redirection are same as &quot;step-0&quot; ??? &quot;step-1&quot; is &quot;login + address&quot;...  is this a bug or intended to be so?  this behavior breaks my javascript because what i do is changing the TITLE at &quot;/checkout&quot; or &quot;/checkout/step-0&quot; or &quot;/checkout/task-step/step-0&quot; to something different, but after a wrong coupon code, the title cannot be changed because the url is wrongly not step-0 anymore...")* was created by *[olivnewton](/forum/user/9482-olivnewton "View olivnewton's Profile")*

-- url of the page with the problem -- : same as last posts (test server)
-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.0

dear team, i encountered the following strange behavior with "coupons":
- i am at "/checkout" or "/checkout/step-0" or "/checkout/task-step/step-0" (= which are basically all the same) and entering a wrong coupon code
- the page redirects to "/checkout/task-step/step-1" and the error message appears

this is strange because i am in page "/checkout/step-0" and wrong coupons redirect to "step-1"...
...but contents here after redirection are same as "step-0" ???
"step-1" is "login + address"...

is this a bug or intended to be so?

this behavior breaks my javascript because what i do is changing the TITLE at "/checkout" or "/checkout/step-0" or "/checkout/task-step/step-0" to something different, but after a wrong coupon code, the title cannot be changed because the url is wrongly not step-0 anymore...

Last edit: 12 years 4 months ago by [olivnewton](/forum/user/9482-olivnewton "View olivnewton's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2OTczMS1pZi1jb3Vwb24taW52YWxpZC10aGVuLXdyb25nLXJlZGlyZWN0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

12 years 4 months ago [\#164317](#164317) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[if coupon invalid then wrong redirection](/forum/27-checkout/869731-if-coupon-invalid-then-wrong-redirection#164317 "-- url of the page with the problem -- : same as last posts (test server) -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.0  dear team, i encountered the following strange behavior with &quot;coupons&quot;: - i am at &quot;/checkout&quot; or &quot;/checkout/step-0&quot; or &quot;/checkout/task-step/step-0&quot; (= which are basically all the same) and entering a wrong coupon code - the page redirects to &quot;/checkout/task-step/step-1&quot; and the error message appears  this is strange because i am in page &quot;/checkout/step-0&quot; and wrong coupons redirect to &quot;step-1&quot;... ...but contents here after redirection are same as &quot;step-0&quot; ??? &quot;step-1&quot; is &quot;login + address&quot;...  is this a bug or intended to be so?  this behavior breaks my javascript because what i do is changing the TITLE at &quot;/checkout&quot; or &quot;/checkout/step-0&quot; or &quot;/checkout/task-step/step-0&quot; to something different, but after a wrong coupon code, the title cannot be changed because the url is wrongly not step-0 anymore...")*

Hi,

It's a normal situation.
There is no redirection, you just submit the form for the step 1 but because the form is not accepted, you're staying on the step 0.
But yes, the url saying that you're in the step 1.

You can have the same situation if you don't validate an element in a step (shipping, payment, terms, etc).

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2OTczMS1pZi1jb3Vwb24taW52YWxpZC10aGVuLXdyb25nLXJlZGlyZWN0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[olivnewton](/forum/user/9482-olivnewton "View olivnewton's Profile")**
- [![olivnewton's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9482-olivnewton "View olivnewton's Profile") Topic Author
- [ Offline](/forum/user/9482-olivnewton)

Less More

- Posts: 154
- Thank you received: 4
-
-

12 years 4 months ago [\#164346](#164346) by [olivnewton](/forum/user/9482-olivnewton "View olivnewton's Profile")  Replied by *[olivnewton](/forum/user/9482-olivnewton "View olivnewton's Profile")* on topic *[if coupon invalid then wrong redirection](/forum/27-checkout/869731-if-coupon-invalid-then-wrong-redirection#164346 "-- url of the page with the problem -- : same as last posts (test server) -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.0  dear team, i encountered the following strange behavior with &quot;coupons&quot;: - i am at &quot;/checkout&quot; or &quot;/checkout/step-0&quot; or &quot;/checkout/task-step/step-0&quot; (= which are basically all the same) and entering a wrong coupon code - the page redirects to &quot;/checkout/task-step/step-1&quot; and the error message appears  this is strange because i am in page &quot;/checkout/step-0&quot; and wrong coupons redirect to &quot;step-1&quot;... ...but contents here after redirection are same as &quot;step-0&quot; ??? &quot;step-1&quot; is &quot;login + address&quot;...  is this a bug or intended to be so?  this behavior breaks my javascript because what i do is changing the TITLE at &quot;/checkout&quot; or &quot;/checkout/step-0&quot; or &quot;/checkout/task-step/step-0&quot; to something different, but after a wrong coupon code, the title cannot be changed because the url is wrongly not step-0 anymore...")*

i see... it would be right though to still show step-0 ...
so i have to think of another way to find out with javascript on which step the process is...

any idea?

i might try to read the class in div id="hikashop_chekout_page".
as i can see there is the correct step added, even if i use an invalid coupon code...
class="hikashop_checkout_page hikashop_checkout_page_step0"

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2OTczMS1pZi1jb3Vwb24taW52YWxpZC10aGVuLXdyb25nLXJlZGlyZWN0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 4 months ago [\#164347](#164347) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[if coupon invalid then wrong redirection](/forum/27-checkout/869731-if-coupon-invalid-then-wrong-redirection#164347 "-- url of the page with the problem -- : same as last posts (test server) -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.0  dear team, i encountered the following strange behavior with &quot;coupons&quot;: - i am at &quot;/checkout&quot; or &quot;/checkout/step-0&quot; or &quot;/checkout/task-step/step-0&quot; (= which are basically all the same) and entering a wrong coupon code - the page redirects to &quot;/checkout/task-step/step-1&quot; and the error message appears  this is strange because i am in page &quot;/checkout/step-0&quot; and wrong coupons redirect to &quot;step-1&quot;... ...but contents here after redirection are same as &quot;step-0&quot; ??? &quot;step-1&quot; is &quot;login + address&quot;...  is this a bug or intended to be so?  this behavior breaks my javascript because what i do is changing the TITLE at &quot;/checkout&quot; or &quot;/checkout/step-0&quot; or &quot;/checkout/task-step/step-0&quot; to something different, but after a wrong coupon code, the title cannot be changed because the url is wrongly not step-0 anymore...")*

Hi,

Yes using the class name seems to be a good option.
You can parse the page and use the javascript match function in order to see if the correct class is present.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2OTczMS1pZi1jb3Vwb24taW52YWxpZC10aGVuLXdyb25nLXJlZGlyZWN0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.061 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
