onAfterCartUpdate does not get to trigger

  • Posts: 40
  • Thank you received: 2
11 years 8 months ago #93367

This is on 2.1.0 Business Edition

I have attached a patchfile, that reflects the patch I have done locally. It works, but I haven't checked if it breaks anything else. Though it shouldn't do any harm.

The problem lies in that you exit the function with "return true;" way before you reach the trigger.

Best regards,
Frank

[EDIT] couldn't attach the patchfile. Pasting it here instead:

Index: administrator/components/com_hikashop/classes/cart.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- administrator/components/com_hikashop/classes/cart.php (revision )
+++ administrator/components/com_hikashop/classes/cart.php (revision )
@@ -313,7 +313,6 @@
$app->setUserState( HIKASHOP_COMPONENT.'.shipping_id',0);
$app->setUserState( HIKASHOP_COMPONENT.'.shipping_data',0);
}
- return $updated;
}else{
if($quantity){
$new_coupon=$product_id;
@@ -337,12 +336,12 @@
$this->loadCart(0,true);
$app->setUserState( HIKASHOP_COMPONENT.'.coupon_code',$new_coupon);
}
- return true;
+ $updated=true;
}
}

$dispatcher->trigger( 'onAfterCartUpdate',array( &$this, &$cart, $product_id, $quantity, $add, $type,$resetCartWhenUpdate,$force ));
- return false;
+ return $updated;
}

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

Last edit: 11 years 8 months ago by thesilentman.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 8 months ago #93409

Hi,

Yes, that has already been fixed on our end actually and will be in next version of HikaShop
Here is the latest version of the cart.php file we have on our svn.

Attachments:

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

Time to create page: 0.056 seconds
Powered by Kunena Forum