Skip to main content

Show VAT in cart module

9 years 8 months ago #264663 by nuntius
-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.6.5
-- PHP version -- : 7.0.16
-- Browser(s) name and version -- : Chrome
-- Error-message(debug-mod must be tuned on) -- : None

Hello,

I would like to show the tax amount in the cart which is shown by the cart module of Hikashop.
I checked the cart.php view of Product in Display -> Views to see what happens there. I see in the <tfoot> section the shipping method and coupons and ofcourse the total price.

Is it possible to add a line showing the different tax totals of the order? Including the tax associated with a shipping method?
I currently have 2 tax categories, a 21% VAT category for mainly the shipping method and a 6% VAT category for most products.

Thank you in advance!

Cheers,
Teeuwis

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

9 years 8 months ago #264665 by nicolas
Replied by nicolas on topic Show VAT in cart module
Hi,

There is no option to have a tax line in the cart module.
You'll have to edit the file "cart" of the view "product" in order to add custom code in between the shipping and total display:
Code:
<?php if(!empty($shows['shipping']) && !empty($this->element->shipping) && $this->shipping_price !== null) { ?> <tr> <?php if($colspan > 0) { ?> <td class="hikashop_cart_module_shipping_title" colspan="<?php echo $colspan; ?>"><?php echo JText::_('HIKASHOP_SHIPPING'); ?></td> <?php } ?> <td class="hikashop_cart_module_coupon_value"><?php echo $this->currencyClass->format($this->shipping_price, $this->total->prices[0]->price_currency_id); ?></td> <?php if(!empty($columns['delete'])) { ?> <td></td> <?php } ?> </tr> <?php } ?> <tr> <?php if($colspan > 0) { ?> <td class="hikashop_cart_module_product_total_title" colspan="<?php echo $colspan; ?>"><?php echo JText::_('HIKASHOP_TOTAL'); ?></td> <?php } ?> <td class="hikashop_cart_module_product_total_value"><?php $this->row = $this->total; echo $this->loadTemplate(); ?></td> <?php if(!empty($columns['delete'])) { ?> <td></td> <?php } ?> </tr>
you can base yourself on the code from the "show_block_cart" of the view "checkout":
Code:
if($this->config->get('detailed_tax_display') && isset($cart->full_total->prices[0]->taxes)) { foreach($cart->full_total->prices[0]->taxes as $tax) { ?> <tr> <td colspan="<?php echo $row_count - 2; ?>" class="hikashop_cart_empty_footer"></td> <td id="hikashop_checkout_cart_tax_title" class="hikashop_cart_tax_title hikashop_cart_title"><?php echo $tax->tax_namekey; ?></td> <td class="hikashop_cart_tax_value" data-title="<?php echo $tax->tax_namekey; ?>"> <span class="hikashop_checkout_cart_taxes"><?php echo $this->currencyClass->format($tax->tax_amount, $cart->full_total->prices[0]->price_currency_id); ?></span> </td> </tr> <?php } } else { ?> <tr> <td colspan="<?php echo $row_count - 2; ?>" class="hikashop_cart_empty_footer"></td> <td id="hikashop_checkout_cart_tax_title" class="hikashop_cart_tax_title hikashop_cart_title"><?php echo JText::_('TAXES'); ?></td> <td class="hikashop_cart_tax_value" data-title="<?php echo Jtext::_('TAXES'); ?>"> <span class="hikashop_checkout_cart_taxes"><?php echo $this->currencyClass->format($taxes, $cart->full_total->prices[0]->price_currency_id); ?></span> </td> </tr> <?php }

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

Time to create page: 0.049 seconds
Powered by Kunena Forum