-- 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
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
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.