Hello,

I wanted to ask, instead of adding a new plugin for Promotions, why did you create this module? Seems to me that the two modules overlap in functionality. Is it possible to add the variation conditions to the Promotions module as a plugin? What do you think? Or is this module provides some functionality that cannot be achieved with Promotions?

Comments

Sinan Erdem created an issue. See original summary.

krystalcode’s picture

Status: Active » Closed (works as designed)

Hi Sinan Erdem,

Thanks for the comments and the question. Promotions apply the price change as a discount on the order. The product base price stays the same but you apply a discount on the order subtotal. This module changes the base price as displayed to the customer, so when you go the product page you would see a personalised price based on the price rules.

It's essentially a more generic alternative to the commerce_pricelist Drupal 7 module. I'll be updating the page description with details soon.

Sinan Erdem’s picture

Hi krystalcode,

Thank you for your prompt answer.

Can we go on a scenario to better understand? For example:

I have a product that has a bace price of $100.
I have discount of %10 for VIP customers.
I have a coupon code of %15 discount.
I have a general discount of %20 for all products.

Where do you suggest we should use Price Rule and Promotions?

Price rule: %20 for all products.
Price rule: %10 for certain customers, certain products.
Promotion: Coupon %15

Should it be like that? If we do that, will the coupon be calculated from a price of $70?

krystalcode’s picture

Regarding the choice between using promotions or price rules, at the end of the day you'd decide based on the desired user experience:

- If you want to change the price displayed to the user everywhere on the site, without the user having to add a coupon and without knowing what has affected the price (unless you implement something yourself for letting them know), then use price rules. You can additionally apply promotions/coupons on top of the changed price, as in your scenario.

- If you want to display the original product prices everywhere on the site, and only on the cart/checkout pages apply a change to the order subtotal via coupons, then use promotions.

Further explanations to understand your scenario. Price rules can be prioritised. At the moment there is no compatibility between rules - the one with the highest priority will be applied, and that's the final price. There is an issue to add compatibility configuration i.e. to allow applying more than one rule, one on top of another (https://www.drupal.org/node/2900174).

In your scenario, and if you have prioritised the %20 rule 1st and the %10 rule 2nd, all customers will get a %20 discount i.e. the product price will be $80. If they apply the coupon, they will get an extra %15 off at the cart/checkout pages. Since the 1st rule applies to all customers, the 2nd rule will never be evaluated.

To achieve the %30 off for certain users/certain products, right now you would have to create a %30 rule and prioritise it 1st. And the %20 price rule for all customers 2nd. So, certain users/products will get %30 off, and the product price before the coupon will be $70. The rest will not meet the conditions and fall back to the 2nd rule and the product price before the coupon will be $80.

I hope it makes sense. You can voice your interest for configuring compatibility between price rules in the issue that I mentioned (https://www.drupal.org/node/2900174). Please note that due to the explanation above, when that issue is implemented you may need to reconfigure your rules - take this into account when upgrading if you start using the module now, the module is very new and there may be such changes at least until it reaches a release candidate. So, keep an eye on the issue queue.

krystalcode’s picture

Is it possible to add the variation conditions to the Promotions module as a plugin?

Yes, if you're a coder it should not be difficult to do it in a custom module. Have a look at the commerce/modules/product/src/Plugin/Commerce/Condition/OrderItemProduct.php file to get started.

You may not need price rules if promotions do the job for you, you can add your own custom conditions.

Sinan Erdem’s picture

Hello krystalcode,

Thank you for the explanation. It is much more clear now. We will experiment more on these.