问题
I'm using Magento and I am having a problem with the totals being displayed.
At the moment I have this:
Subtotal: £10.00
Shipping & Handling: £5.00
Tax (at the moment just using 20% of Subtotal) (20%):£2.00
Grand Total: £17.00
So It should look like:
Subtotal: £10.00
Shipping & Handling: £5.00
Tax (need it to be 20% of subtotal AND 20% of shipping & Handling) (20%):£3.00
Grand Total: £18.00
As you can see the Tax has gone from £2.00 to £3.00 as I need it to take 20% of the Shipping & Handling fee as well as 20% of the subtotal fee?
回答1:
Go to System -> Configuration -> Sales -> Tax -> Tax Classes and change the Tax Class for Shipping
drop down to Shipping
and re-check your totals.
回答2:
The quick and dirty way to do this would be to override the cart/totals.phtml template and use $this->getTotals()
from the totals block and manually display the totals you want.
If you want a cleaner and more proper way of doing this, then the templates under the tax folder control how those things are rendered. Tax specifically has two blocks that use the template, one for the cart and one for the checkout. I cant remember their exact names atm. If you want to add this functionality into the block then override both blocks. If you would rather do it in the template then remember that you have access to all blocks that are going to render a page at template time. You can say Mage::app()->getLayout()->getBlock('block.name');
I am not sure if the shipping total block will have the info you are looking for at that moment since it may be dynamically created by the cart totals block. If thats the case, then you will have to first get the totals block Mage::app()->getLayout()->getBlock('cart.totals.block.name')
and call getTotals() on it. Then you can get 20% of whatever the shipping total has.
回答3:
Just set the Tax Class for Shipping
setting to Taxable Goods
. Then as long as all of your products are set in the Taxable Goods
tax class, the tax will include tax on the shipping charge.
回答4:
Additionally to going to System -> Configuration -> Sales -> Tax -> Tax Classes
and changing the Tax Class for Shipping
drop down to Shipping
as suggested by seanbreeden,
you should also ensure that there is no Tax Rule
applied on the Shipping
Tax Class
.
For this, go to Sales -> Tax -> Manage Tax Rules
and filter by the correct Customer Tax Class
and Product Tax Class
= Shipping
.
If there are rules found, click them one by one, and you will see which rate is applied on the Shipping
. If you want to turn off the tax on shipping, you should remove the Shipping
from all the Tax Rules
that you have found.
来源:https://stackoverflow.com/questions/10449629/magento-add-shipping-tax-to-tax-breakdown-and-grand-total