How to display zero taxes

  • Posts: 55
  • Thank you received: 4
12 years 20 hours ago #76710

I have two tax categories: taxable and non-taxable. If an order has only non-taxable items, then there's no tax entry at checkout (the tax calculation result only appears when the order has a taxable item). Is it possible to have $0.00 appear when no tax is applied?

I know I can do this with another non-taxable rule for each zone, but this results in two tax entries: a zero and the usual non-zero when there are both non-taxable and taxable items at checkout. I'd like to be able to have that zero entry appear only when the checkout has non-taxable items.

Dave

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

  • Posts: 82818
  • Thank you received: 13360
  • MODERATOR
12 years 6 hours ago #76871

You would have to edit the file "cart" of the view "checkout" via the menu Display->Views and change the line:
if(bccomp($taxes,0,5)){
to:
if(true){
so that the tax line would display even for 0.

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

  • Posts: 55
  • Thank you received: 4
11 years 11 months ago #77095

Hi Nicolas,

That didn't seem to work. Sorry, I can't give you any more info other than the zero tax doesn't show up after making that change.

Dave

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

  • Posts: 82818
  • Thank you received: 13360
  • MODERATOR
11 years 11 months ago #77169

Hi,

Can you make sure that you're editing the view file for your frontend template and not another template ?

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

  • Posts: 55
  • Thank you received: 4
11 years 11 months ago #77232

Hi Nicolas,

Yes, I'm as sure as I can be. After going to Display > Views, I select the template and 'Frontend' from the dropdown menus at the top right. I then edit the checkout/cart option (last line in the screen shot ZeroTax1.jpg), and make the change you suggested at line 185 (or so).

Regards,

Dave

Attachments:

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #77249

Hi,

Does the option "Details tax display" activated ?
In order to see if you are enter in the right part of the code, you can put this test code

if(true) { echo '#alwaysShowTax#';
At this moment, if you're editing the right view and if the code goes in the if, the text would be display during the checkout.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 55
  • Thank you received: 4
11 years 11 months ago #77745

Yes 'Detailed Tax Display' is enabled in Configuration > Display. The added tag also shows up on at checkout after editing the same file as before (see attached image). Still no zero tax.

Dave

Attachments:

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #77849

Hi,

Can you give a link to your web store ?

Without "Detailed Tax Display" (option set to "no"), you should have one table entry named "Taxes".
With the option activated, HikaShop would display every taxes.

I made a test on my local store to check it.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 55
  • Thank you received: 4
11 years 11 months ago #77851

Thanks Jerome. The site is

test.cheese2go.ca/index.php/shop-main

Dave

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #77852

Thanks,

I though I could find more information but I would require a backend admin to your site, if possible (You can send me it by private message).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #77854

Hi,

Your view is fixed.

The problem was : "$this->full_total->prices[0]->taxes" was set but was an empty array.
So I have replace the "isset" test to "empty" test.

        if(true){
          if($this->config->get('detailed_tax_display') && !empty($this->full_total->prices[0]->taxes)){

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 55
  • Thank you received: 4
11 years 11 months ago #77855

Hi Jerome,

Thanks very much for the excellent support. One last thing on this thread... I'd like to have the taxes show above the shipping amount and below the total (because the shipping amount includes taxes). Let me know how I can switch those around.

Dave

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

  • Posts: 13201
  • Thank you received: 2322
11 years 11 months ago #77872

Hi,

To Change the place of the elements, you have to edit the view "checkout / cart". Then cut and paste:

				if(bccomp($taxes,0,5)){
					if($this->config->get('detailed_tax_display') && isset($this->full_total->prices[0]->taxes)){
						foreach($this->full_total->prices[0]->taxes as $tax){
													 ?>
								<tr>
									<?php if($this->params->get('show_cart_image')) echo '<td></td>'; ?>
									<td>
									</td>
									<td>
									</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">
										<span class="hikashop_checkout_cart_taxes">
										<?php
											echo $this->currencyHelper->format($tax->tax_amount,$this->full_total->prices[0]->price_currency_id);
										?>
										</span>
									</td>
								</tr>
						<?php
						}
					}else{

						 ?>
						<tr>
							<?php if($this->params->get('show_cart_image')) echo '<td></td>'; ?>
							<td>
							</td>
							<td>
							</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">
								<span class="hikashop_checkout_cart_taxes">
								<?php
									echo $this->currencyHelper->format($taxes,$this->full_total->prices[0]->price_currency_id);
								?>
								</span>
							</td>
						</tr>
				<?php }
				}?>
Before:
				if(!empty($this->shipping)){

The following user(s) said Thank You: av.opticom

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

  • Posts: 55
  • Thank you received: 4
11 years 11 months ago #77969

Great! Thanks, Xavier.

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

Time to create page: 0.100 seconds
Powered by Kunena Forum