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

#   Show sub total after shipping before VAT

##

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

Less More

- Posts: 52
- Thank you received: 2
-
-

12 years 9 months ago [\#141961](#141961) by [wynchcote](/forum/user/7009-wynchcote "View wynchcote's Profile")  *[Show sub total after shipping before VAT](/forum/27-checkout/865486-show-sub-total-after-shipping-before-vat#141961 "-- url of the page with the problem -- : test site -- HikaShop version -- : 2.2.3 -- Joomla version -- : 2.5.17 -- PHP version -- : 5.3 -- Browser(s) name and version -- : n/a -- Error-message(debug-mod must be tuned on) -- : n//a  I have configured the HikaShop Starter to show prices ex VAT and to include VAT with shipping options.  Presentation in checkout is nice:  Total Shipping VAT Total  and the VAT is shown in brackets next to the shipping method below the total.  However, I still think some people may be confused about how the VAT is calculated i.e. as % of product and shipping.  For this reason, would like to include a sub-total.  Example:  Sub-total Shipping Sub-total VAT Total  Thanks,  Ken :)")* was created by *[wynchcote](/forum/user/7009-wynchcote "View wynchcote's Profile")*

-- url of the page with the problem -- : test site
-- HikaShop version -- : 2.2.3
-- Joomla version -- : 2.5.17
-- PHP version -- : 5.3
-- Browser(s) name and version -- : n/a
-- Error-message(debug-mod must be tuned on) -- : n//a

I have configured the HikaShop Starter to show prices ex VAT and to include VAT with shipping options.

Presentation in checkout is nice:

Total
Shipping
VAT
Total

and the VAT is shown in brackets next to the shipping method below the total.

However, I still think some people may be confused about how the VAT is calculated i.e. as % of product and shipping.

For this reason, would like to include a sub-total.

Example:

Sub-total
Shipping
Sub-total
VAT
Total

Thanks,

Ken ![:)](/media/kunena/emoticons/3.png ":)")

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

