I'm looking how to restrict available shipping methods based on the items in a customer's cart. Here's some examples of what I want to do.

  • Customers may be purchasing smaller and lighter items, shipping UPS ground doesn't seem to make sense here.

    • This more pressing concern here is, if I'm always listing some flat rate options, like UPS padded flat rate envelope or UPS small flat rate box, and the customer has a bunch of items, or even 1 small item that's too large, I can't have them picking the shipping options that are too small.

    • The items I'm shipping can very greatly in dimensions and weight. Maybe if there's some way I can restrict the shipping methods based on dimensions AND/OR weight, that would be great.

I've been a lot of references to extensions but I'm hoping to find one that's free. The ones I have saw, are not. I also seen some things with code, even though I'm a web dev, I'm hoping there's something to handle this with an extension or creating some rules in the back end and not coding.

I have magento

Thank you.

1 Answer 1


What you're trying to accomplish is not easy and it's not supported by Magento Community out-of-the-box. Either you have to find yourself a module and be lucky it fits your needs, or you're up to quite a task of backend development. Basically you're trying to accomplish dynamic shipping methods based on product attributes.

My first guess as a developer would be to extend the default table rates functionality or create a module and observe the event that loads the checkout page & shipment quote, then check the cart contents and apply your rules. You'll have to hard code it or put in some extra effort to make everything dynamic. I would happily explain you how to accomplish such thing but my guess is that's not the way you want to go. Developing it will take some time and requires some Magento development skills.

I did some google searches but i don't think you're going to find a module that does all this for free. Simply because it's worth money due to complexity and development time (someone correct me if i'm wrong, i would gladly contribute to the project if it exists). Most of the time free modules require small modifications to fit your needs. Also in my opinion, a project with requirements like these should have a budget to pay for the costs of buying or developing functionality like this.


There are several ways for you to go, neither of them fit all your needs and are free or do not require some development effort. Shipment is a pretty important aspect of your store, and in my opinion worth a little investment. Here are some options, depending on your store, you could combine some of the "free" options with less effort to get your desired result. Just test everything carefully and make sure it doesn't backfire on you. I ended up up paying for my customers shipment due to wrong settings and calculations a couple of times.

The cheapest solution is creatively utilising Magento's promotion rules. They allow you to conditionally apply rules based on product attributes, the rules also have affect on shipment. Mostly it's discounts. It isn't neat but gets the job done in some instances. Here's some more advanced example: http://addoa.com/blog/how-restrict-free-shipping-magento

A little development could be done with this example. You could apply some rules based on product attributes. Add a product attribute like "ship_by_mail" or "size_large" and append some rules in your observer enabling or disabling methods. https://github.com/robertkent/card-only

I have build several extensions that apply rules for payment methods or price rules based on customer or product attributes. If you decide to go for developing something, i could provide you with some example code.

The better idea in my opinion is to buy a decent module. There are modules available in wide ranges that can fulfill your needs. For example, this one let's you specify the rate at each product, it'll take you some more time to configurate your products but at almost no cost. It's comparable to the development idea i just described. https://www.magmodules.nl/attribute-shipping-method.html

This would be a nice mid-range solution providing you with plenty of options at an affordable price without spending lots of time configuring all your products. https://amasty.com/shipping-rules.html.

And of course there are some more expensive solutions which provide you with even more options. Depending on your store, this might be it, or way too much. It certainly looks interesting. http://webshopapps.com/eu/shipping-override-matrix.html


There are a lot of options for you to go. You should carefully decide where you want to go with your store in the future. Each options has it's pro's and cons and switching an option later isn't ideal. In some instances it's better too pay a little and save you time and risk. If your store only contains several products or your just starting and are low in budget, i would try to combine some of the first options. I hope this is of any help to you in deciding which way too go.

  • Thank for you the response. This is more than satisfactory, albeit, disappointing lol. I was hoping the solution would be easier. Again, thank you. I'll have to digest what you said here.
    – Mike S
    Commented Jun 28, 2016 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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