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

#   onAfterCartProductsLoaded

##

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

Less More

- Posts: 23
- Thank you received: 2
-
-

2 years 4 months ago -  2 years 4 months ago [\#361688](#361688) by [ShepherdsStream](/forum/user/82405-shepherdsstream "View ShepherdsStream's Profile")  *[onAfterCartProductsLoaded](/forum/27-checkout/908308-onaftercartproductsloaded#361688 "-- HikaShop version -- : 5.1.0 -- Joomla version -- : 4.4.5 -- PHP version -- : 8.1 -- Browser(s) name and version -- : Microsoft Edge Version 126.0.2592.68 (Official build) (64-bit) -- Error-message(debug-mod must be tuned on) -- : no error message  We have built a plugin that will calculate the tax. We refuse to use Avalara or TaxCloud. The plugin is working only it is not including the shipping cost. Here is the request from my dev. Tax calculate: I could not find an event that I need. As your request, the Sales Tax will be calculated with a formula:  Subtotal + Shipping Fee = Total  Total &#42; CombinedRate (%) = Sales Tax  In the plugin, if I hook on an event onAfterCartProductsLoaded  onAfterCartProductsLoad(&amp;$cart) I can update cart price with tax, but in this event, the $cart params does not include shipping price, so the Tax can be only calculated based on subtotal (without shipping fee).  I tried to hook on other events that are: onAfterCartShippingLoad or onAfterFullCartLoad I checked in the source code of Hikashop, these events will be called after the event onAfterCartProductsLoaded, and the shipping information added to the $cart params in these events. So, for these events, it can get Sub total + Shipping fee, and I can calculate tax correctly and update new price with tax to the $cart (include tax of shipping fee). But on the cart form (checkout page), it will display price without tax (although $cart is updated correctly).  So I reverted to using the event onAfterCartProductsLoaded.  I would like to include the shipping in the sales tax calculation.  Please advise. Thank you.")* was created by *[ShepherdsStream](/forum/user/82405-shepherdsstream "View ShepherdsStream's Profile")*

-- HikaShop version -- : 5.1.0
-- Joomla version -- : 4.4.5
-- PHP version -- : 8.1
-- Browser(s) name and version -- : Microsoft Edge Version 126.0.2592.68 (Official build) (64-bit)
-- Error-message(debug-mod must be tuned on) -- : no error message

We have built a plugin that will calculate the tax. We refuse to use Avalara or TaxCloud. The plugin is working only it is not including the shipping cost. Here is the request from my dev. Tax calculate: I could not find an event that I need. As your request, the Sales Tax will be calculated with a formula:

Subtotal + Shipping Fee = Total

Total * CombinedRate (%) = Sales Tax

In the plugin, if I hook on an event onAfterCartProductsLoaded

onAfterCartProductsLoad(&amp;$cart)
I can update cart price with tax, but in this event, the $cart params does not include shipping price, so the Tax can be only calculated based on subtotal (without shipping fee).

I tried to hook on other events that are: onAfterCartShippingLoad or onAfterFullCartLoad
I checked in the source code of Hikashop, these events will be called after the event onAfterCartProductsLoaded, and the shipping information added to the $cart params in these events.
So, for these events, it can get Sub total + Shipping fee, and I can calculate tax correctly and update new price with tax to the $cart (include tax of shipping fee).
But on the cart form (checkout page), it will display price without tax (although $cart is updated correctly).

So I reverted to using the event onAfterCartProductsLoaded.

I would like to include the shipping in the sales tax calculation.

Please advise. Thank you.

Last edit: 2 years 4 months ago by [ShepherdsStream](/forum/user/82405-shepherdsstream "View ShepherdsStream's Profile"). Reason: needed to explain better.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwODMwOC1vbmFmdGVyY2FydHByb2R1Y3RzbG9hZGVkP3RtcGw9bWFya2Rvd24=) 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: 86582
- Thank you received: 14322
-
-

