- Posts: 40
- Thank you received: 2
onAfterCartUpdate does not get to trigger
- thesilentman
-
Topic Author
- Offline
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){
Please Log in or Create an account to join the conversation.
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.
Please Log in or Create an account to join the conversation.