Jump to content

Help With Taxes On Cart Block


Recommended Posts

Hi guys!

 

I was wondering how can I display the product price of the cart without taxes. I'been playing with the displayPrice function but didnt get what I want.

 

I have this:

 

1x Product... 11.80€

1x Product1... 11.80€

-----

Shipping... x

Taxes.... 3.60€

Total... 23.60€

 

 

And this is what i need:

 

1x Product... 10€

1x Product1... 10€

-----

Shipping... x

Taxes.... 3.60€

Total... 23.60€

 

I have been trying to get it by changing the way Prestashop get that price from the cart.php but it automatically refreshes to the w/Tax price (So the problem comes from the ajax-cart.js).

 

Anyone has done this before?

 

Thanks in advance

Link to comment
Share on other sites

  • 2 months later...

Same problem: To get the taxes to show in the Block cart:

modify the file: /modules/blockcart/blockcart.tpl and replace the end of the code by the code below:

 

Basically if {$total_tax} exists then it is displayed.

 

  <!-- Show the total tax in the cart with tax excl. -->
  {if $show_tax && isset($total_tax)}
	<span>{l s='Tax' mod='blockcart'}</span>
	<span id="cart_block_tax_cost" class="price ajax_cart_tax_cost">{$total_tax}</span>
	<br/>
  {/if}
  <span>{l s='Total' mod='blockcart'}</span>
  <span id="cart_block_total" class="price ajax_block_cart_total">{$total}</span>
</p>
{if $use_taxes && $display_tax_label == 1 && $show_tax}
  {if $priceDisplay == 0}
	<p id="cart-price-precisions">
	  {l s='Prices are tax included' mod='blockcart'}
	</p>
  {/if}
  {if $priceDisplay == 1}
	<p id="cart-price-precisions">
	  {l s='Prices are tax excluded' mod='blockcart'}
	</p>
  {/if}
{/if}
<p id="cart-buttons">
  {if $order_process == 'order'}<a href="{$link->getPageLink("$order_process.php", true)}" class="button_small" title="{l s='Cart' mod='blockcart'}">{l s='Cart' mod='blockcart'}</a>{/if}
  <a href="{$link->getPageLink("$order_process.php", true)}{if $order_process == 'order'}?step=1{/if}" id="button_order_cart" class="exclusive{if $order_process == 'order-opc'}_large{/if}" title="{l s='Check out' mod='blockcart'}">{l s='Check out' mod='blockcart'}</a>
</p>
 </div>
 </div>
</div>
<!-- /MODULE Block cart -->

 

If you refresh, the total reverts back to the total without taxes...

I tried replacing {$total} with {displayPrice price=$total_price} with the same result.

Link to comment
Share on other sites

  • 2 months later...

Ok I am not sure exactly what you guys are trying to accomplish but you set the tax included or excluded under Customers/ groups, edit a group and you will see a drop down list for include tax or exlude tax.

 

Now if the tax line itself is not displayed in your cart first go to Payment/ taxes and scroll to bottom of page and make sure Enable tax is set to Yes, and Display tax in cart is set to yes.

 

If you had to make changes be sure to set Force Compile to yes under preferences/ performance save and click the link to your shop on top of page.

 

Now if for some reason the tax line just wont display in your cart, change the following lines in Modules/ Blockcart.php

 

original

else

$taxCalculationMethod = Group::getDefaultPriceDisplayMethod();

$useTax = !($taxCalculationMethod == PS_TAX_EXC);

 

New

else

$taxCalculationMethod = Group::getDefaultPriceDisplayMethod();

$useTax = true; /*!($taxCalculationMethod == PS_TAX_EXC)*/;

Link to comment
Share on other sites

Hi tdr170,

 

I'm not positive about what the others are trying to accomplish, but as for me - I've set everyhitng up in the admin control panel. That's not the problem. The problem is that since I've upgraded to the new 1.4.6.2 version, taxes are not displaying in the block cart.

 

Dragon 123 is on the right track. With Dragon's code I now have taxes displaying in the block cart. But I have 2 new problems:

  1. The tax doesn't get added to the total price ( I believe the variable is 'cart-price-precisions'); and
  2. The tax that is displayed does not show the correct number of decimal places for currency, i.e.tax is $12.60 but it is displayed as $12.6 and it is right justified which doesn't line up correctly with the other costs shown in the block cart. See image below. I am modifying the blockcart.tpl file.

 

cart_block_taxes.jpg

Link to comment
Share on other sites

Good idea tdr170, but it didn't work. In fact, the SVN 1.5.0.3 version of blockcart.tpl is even more messed up. It keeps showing the product twice and no taxes.

 

Someone that knows tpl programming really should be able to figure out the code needed to get the blockcart to add the taxes to the total and show two decimal places.

Link to comment
Share on other sites

How do you even modify tpl files? I modify them in my text editor, upload the revised file using FTP, then no changes. I check "View Source" and nothing's changed. I assumed it's not possible to change tpl files.

 

Remember to compile de code. You have that option on Preferences/Performance or just by deleting all the files on /tools/smarty/compile.

Link to comment
Share on other sites

How do you even modify tpl files? I modify them in my text editor, upload the revised file using FTP, then no changes. I check "View Source" and nothing's changed. I assumed it's not possible to change tpl files.

 

When you modify files you must turn force compile to on and cache to off in preferences/performance.

I am sure if you lookes at the actuall file you edited and uploaded the changes are still there.

What you are seeing using view source are cached pages not the updates as you did not force compile.

Link to comment
Share on other sites

I am not using 1.5. I thought those were your instructions regarding using Prestashop SVN to try and fix the problem. I probably misunderstood. I am using 1.4.6.2.

 

Also no need to continue answers about compiling. I figured that out several days ago.

 

I would very much appreciate you zipping your files for me. Is there any other info you need from me?

 

tdr170 - thank you very much for answering questions on this forum.

Link to comment
Share on other sites

tdr170,

 

Your files WORKED. Thanks so much. I apprecieated your careful instructions in the read me file.

 

Also new - at least on my shopping cart, the drop down arrow that allows viewer to expand or collapse the block cart. Nice touch!

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 year later...
  • 3 months later...

Hi guys!

 

I was wondering how can I display the product price of the cart without taxes. I'been playing with the displayPrice function but didnt get what I want.

 

I have this:

 

1x Product... 11.80€

1x Product1... 11.80€

-----

Shipping... x

Taxes.... 3.60€

Total... 23.60€

 

 

And this is what i need:

 

1x Product... 10€

1x Product1... 10€

-----

Shipping... x

Taxes.... 3.60€

Total... 23.60€

 

I have been trying to get it by changing the way Prestashop get that price from the cart.php but it automatically refreshes to the w/Tax price (So the problem comes from the ajax-cart.js).

 

Anyone has done this before?

 

Thanks in advance

Go to the customer->Groups

and change setting

Price display method: Tax Excluded

go to the localization->tax

and change setting

Display tax in the shopping cart: yes

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...