2 years 4 months ago [\#361689](#361689) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[onAfterCartProductsLoaded](/forum/27-checkout/908308-onaftercartproductsloaded#361689 "-- HikaShop version -- : 5.1.0 -- Joomla version -- : 4.4.5 -- PHP version -- : 8.1 -- Browser(s) name and version -- : Microsoft Edge Version 126.0.2592.68 (Official build) (64-bit) -- Error-message(debug-mod must be tuned on) -- : no error message  We have built a plugin that will calculate the tax. We refuse to use Avalara or TaxCloud. The plugin is working only it is not including the shipping cost. Here is the request from my dev. Tax calculate: I could not find an event that I need. As your request, the Sales Tax will be calculated with a formula:  Subtotal + Shipping Fee = Total  Total &#42; CombinedRate (%) = Sales Tax  In the plugin, if I hook on an event onAfterCartProductsLoaded  onAfterCartProductsLoad(&amp;$cart) I can update cart price with tax, but in this event, the $cart params does not include shipping price, so the Tax can be only calculated based on subtotal (without shipping fee).  I tried to hook on other events that are: onAfterCartShippingLoad or onAfterFullCartLoad I checked in the source code of Hikashop, these events will be called after the event onAfterCartProductsLoaded, and the shipping information added to the $cart params in these events. So, for these events, it can get Sub total + Shipping fee, and I can calculate tax correctly and update new price with tax to the $cart (include tax of shipping fee). But on the cart form (checkout page), it will display price without tax (although $cart is updated correctly).  So I reverted to using the event onAfterCartProductsLoaded.  I would like to include the shipping in the sales tax calculation.  Please advise. Thank you.")*

Hi,

You sure can use onAfterFullCartLoad to calculate the taxes.
Make sure that you update $cart-&gt;full_total with the tax information and the price_value_with_tax

The following user(s) said Thank You: [ShepherdsStream](/forum/user/82405-shepherdsstream "View ShepherdsStream's Profile")

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

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

Less More

- Posts: 23
- Thank you received: 2
-
-

2 years 4 months ago [\#361714](#361714) by [ShepherdsStream](/forum/user/82405-shepherdsstream "View ShepherdsStream's Profile")  Replied by *[ShepherdsStream](/forum/user/82405-shepherdsstream "View ShepherdsStream's Profile")* on topic *[onAfterCartProductsLoaded](/forum/27-checkout/908308-onaftercartproductsloaded#361714 "-- HikaShop version -- : 5.1.0 -- Joomla version -- : 4.4.5 -- PHP version -- : 8.1 -- Browser(s) name and version -- : Microsoft Edge Version 126.0.2592.68 (Official build) (64-bit) -- Error-message(debug-mod must be tuned on) -- : no error message  We have built a plugin that will calculate the tax. We refuse to use Avalara or TaxCloud. The plugin is working only it is not including the shipping cost. Here is the request from my dev. Tax calculate: I could not find an event that I need. As your request, the Sales Tax will be calculated with a formula:  Subtotal + Shipping Fee = Total  Total &#42; CombinedRate (%) = Sales Tax  In the plugin, if I hook on an event onAfterCartProductsLoaded  onAfterCartProductsLoad(&amp;$cart) I can update cart price with tax, but in this event, the $cart params does not include shipping price, so the Tax can be only calculated based on subtotal (without shipping fee).  I tried to hook on other events that are: onAfterCartShippingLoad or onAfterFullCartLoad I checked in the source code of Hikashop, these events will be called after the event onAfterCartProductsLoaded, and the shipping information added to the $cart params in these events. So, for these events, it can get Sub total + Shipping fee, and I can calculate tax correctly and update new price with tax to the $cart (include tax of shipping fee). But on the cart form (checkout page), it will display price without tax (although $cart is updated correctly).  So I reverted to using the event onAfterCartProductsLoaded.  I would like to include the shipping in the sales tax calculation.  Please advise. Thank you.")*

that worked great

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwODMwOC1vbmFmdGVyY2FydHByb2R1Y3RzbG9hZGVkP3RtcGw9bWFya2Rvd24=) 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)
