2

we use magento 1.8.1CE

People now get Free shipping over 49,95 (with free shipping shipment method)

But we want to disable this when a product gets a special price (defined by a catalog price rule).

But when they have a mixed cart .... With some Sale items and some Not-Sale items, and the none sale items get over the 49,95 the free shipping is applied.

What i would like to have ... Is that the free shipping is only being calculated with non-sale items.

Can this be done in magento?

1

There is no relation between catalog rules and shipping methods. Basically shipping charges are applied after product and cart item prices.

Magento does not have a feature "Disable free shipping with Catalog Price Rule" by default.

See this link for further explanation: How to Ignore Catalog Pricing Rule when applying Shopping Cart Price Rule?

0

You could rewrite Mage_Shipping_Model_Carrier_Freeshipping and override the method collectRates().

There you have to replace the following code

if (($request->getFreeShipping())
    || ($request->getBaseSubtotalInclTax() >=
        $this->getConfigData('free_shipping_subtotal'))
) {

with

if (($request->getFreeShipping())
    || ($this->_getSubTotalForFreeShipping($request) >=
        $this->getConfigData('free_shipping_subtotal'))
) {

and add this new method:

protected function _getSubTotalForFreeShipping(Mage_Shipping_Model_Rate_Request $request)
{
    $subTotal = $request->getBaseSubtotalInclTax();
    foreach ($request->getAllItems() as $item) {
        if ($item->getFinalPrice() < $item->getPrice()) {
            $subTotal -= $item->getFinalPrice();
        }
    }
    return $subTotal;
}

This should subtract the price of all special price items from the value that is compared with the free shipping treshold.

Untested code, I am not sure, if $item->getFinalPrice() < $item->getPrice() is really sufficient to determine products with applied catalog rules.

0

I solved it in the opposite way.

First I had set the free shipping At 49,95. For all collections. In this way I couldn't exclude the sale items.

I have given de sale items an extra attribute. Sale in my case Yes for sale, no for not sale.

I now have set the free shipping At 99,95. (The desired free shipping with sale items)

Then I have made a free shipping cart rule (without a specific code) for getting free shipping At 49,95 with an extra rule. All items who have the attribute sale = no get free shipping At 49,95.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.