Jump to content

Hide carrier based on product features / preferred shipping method


Recommended Posts

Here's my setup:  I have two custom carriers - one called "Ground Shipping" and the other called "Freight".  For simplicity's sake, we're going to say that all products are going to be associated with all carriers.  The carriers are actually using the same weight ranges, but freight has handling enabled, and handling is a non-zero value.

I feel that this is a common setup problem:  if I were to associate certain products to only one carrier, when you would add two products from different carriers, there would not be a single carrier available to ship all products - so I'd see the error "No available carriers".  However, if I associate all carriers to all products like I currently am, if a customer adds only an item that is small and would in actually ship from only Ground Shipping, they will see two carrier options - and the "Freight" option while valid, should not be displayed.

So - I need a way to hide carriers based on some other product feature, and then aggregate all product's features and feature values up to the point where I can access it on the theme.  Products would have a product feature called "Preferred Shipping Method", with "Ground Shipping" or "Freight".  If all products in the cart were of a certain feature value, I could conditionally hide the carriers.  If the products' feature had more than one distinct value, it means that at least one product is preferred Ground, and one product is preferred freight, meaning we need to not hide any options.

Also - the business logic isn't exactly as I described - because I do realize in the last scenario, we should logically disable "Ground Shipping".  In other words - one carrier should always be available, but we'd conditionally hide the "Freight" option only.

Am I overthinking this?  Is there some setting I haven't discovered, or a module to accomplish this?  Your suggestions appreciated.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...