Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shipment method based on product groups? #837

Closed
mlocati opened this issue Jan 29, 2024 · 7 comments · Fixed by #838
Closed

Shipment method based on product groups? #837

mlocati opened this issue Jan 29, 2024 · 7 comments · Fixed by #838

Comments

@mlocati
Copy link
Contributor

mlocati commented Jan 29, 2024

I have this request from a customer of mine:

  1. if the order total is below X: use shipping method M1 (which costs P1)
  2. if the order total is X or more: use shipping method M2 (which costs P2)

BUT

  1. if the order contains products belonging to certain groups, we should use shipping method M3 (which costs P3) - regardless of the order amount.

Community Store already allows implementing 1. and 2.

But I don't see a way to implement 3.
That's correct? If so, I'd submit a pull request that adds these two info to the shipping methods:
a. apply this shipping method only for orders that don't contain any product belonging to one or more of the following groups: ...
b. apply this shipping method only for orders that contain one or more product belonging to one or more of the following groups: ...

Note

If you want to know the reason of this request:

  • for orders up to 99.99 €, the shipment costs 7 €
  • for orders from 100 €, the shipment is free
  • orders containing products discounted by 50% or 70%, the shipment costs 7€ for any order amount
@mlocati mlocati changed the title Shipment method based of product groups? Shipment method based on product groups? Jan 29, 2024
@Mesuva
Copy link
Collaborator

Mesuva commented Jan 29, 2024

You are correct in your description.

I've had a similar request in the past, but I explained to the client how it starts to get potentially quite complex when you've got both kinds of product in the same cart. So I think I convince them to handle shipping a different way.

But if you believe you have a neat/generic way to handle this I'd certainly welcome the addition, it only adds to the flexibility.

@mlocati
Copy link
Contributor Author

mlocati commented Jan 29, 2024

Yep, I know it's rather complex. But you know, the customer is always right 😉

What about these new options?

  • Don't apply this shipment method if all the products belong to any of the following groups: ...

  • Apply this shipment method only if all the products belong to any of the following groups: ...

@Mesuva
Copy link
Collaborator

Mesuva commented Jan 29, 2024

That makes sense. I would word them:

"Don't offer this shipping method if any product is in any of the following groups"
An example might be a very large item, that can't be shipped with express shipping.

"Only offer this shipping method if any product is in any of the following groups"
An example might be a 'pickup' option, that is only offered if someone includes in their order a product that can't be shipped

So for 'orders containing products discounted by 50% or 70%, the shipment costs 7€ for any order amount', you would:

  • use the first option against both shipping options, pick a 'discounted product' group.
  • use the second option to enable a third shipping option, one that is 7€, regardless of the order amount.

So you'd actually need three shipping options

  • for orders up to 99.99 €, the shipment costs 7 €, as long as there are no products in the 'discounted products' group
  • for orders from 100 €, the shipment is free, as long as there are no products in the 'discounted products' group
  • for orders that contain at least one in the 'discounted products' group, setting it to 7 €

@mlocati
Copy link
Contributor Author

mlocati commented Jan 29, 2024

What about orders with mixed products (discounted and not discounted)?

Shipment methods using "Don't offer this shipping method if any product is in any of the following groups" wouldn't be offered.

So, we'd need 4 options:

  1. Don't offer this shipping method if any product is in any of the following groups
  2. Don't offer this shipping method if all the products are any of the following groups
  3. Only offer this shipping method if any product is in any of the following groups
  4. Only offer this shipping method if all the products are in any of the following groups

When the store owners edit the shipping method, I'd add two fields:

Label: Applicability based on product groups
Field: a <select> element with the 4 options above, plus a default "Don't care" option

Label: Product groups
Field: list of product groups (hidden if the <select> above is "Don't care")

@Mesuva
Copy link
Collaborator

Mesuva commented Jan 29, 2024

That would cover everything.

I don't think you need all four options for your client's particular problem, but if you are adding them, it probably makes sense to add the other options anyway.

@mlocati
Copy link
Contributor Author

mlocati commented Jan 29, 2024

A pull request is on its way 😉

@mlocati
Copy link
Contributor Author

mlocati commented Jan 29, 2024

A pull request is on its way 😉

Here it is: #838

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants