Skip to main content

i whant to die in cart.php

15 years 14 hours ago #29189 by themhz
hi, I am trying to make the script die(); in cart.php (administrator\components\com_hikashop\classes\cart.php)
but when the code die(); is executed the script redirects at another internal page without dieing.
"I know they say that I shouldn't use die(); But i do and will :) so dont tell me not to."
In other places of the code die() is working fine, why not in the cart.php? its like something is resuming the code and skipping die if occurred. :(

Please Log in or Create an account to join the conversation.

15 years 13 hours ago #29193 by nicolas
Hi,

die(); should work there. At least it works on our end.
Are you sure that you're putting it correctly ? (ie not breaking the code).

Please Log in or Create an account to join the conversation.

15 years 11 hours ago - 15 years 11 hours ago #29198 by themhz
hmmm nope I am sure I am putting it correctly. I am using die(); at function updateEntry.
for example
function updateEntry($quantity,&$cartContent,$product_id,$add,$resetCartWhenUpdate=true,$type='product',$force=false){
echo "ok";
die();
.
.
.

but it seems that when die occurs it redirects me to option=com_hikashop&ctrl=product&task=listing&Itemid=87
hint could be that if i put some code that produces an error for example

function updateEntry($quantity,&$cartContent,$product_id,$add,$resetCartWhenUpdate=true,$type='product',$force=false){

dfsasadsadas
.
.
.

the "dfsasadsadas" will be the error, it will not redirect me but crash. So there is no Try catch at the top of the hierarchy. Weird.. any hints? its like breaking and returning when the die happens.
Last edit: 15 years 11 hours ago by themhz.

Please Log in or Create an account to join the conversation.

15 years 11 hours ago #29199 by nicolas
Try to turn off the option "Use AJAX when possible for add to cart buttons" in the configuration. That will avoid that the page is redirected after the add to cart die.

Please Log in or Create an account to join the conversation.

15 years 1 hour ago #29233 by themhz
thanx! now i can debug :silly:

Please Log in or Create an account to join the conversation.

Time to create page: 0.052 seconds
Powered by Kunena Forum