Magento – Table rates -> Free shipping from X € – different taxes

free-shippingshippingshipping-methodstable-rates

Is there a way to set free shipping in tablerates for a Total inkl. Tax? The problem is tablerates are using the subtotal without tax but i need it including tax. Because we use two different taxes, we can´t just calculate the price without tax.

I want to set free-shipping in my tablerates .csv for a Total of 19€ including tax. How is this possible?

Best Answer

You can add new Condition in Table Rates for Price incl. Tax vs. Destination. In order to do that in app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php -> public function getCode below this line:

'package_value' => Mage::helper('shipping')->__('Price vs. Destination'),

add this code:

'package_value_incl_tax'  => Mage::helper('shipping')->__('Price incl. Tax vs. Destination'),

and below this:

'package_value' => Mage::helper('shipping')->__('Order Subtotal (and above)'),

add this:

'package_value_incl_tax'  => Mage::helper('shipping')->__('Order Subtotal incl. Tax (and above)'),

This to be able to work you have to add in app/code/core/Mage/Shipping/Model/Shipping.php -> public function collectRatesByAddress below:

$request->setPackageValue($address->getBaseSubtotal());

this:

$request->setPackageValueInclTax($address->getPackageValueInclTax());

and in app/code/core/Mage/Sales/Model/Quote/Address.php -> public function requestShippingRates below:

$request->setPackageValue($item ? $item->getBaseRowTotal() : $this->getBaseSubtotal());

this:

$request->setPackageValueInclTax($item ? $item->getBaseRowTotalInclTax() : $this->getBaseSubtotalInclTax());
Related Topic