12 years 9 months ago [\#142072](#142072) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Show sub total after shipping before VAT](/forum/27-checkout/865486-show-sub-total-after-shipping-before-vat#142072 "-- url of the page with the problem -- : test site -- HikaShop version -- : 2.2.3 -- Joomla version -- : 2.5.17 -- PHP version -- : 5.3 -- Browser(s) name and version -- : n/a -- Error-message(debug-mod must be tuned on) -- : n//a  I have configured the HikaShop Starter to show prices ex VAT and to include VAT with shipping options.  Presentation in checkout is nice:  Total Shipping VAT Total  and the VAT is shown in brackets next to the shipping method below the total.  However, I still think some people may be confused about how the VAT is calculated i.e. as % of product and shipping.  For this reason, would like to include a sub-total.  Example:  Sub-total Shipping Sub-total VAT Total  Thanks,  Ken :)")*

Hi,
The solution will probably be to edit the "Cart" file of the "checkout" view of your front-end template through the page "*Hikashop-&gt;Display-&gt;Views*".

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

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

Less More

- Posts: 52
- Thank you received: 2
-
-

12 years 9 months ago [\#142671](#142671) by [wynchcote](/forum/user/7009-wynchcote "View wynchcote's Profile")  Replied by *[wynchcote](/forum/user/7009-wynchcote "View wynchcote's Profile")* on topic *[Show sub total after shipping before VAT](/forum/27-checkout/865486-show-sub-total-after-shipping-before-vat#142671 "-- url of the page with the problem -- : test site -- HikaShop version -- : 2.2.3 -- Joomla version -- : 2.5.17 -- PHP version -- : 5.3 -- Browser(s) name and version -- : n/a -- Error-message(debug-mod must be tuned on) -- : n//a  I have configured the HikaShop Starter to show prices ex VAT and to include VAT with shipping options.  Presentation in checkout is nice:  Total Shipping VAT Total  and the VAT is shown in brackets next to the shipping method below the total.  However, I still think some people may be confused about how the VAT is calculated i.e. as % of product and shipping.  For this reason, would like to include a sub-total.  Example:  Sub-total Shipping Sub-total VAT Total  Thanks,  Ken :)")*

Thanks for the pointer, Jerome.

I have had a go and achieved a kind of result (!) - see attached image using the following code:

---

/*ken*/
&lt;tr&gt;
&lt;?php echo $td; ?&gt;
&lt;td id="hikashop_checkout_cart_total2_title" class="hikashop_cart_subtotal_title hikashop_cart_title"&gt;
&lt;?php echo JText::_('HIKASHOP_TOTAL'); ?&gt;
&lt;/td&gt;
&lt;td class="hikashop_cart_subtotal_value"&gt;
&lt;?php
$this-&gt;row = $this-&gt;total;
echo $this-&gt;loadTemplate();
?&gt;
&lt;/td&gt;
&lt;/tr&gt;
/*ken*/

---

inserted as below.

Query 1: how can I do the sum in PHP?

Query 2: Woud making such a change (adding sub-tal) impact on code lower down the cart (e.g. coupons etc if they exist)?

Thanks for taking a look.

Ken ![:)](/media/kunena/emoticons/3.png ":)")

---

Code extract from cart:

---

&lt;tr&gt;
&lt;?php echo $td; ?&gt;
&lt;td id="hikashop_checkout_cart_shipping_title" class="hikashop_cart_shipping_title hikashop_cart_title"&gt;
&lt;?php echo JText::_('HIKASHOP_SHIPPING'); ?&gt;
&lt;/td&gt;
&lt;td class="hikashop_cart_shipping_value" &gt;
&lt;span class="hikashop_checkout_cart_shipping"&gt;
&lt;?php
if(isset($this-&gt;value)) {
echo $this-&gt;value;
} else {
$shipping_price = null;
foreach($this-&gt;shipping as $shipping) {
if(!isset($shipping-&gt;shipping_price) &amp;&amp; isset($shipping-&gt;shipping_price_with_tax) ) {
$shipping-&gt;shipping_price = $shipping-&gt;shipping_price_with_tax;
}
if(isset($shipping-&gt;shipping_price)) {
if($shipping_price === null)
$shipping_price = 0.0;
if(bccomp($taxes,0,5)==0 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax') &#124;&#124; !isset($shipping-&gt;shipping_price_with_tax)) {
$shipping_price += $shipping-&gt;shipping_price;
} else {
$shipping_price += $shipping-&gt;shipping_price_with_tax;
}
}
}
if($shipping_price !== null) {
echo $this-&gt;currencyHelper-&gt;format($shipping_price, hikashop_getCurrency());
}
}
?&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;

/*ken*/
&lt;tr&gt;
&lt;?php echo $td; ?&gt;
&lt;td id="hikashop_checkout_cart_total2_title" class="hikashop_cart_subtotal_title hikashop_cart_title"&gt;
&lt;?php echo JText::_('HIKASHOP_TOTAL'); ?&gt;
&lt;/td&gt;
&lt;td class="hikashop_cart_subtotal_value"&gt;
&lt;?php
$this-&gt;row = $this-&gt;total;
echo $this-&gt;loadTemplate();
?&gt;
&lt;/td&gt;
&lt;/tr&gt;
/*ken*/

&lt;?php
}

