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

#   Redirect after user registration in checkout fails with custom prices

##

- **[E. van Doorne](/forum/user/46105-e-van-doorne "View E. van Doorne's Profile")**
- [![E. van Doorne's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/46105-e-van-doorne "View E. van Doorne's Profile") Topic Author
- [ Offline](/forum/user/46105-e-van-doorne)

Less More

- Posts: 22
- Thank you received: 1
-

6 months 3 weeks ago [\#371505](#371505) by [E. van Doorne](/forum/user/46105-e-van-doorne "View E. van Doorne's Profile")  *[Redirect after user registration in checkout fails with custom prices](/forum/27-checkout/910448-redirect-after-user-registration-in-checkout-fails-with-custom-prices#371505 "-- HikaShop version -- : 6.1.0 -- Joomla version -- : 5.4.3 -- PHP version -- : 8.3.21 -- Browser(s) name and version -- : Firefox 149.0.2  What goes wrong: The checkout controller has a variable $checkout&#95;itemid, that’s not always defined but always required. This creates broken url’s like “/component/hikashop/checkout/show/cid-3?Itemid=”. This url reroutes back the start of checkout instead of step 3 of the checkout. Important note: Our site has different prices for different ACL levels → public ACL has different prices than registered.  Why this goes wrong: in components/com&#95;hikashop/controllers/checkout.php line 455 checks if $valid and checks if the current marker is equal to the new marker. In our case the marker ‘full&#95;price’ changes because our prices change based on ACL. This causes the →show function to be triggered. See attachment Hikashop marker logic error  In the show function are multiple lines that assume that $checkout&#95;itemid is defined, but that’s only the case if $task != ‘submitstep’. When dumping the $task variable it’s filled with the string ‘submitstep’. This none of the code from 141 to 208 to be called. This includes defining $checkout&#95;itemid. Lines 219 untill 237 all assume that $checkout&#95;itemid is defined, but in this case it’s not. At the end of the show function are 4 instances of $checkout&#95;itemid where it’s possible that $checkout&#95;itemid not defined  Sidenote: In the submitstep function on line 468, it does define the $checkout&#95;itemid variable, but that’s only after →show is already triggered because of the new marker value, and show already redirects.")* was created by *[E. van Doorne](/forum/user/46105-e-van-doorne "View E. van Doorne's Profile")*

-- HikaShop version -- : 6.1.0
-- Joomla version -- : 5.4.3
-- PHP version -- : 8.3.21
-- Browser(s) name and version -- : Firefox 149.0.2

**What goes wrong:**
The checkout controller has a variable $checkout_itemid, that’s not always defined but always required. This creates broken url’s like “/component/hikashop/checkout/show/cid-3?Itemid=”. This url reroutes back the start of checkout instead of step 3 of the checkout.
Important note: Our site has different prices for different ACL levels → public ACL has different prices than registered.

**Why this goes wrong:**
in components/com_hikashop/controllers/checkout.php line 455 checks if $valid and checks if the current marker is equal to the new marker. In our case the marker ‘full_price’ changes because our prices change based on ACL. This causes the →show function to be triggered. See attachment Hikashop marker logic error  [ ![HIkashop marker logic error.png](/forum/attachment/63084) ](/forum/attachment/63084 "...ogic error.png")

In the show function are multiple lines that assume that $checkout_itemid is defined, but that’s only the case if $task != ‘submitstep’. When dumping the $task variable it’s filled with the string ‘submitstep’. This none of the code from 141 to 208 to be called. This includes defining $checkout_itemid. Lines 219 untill 237 all assume that $checkout_itemid is defined, but in this case it’s not.
At the end of the show function are 4 instances of $checkout_itemid where it’s possible that $checkout_itemid not defined
[ ![checkout&#95;itemid name missing.png](/forum/attachment/63085) ](/forum/attachment/63085 "...me missing.png")

Sidenote:
In the submitstep function on line 468, it does define the $checkout_itemid variable, but that’s only after →show is already triggered because of the new marker value, and show already redirects.

- [ ![HIkashop marker logic error.png](/forum/attachment/63084) ](/forum/attachment/63084 "...ogic error.png") [ ](/forum/attachment/63084?download=1 "...ogic error.png")
- [ ![checkout&#95;itemid name missing.png](/forum/attachment/63085) ](/forum/attachment/63085 "...me missing.png") [ ](/forum/attachment/63085?download=1 "...me missing.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkxMDQ0OC1yZWRpcmVjdC1hZnRlci11c2VyLXJlZ2lzdHJhdGlvbi1pbi1jaGVja291dC1mYWlscy13aXRoLWN1c3RvbS1wcmljZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86324
- Thank you received: 14287
-
-

6 months 2 weeks ago [\#371513](#371513) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Redirect after user registration in checkout fails with custom prices](/forum/27-checkout/910448-redirect-after-user-registration-in-checkout-fails-with-custom-prices#371513 "-- HikaShop version -- : 6.1.0 -- Joomla version -- : 5.4.3 -- PHP version -- : 8.3.21 -- Browser(s) name and version -- : Firefox 149.0.2  What goes wrong: The checkout controller has a variable $checkout&#95;itemid, that’s not always defined but always required. This creates broken url’s like “/component/hikashop/checkout/show/cid-3?Itemid=”. This url reroutes back the start of checkout instead of step 3 of the checkout. Important note: Our site has different prices for different ACL levels → public ACL has different prices than registered.  Why this goes wrong: in components/com&#95;hikashop/controllers/checkout.php line 455 checks if $valid and checks if the current marker is equal to the new marker. In our case the marker ‘full&#95;price’ changes because our prices change based on ACL. This causes the →show function to be triggered. See attachment Hikashop marker logic error  In the show function are multiple lines that assume that $checkout&#95;itemid is defined, but that’s only the case if $task != ‘submitstep’. When dumping the $task variable it’s filled with the string ‘submitstep’. This none of the code from 141 to 208 to be called. This includes defining $checkout&#95;itemid. Lines 219 untill 237 all assume that $checkout&#95;itemid is defined, but in this case it’s not. At the end of the show function are 4 instances of $checkout&#95;itemid where it’s possible that $checkout&#95;itemid not defined  Sidenote: In the submitstep function on line 468, it does define the $checkout&#95;itemid variable, but that’s only after →show is already triggered because of the new marker value, and show already redirects.")*

Hi,

You are absolutely right and your analysis is spot on. Thank you for the detailed report with line numbers and screenshots, that made it really easy to confirm.

The issue is exactly as you described: when show() is called from submitstep() after a marker change (which is what happens when the prices change because the user just registered and now belongs to a different ACL with different prices), the check "if($task != 'submitstep')" skips the block where $checkout_itemid is initialized. But the variable is still used afterwards when building the redirect URLs, which results in the broken "?Itemid=" you observed.

I have applied a fix on our end and pushed it to the 6.4.0 release package. You can download the latest package from your member area on our website and install it over your existing installation to apply the fix. That should resolve the redirect loop on your custom-pricing setup.

The following user(s) said Thank You: [E. van Doorne](/forum/user/46105-e-van-doorne "View E. van Doorne's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkxMDQ0OC1yZWRpcmVjdC1hZnRlci11c2VyLXJlZ2lzdHJhdGlvbi1pbi1jaGVja291dC1mYWlscy13aXRoLWN1c3RvbS1wcmljZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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.066 seconds

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