Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7536919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:42:26+00:00 2026-05-30T06:42:26+00:00

Can I achieve the following with Magento: I’m using a table rate system of

  • 0

Can I achieve the following with Magento:

I’m using a table rate system of price vs destination. And I’ve got a shopping cart price rule of Free Shipping for products with the attribute free_shipping -> to set yes.

This works fine if you have normal products in the basket OR free shipping products in the basket. However if you have both a normal product AND a free shipping product in the basket. It calculates the shipping based on the order total including the product with free shipping.

How can I correct this, so the shipping is applied only to the order total of products not including free shipping, when both type of products exist in the basket?

Is there a Magento Plugin for this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T06:42:28+00:00Added an answer on May 30, 2026 at 6:42 am

    I had the same problem and implemented a small code change to make it work.

    Basically forget the promotion rule. Disable it. It doesn’t seem to work properly with the shipping rates table when applying free shipping to individual items. The shipping rules seem to take precedence and calculate based on cart total.

    The trick is to subtract the free shipping items from the cart total at the point the Shipping Rates module is making the calculation.

    In my case everything inside a particular category (id:15) was to get free shippping. But you can amend the logic to suit your needs.

    You will need to amend the following file (or copy it to your local codebase to do things properly).

    app\code\core\Mage\Shipping\Model\Carrier\Tablerate.php

    CHANGE THIS:

    public function collectRates(Mage_Shipping_Model_Rate_Request $request)
        {
            if (!$this->getConfigFlag('active')) {
                return false;
            }
    
            // exclude Virtual products price from Package value if pre-configured
            if (!$this->getConfigFlag('include_virtual_price') && $request->getAllItems()) {
                foreach ($request->getAllItems() as $item) {
                    if ($item->getParentItem()) {
                        continue;
                    }
                    if ($item->getHasChildren() && $item->isShipSeparately()) {
                        foreach ($item->getChildren() as $child) {
                            if ($child->getProduct()->isVirtual()) {
                                $request->setPackageValue($request->getPackageValue() - $child->getBaseRowTotal());
                            }
                        }
                    } elseif ($item->getProduct()->isVirtual()) {
                        $request->setPackageValue($request->getPackageValue() - $item->getBaseRowTotal());
                    }
                }
            }
    

    TO THIS:

    public function collectRates(Mage_Shipping_Model_Rate_Request $request)
    {
        if (!$this->getConfigFlag('active')) {
            return false;
        }
    
        // exclude Virtual products price from Package value if pre-configured
        //And Exclude items which should have Free Shipping
        if (!$this->getConfigFlag('include_virtual_price') && $request->getAllItems()) {
    
           $freeshipping_category_id = 15;
    
            foreach ($request->getAllItems() as $item) {
                if ($item->getParentItem()) {
                    continue;
                }
                if ($item->getHasChildren() && $item->isShipSeparately()) {
                    foreach ($item->getChildren() as $child) {
                        if ($child->getProduct()->isVirtual()) {
                            $request->setPackageValue($request->getPackageValue() - $child->getBaseRowTotal());
                        }
                            //If it's in the free shipping, remove it's value from the basket
                            $arr_category_ids = $child->getProduct()->getCategoryIds();
                            if ( in_array($freeshipping_category_id, $arr_category_ids) ) {
                                $request->setPackageValue($request->getPackageValue() - $child->getBaseRowTotal());
                            }
                    }
                } elseif ($item->getProduct()->isVirtual()) {
                    $request->setPackageValue($request->getPackageValue() - $item->getBaseRowTotal());
                }
                    //If it's in the free shipping category, remove it's value from the basket
                    $arr_category_ids = $item->getProduct()->getCategoryIds();
                    if ( in_array($freeshipping_category_id, $arr_category_ids) ) {
                        $request->setPackageValue($request->getPackageValue() - $item->getBaseRowTotal());
                    }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As the title says, how can I achieve the following in ruby using regex
I want a rich text box control using which i can achieve following functionality:
I would like to know how I can achieve the following using the nginx
How can I achieve the following structure without using tables or JavaScript? The white
How can I achieve the following with the Ajax Control Toolkit MaskedEdit extender? Letter
How can I achieve the following in oracle without creating a stored procedure? Data
How can I achieve the following? // Resize triggers $(window).resize(function() { if (window.innerWidth <=
How can I use LINQ to achieve the following? I have some c# object
Can anyone please help me to work out how to achieve the following? I
Can someone please help me figure out a way to achieve the following (see

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.