i whant to die in cart.php

  • Posts: 3
  • Thank you received: 0
12 years 5 months ago #29189

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.

  • Posts: 81563
  • Thank you received: 13071
  • MODERATOR
12 years 5 months ago #29193

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.

  • Posts: 3
  • Thank you received: 0
12 years 5 months ago #29198

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: 12 years 5 months ago by themhz.

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

  • Posts: 81563
  • Thank you received: 13071
  • MODERATOR
12 years 5 months ago #29199

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.

  • Posts: 3
  • Thank you received: 0
12 years 5 months ago #29233

thanx! now i can debug :silly:

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

Time to create page: 0.064 seconds
Powered by Kunena Forum