OrchardCMS / OrchardCore.Commerce

The commerce module for Orchard Core.
MIT License
213 stars 88 forks source link

Product Promotions: Discount with DiscountPart (OCC-127) #255

Closed dpomt closed 1 year ago

dpomt commented 1 year ago

Hi, thanks for implementing OrchardCore Commerce!

I have just cloned the actual repo and did some tests. Regarding the discounts: In Nwazet commerce, there has been a content type Discount with a DiscountPart. The concept was having different discounts with "rules" when they apply - see screenshot:

image

I have used this to apply discount depending on user role.

In the current implemtation, it seems that the DiscountPart is attached to the product. Are the any plans to change that like it previously was in NwazetCommerce? If yes, is there any timeline? If no, how could a role-based discount be integrated in the currenct concept/implemtation?

Sorry for cross-posting - I have already commented on https://github.com/OrchardCMS/OrchardCore.Commerce/issues/9 but not sure if this is still alive since it's from 2018.

Thanks, Dieter

Jira issue

sarahelsaig commented 1 year ago

Hi Dieter, the role-based discount is a good idea, though it's not possible without code changes. We didn't think of this yet and nobody has brought it up before, but I'll try to make it work. We have no plans to add a separate Discount content type, that's a pretty high level of complexity for where the project is right now. Note that we aren't trying to meticulously copy Nwazet (mainly because we don't know which features of it people actually use). We only refer to it when someone points to a specific part.

Annoyingly enough, OC has built-in content picker and user picker fields, but no role picker field. Otherwise this would be really easy to implement by adjusting DiscountProvider.IsApplicableAsync(). I will ask around.

dpomt commented 1 year ago

Hi David,

thank's for your reply. Do you have any ideas how non-product specific role-based discounts could be implemented without implementing a discount content part? Of course a role-base discount can be added to all available products, but guess this is not the way it should be handled.

Thanks, Dieter

sarahelsaig commented 1 year ago

To make sure that I understand correctly: do you want the same functionality as DiscountPart but it should apply to every product if the user has a certain role? (i.e. a securable discount content item) Or are you looking for something more specific?

dpomt commented 1 year ago

Yes, that's exactly what I need.