2

I need to have different order total discount rates in % for each customers. The default discount is 10% for all users and it need to be override for certain users too. i.e administrator can set the different discounts such as 12% for user1 and 15% discount for user2 etc on a specific interval (between valid from and to dates). Is it possible using rules or custom module?

Please help.

3

Yes, Rajeesh, anything is possible with Rules. : P

In this case, I'd recommend something like a discount percentage field on user profiles that defaults to 10% and is only visible to administrators who can then override the field value on a user-by-user basis. Your product pricing rule can then look for this field to have a value on the order's user (i.e. use commerce-line-item:commerce-order:owner as the token, not the site:current-user) and then apply it as a discount using the appropriate line item action.

|improve this answer|||||
0

Can you try using commerce discount module which supports dates as well as users... See screenshot below of Create Discount Form..

Provides a user-friendly UI for managing discounts. The discounts are exportable entities based on which the discount rules are generated.

Contains two submodules:

commerce_discount_date: Allows limiting discount validity by date, requires the Date module. commerce_discount_usage: Allows limiting discount validity by number of uses (as of alpha1, still needs work!).

enter image description here

|improve this answer|||||
  • I tried commerce discount module but using this module we can set one Order discount to one User only. If we have 100 users and different discounts we need to create 100 rules. But administrator is asking for another form . What he wants is Select user from a list box and add Discount rate, select Discount dates and Save discount. – Rejeesh Rajan Apr 21 '14 at 7:37
0

Thanks @Ryan Szrama, the product pricing rule and user account new field 'field_vip_disc_perc' worked for me. Now I can override the discount field integer value of each user and gets it deducted from the order total as discount percentage value. In pricing rule event 'Calculating the sell price of a product' I added the action "Multiply the unit price by some amount" for Data Selector 'commerce_line_item' with the Amount 'field-vip-disc-perc'. To get the discount percentage deducted from order total, I added the PHP evaluation return value, $value = 1-($value/100); return $value; which is applied to the Price component type Discount.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.