Shopping cart to not shows tax on shippingcosts

  • Posts: 307
  • Thank you received: 22
10 years 5 months ago #196245

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.6.6
-- Browser(s) name and version -- : all

Hi,
I'm trying to change the display of the shippingcosts in the cart module. (view product_cart)
Now it shows products without tax but shippingcosts with tax.

I would like to have all the products and shippingcosts in the shopping cart without tax and apply tax only at the checkout.
Is this a setting I missed or should something be modified in the view ?
If so, any tips would be welcome.

Thanks,
Nico

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

  • Posts: 84306
  • Thank you received: 13701
  • MODERATOR
10 years 5 months ago #196254

Hi,

In the HikaShop configuration page, there is a "show taxed prices" option that you can set to "no tax" and in that case the shipping costs will show without tax and the tax will only be added to the subtotal of the cart on the checkout.

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

  • Posts: 79
  • Thank you received: 2
9 years 9 months ago #224006

Hi i am looking for something similar.
In the checkout cart view i want the products to be including tax, but the subtotal and shipping without tax.
Now i changed the subtotal already and thats showing with out tax.
If i change the option in the configuration it show everything without tax, so that's not what i want.
If i put the $this->params->set('price_with_tax',0); it will do the same.
Some threads are older and dont match up with the current code anymore.

Can you show how to change the code in the views / checkout / cart.php?

Thanks

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

  • Posts: 84306
  • Thank you received: 13701
  • MODERATOR
9 years 9 months ago #224016

Hi,

Well, you're on the right track.
You can change the behavior of the system with the code:
$this->params->set('price_with_tax',0); //without tax
or:
$this->params->set('price_with_tax',1); //with tax
So simply add one or the other before the display of the price that you want to change in the checkout/cart view file.
You can change the behavior several times in the same view file so that's not a problem.

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

  • Posts: 79
  • Thank you received: 2
9 years 9 months ago #224050

Hi,

I tried to change the code like you suggested, but that doesnt work for me. This is what i did.

<span class="hikashop_checkout_cart_shipping">
<?php
	if(isset($this->value)) {
		echo $this->value;
    	  } else {
		$shipping_price = null;
		foreach($this->shipping as $shipping) {
                     if(!isset($shipping->shipping_price) && isset($shipping->shipping_price_with_tax) ) {
				$shipping->shipping_price = $shipping->shipping_price_with_tax;
			          }
                 if(isset($shipping->shipping_price)) {
			if($shipping_price === null)
					$shipping_price = 0.0;
			if(bccomp($taxes,0,5)==0 || !$this->params->get('price_with_tax',0) || !isset($shipping->shipping_price_with_tax)) {
					$shipping_price += $shipping->shipping_price;
			} else {
					$shipping_price += $shipping->shipping_price_with_tax;
					}
			}
			}
			if($shipping_price !== null) {
				echo $this->currencyHelper->format($shipping_price, $this->full_total->prices[0]->price_currency_id);
				}
			}
?>
</span>

I changed the !$this->params->get('price_with_tax',0) but didnt put the semi-colon behind it because of the placement in the if statement. Im not that good with php.

ps. I made another thread the other day because i lost this one. can you remove that tread.
hikashop.com/forum/product-category-disp...s-including-tax.html

Last edit: 9 years 9 months ago by rkuiper.

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

  • Posts: 84306
  • Thank you received: 13701
  • MODERATOR
9 years 9 months ago #224074

Rather than changing the condition of the if, you should do as I said and add the line:
$this->params->set('price_with_tax',0);

for example, before the line:
if(isset($this->value)) {

The following user(s) said Thank You: rkuiper

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

  • Posts: 79
  • Thank you received: 2
9 years 9 months ago #224117

Ok i see what you mean now. I miss read that before.
It works perfect. thank you

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

Time to create page: 0.076 seconds
Powered by Kunena Forum