Skip to main content

i whant to die in cart.php

More
14 years 10 months 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.

More
14 years 10 months 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.

More
14 years 10 months ago - 14 years 10 months 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: 14 years 10 months ago by themhz.

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

More
14 years 10 months 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.

More
14 years 10 months 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.203 seconds
Powered by Kunena Forum