[Skip to main content](#vessel-content)

#   onAfterCartUpdate does not get to trigger

##

- **[thesilentman](/forum/user/13495-thesilentman "View thesilentman's Profile")**
- [![thesilentman's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/13495-thesilentman "View thesilentman's Profile") Topic Author
- [ Offline](/forum/user/13495-thesilentman)

Less More

- Posts: 40
- Thank you received: 2
-
-

13 years 8 months ago -  13 years 8 months ago [\#93367](#93367) by [thesilentman](/forum/user/13495-thesilentman "View thesilentman's Profile")  *[onAfterCartUpdate does not get to trigger](/forum/3-bug-report/79039-onaftercartupdate-does-not-get-to-trigger#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 &quot;return true;&quot; way before you reach the trigger.  Best regards, Frank  &#91;EDIT&#93; couldn't attach the patchfile. Pasting it here instead:")* was created by *[thesilentman](/forum/user/13495-thesilentman "View thesilentman's Profile")*

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
> &lt;+&gt;UTF-8
> ===================================================================
> \--- administrator/components/com\_hikashop/classes/cart.php (revision )
> +++ administrator/components/com\_hikashop/classes/cart.php (revision )
> @@ -313,7 +313,6 @@
> $app-&gt;setUserState( HIKASHOP\_COMPONENT.'.shipping\_id',0);
> $app-&gt;setUserState( HIKASHOP\_COMPONENT.'.shipping\_data',0);
> }
> \- return $updated;
> }else{
> if($quantity){
> $new\_coupon=$product\_id;
> @@ -337,12 +336,12 @@
> $this-&gt;loadCart(0,true);
> $app-&gt;setUserState( HIKASHOP\_COMPONENT.'.coupon\_code',$new\_coupon);
> }
> \- return true;
> \+ $updated=true;
> }
> }
>
> $dispatcher-&gt;trigger( 'onAfterCartUpdate',array( &amp;$this, &amp;$cart, $product\_id, $quantity, $add, $type,$resetCartWhenUpdate,$force ));
> \- return false;
> \+ return $updated;
> }
>
> function updateEntry($quantity,&amp;$cartContent,$product\_id,$add,$resetCartWhenUpdate=true,$type='product',$force=false){

Last edit: 13 years 8 months ago by [thesilentman](/forum/user/13495-thesilentman "View thesilentman's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83OTAzOS1vbmFmdGVyY2FydHVwZGF0ZS1kb2VzLW5vdC1nZXQtdG8tdHJpZ2dlcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

13 years 8 months ago [\#93409](#93409) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[onAfterCartUpdate does not get to trigger](/forum/3-bug-report/79039-onaftercartupdate-does-not-get-to-trigger#93409 "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 &quot;return true;&quot; way before you reach the trigger.  Best regards, Frank  &#91;EDIT&#93; couldn't attach the patchfile. Pasting it here instead:")*

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.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83OTAzOS1vbmFmdGVyY2FydHVwZGF0ZS1kb2VzLW5vdC1nZXQtdG8tdHJpZ2dlcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.052 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
