I have a rule on my site that automatically gives users that have a certain role a 10% discount on all items. I have implemented this using the action "Multiply the unit price by some amount" for each commerce line item. Before installing Commerce Sale Price, I had this rule configured to multiply the "Base price" (under "Price Component Type") by "0.9."

However, after installing and configuring Commerce Sale Price, I now need to apply the 10% discount to the sale price, not the base price. However, under "Price Component Type" in rules, I am only able to select from "Discount" "Fee" or "Fixed coupon." (I am using coupons on my site.) I tried the other options but they appear not to affect the price at all for products to which sales prices have been assigned.

So, it would be great to be able to select the "Sale price" in the "Price Component Type" field in Rules to solve issues like this.

Comments

ptmkenny’s picture

Category: feature » support
Status: Active » Fixed

Upon taking a closer look, I realized I can do this by modifying the "Sales price (Rules component)" provided by the module.

I simply created a new rules component (of type Rule) and added it as the last action of the Sales price component. This component has a condition that checks whether the current user has the applicable role and then sets the unit price (provided as a parameter) to return $value * 0.9 using the PHP evaluation.

Solved!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.