verbb / postie

A Craft Commerce shipping calculator plugin.
Other
12 stars 18 forks source link

Shipping method based on quantity #95

Open johnj24 opened 1 year ago

johnj24 commented 1 year ago

Question

Hi, Josh. What's currently the best solution for showing and hiding shipping methods based on quantity? We ship magazines and if a customer buys one issue, that one issue can fit in both a USPS First Class Envelope and a USPS Priority Mail Medium Flat Rate Box (which we use for large quantities). How can I limit orders -- i.e., the one magazine issue -- to just the envelope. And only when you hit a quantity, let's say, over 6, then the medium box is triggered.

FYI, we're using 'packingMethod' => 'boxPacking' and have set up one first class envelope size. I don't assume we need to set up sizes for priority mail since those are USPS boxes that come from the provider (is this wrong?).

Thanks.

Additional context

No response

engram-design commented 1 year ago

Hmm, the only way you could do this is through events where you might check if if matches one shipping method, to remove the others. I suppose the general thinking is that when presenting with multiple options like USPS First Class Envelope and a USPS Priority Mail Medium Flat Rate Box people will pick the cheapest.

As for the box sizes, they're dependant on the "Box Sizes" settings, and nothing is pulled in from USPS automatically. You'll need to define your own box sizes for things. But, not being a USPS expert by any means, we can certainly pre-fill some of these boxes like we do for other providers. The tricky thing with this from what your describing is even if we pre-fill these (check UPS) they're not applicable to every service, maybe just the priority mail services.

johnj24 commented 1 year ago

Thanks for the reply, Josh. So, you would recommend we input the size for Priority Mail Medium Flat Rate box?

And just to provide a bit of clarity, USPS provides Priority Mail envelopes/boxes free of charge. These envelopes/boxes have to be used for Priority Mail services. It gets a bit tricky if you wanted to pre-fill, as Medium Flat Rate actually has two box sizes (a top filled box, and a side filled box). As does Large Flat Rate (as seen on this FAQ page).