if(!empty($this-&gt;additional)) {
$exclude_additionnal = explode(',', $this-&gt;config-&gt;get('order_additional_hide', ''));
foreach($this-&gt;additional as $k =&gt; $additional) {
if(in_array($additional-&gt;name, $exclude_additionnal))
continue;
?&gt;
&lt;tr id="hikashop_checkout_cart_additional_&lt;?php echo str_replace(' ','_',$k); ?&gt;_line" &gt;
&lt;?php echo $td; ?&gt;
&lt;td id="hikashop_checkout_cart_additional_&lt;?php echo str_replace(' ','_',$k); ?&gt;_title" class="hikashop_cart_additional_title hikashop_cart_title"&gt;&lt;?php
echo JText::_($additional-&gt;name);
?&gt;&lt;/td&gt;
&lt;td class="hikashop_cart_shipping_value" &gt;
&lt;span class="hikashop_checkout_cart_shipping"&gt;
&lt;?php
if(!empty($additional-&gt;price_value) &#124;&#124; empty($additional-&gt;value)) {
if(bccomp($taxes,0,5)==0 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax')){
echo $this-&gt;currencyHelper-&gt;format(@$additional-&gt;price_value,$additional-&gt;price_currency_id);
}else{
echo $this-&gt;currencyHelper-&gt;format(@$additional-&gt;price_value_with_tax,$additional-&gt;price_currency_id);
}
} else {
echo $additional-&gt;value;
}
?&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;

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

- **[Eliot](/forum/user/1824-eliot "View Eliot's Profile")**
- [![Eliot's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1824.png)](/forum/user/1824-eliot "View Eliot's Profile")
- [ Offline](/forum/user/1824-eliot)

Less More

- Posts: 2334
- Thank you received: 403
-
-

12 years 9 months ago -  12 years 9 months ago [\#142675](#142675) by [Eliot](/forum/user/1824-eliot "View Eliot's Profile")  Replied by *[Eliot](/forum/user/1824-eliot "View Eliot's Profile")* on topic *[Show sub total after shipping before VAT](/forum/27-checkout/865486-show-sub-total-after-shipping-before-vat#142675 "-- url of the page with the problem -- : test site -- HikaShop version -- : 2.2.3 -- Joomla version -- : 2.5.17 -- PHP version -- : 5.3 -- Browser(s) name and version -- : n/a -- Error-message(debug-mod must be tuned on) -- : n//a  I have configured the HikaShop Starter to show prices ex VAT and to include VAT with shipping options.  Presentation in checkout is nice:  Total Shipping VAT Total  and the VAT is shown in brackets next to the shipping method below the total.  However, I still think some people may be confused about how the VAT is calculated i.e. as % of product and shipping.  For this reason, would like to include a sub-total.  Example:  Sub-total Shipping Sub-total VAT Total  Thanks,  Ken :)")*

Hi there,

Please avoid posting that much code without tags, it's painful to read ![:)](/media/kunena/emoticons/3.png ":)")
1 - you can simply use "+"
2 - It won't impact the other values since it's only about the display

Last edit: 12 years 9 months ago by [Eliot](/forum/user/1824-eliot "View Eliot's Profile").

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

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

Less More

- Posts: 52
- Thank you received: 2
-
-

12 years 9 months ago [\#142677](#142677) by [wynchcote](/forum/user/7009-wynchcote "View wynchcote's Profile")  Replied by *[wynchcote](/forum/user/7009-wynchcote "View wynchcote's Profile")* on topic *[Show sub total after shipping before VAT](/forum/27-checkout/865486-show-sub-total-after-shipping-before-vat#142677 "-- url of the page with the problem -- : test site -- HikaShop version -- : 2.2.3 -- Joomla version -- : 2.5.17 -- PHP version -- : 5.3 -- Browser(s) name and version -- : n/a -- Error-message(debug-mod must be tuned on) -- : n//a  I have configured the HikaShop Starter to show prices ex VAT and to include VAT with shipping options.  Presentation in checkout is nice:  Total Shipping VAT Total  and the VAT is shown in brackets next to the shipping method below the total.  However, I still think some people may be confused about how the VAT is calculated i.e. as % of product and shipping.  For this reason, would like to include a sub-total.  Example:  Sub-total Shipping Sub-total VAT Total  Thanks,  Ken :)")*

Sorry Eliot!

Point taken ![:)](/media/kunena/emoticons/3.png ":)")

The issue for a non-php guy like me is what code to use.

Ken:)

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

- **[Eliot](/forum/user/1824-eliot "View Eliot's Profile")**
- [![Eliot's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1824.png)](/forum/user/1824-eliot "View Eliot's Profile")
- [ Offline](/forum/user/1824-eliot)

Less More

- Posts: 2334
- Thank you received: 403
-
-

12 years 9 months ago [\#142685](#142685) by [Eliot](/forum/user/1824-eliot "View Eliot's Profile")  Replied by *[Eliot](/forum/user/1824-eliot "View Eliot's Profile")* on topic *[Show sub total after shipping before VAT](/forum/27-checkout/865486-show-sub-total-after-shipping-before-vat#142685 "-- url of the page with the problem -- : test site -- HikaShop version -- : 2.2.3 -- Joomla version -- : 2.5.17 -- PHP version -- : 5.3 -- Browser(s) name and version -- : n/a -- Error-message(debug-mod must be tuned on) -- : n//a  I have configured the HikaShop Starter to show prices ex VAT and to include VAT with shipping options.  Presentation in checkout is nice:  Total Shipping VAT Total  and the VAT is shown in brackets next to the shipping method below the total.  However, I still think some people may be confused about how the VAT is calculated i.e. as % of product and shipping.  For this reason, would like to include a sub-total.  Example:  Sub-total Shipping Sub-total VAT Total  Thanks,  Ken :)")*

Something like that should be ok: Code:

&lt;?php echo $td; ?&gt; &lt;td id="hikashop_checkout_cart_total2_title" class="hikashop_cart_subtotal_title hikashop_cart_title"&gt; &lt;?php echo JText::_('HIKASHOP_SUBTOTAL'); ?&gt; &lt;/td&gt; &lt;td class="hikashop_cart_subtotal_value"&gt; &lt;?php $this-&gt;row = $this-&gt;total+$shipping_price; echo $this-&gt;loadTemplate(); ?&gt; &lt;/td&gt; &lt;/tr&gt;

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

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