Drupal Commerce Basic Discount
Discounts in Drupal Commerce
- Create a discount using a rule
- Create a weekend (date-based) sale discount using a rule
- Create a tag-based weekend sale discount using a rule
An example of a simple discount: You want to take 10% off everything in your store until further notice.
- Go to Store -> Configuration -> Product Pricing Rules
- Click "Add a pricing rule"
- Give your rule a name
- Under "Actions" click "Add Action"
- Under "Commmerce Line Item" choose "Multiply the Unit Price by Some Amount"
- The data selector should be "line_item"
- The amount should be .9 (in other words, multiply the price by .9).
- Now all products have 10% taken off of them.
Simple Discount using the VAT Hack
The problem with simple product pricing rules is that there's currently no way to actually show why the prices are what they are. We'll eventually have more options here. But right now, you can accomplish what we just did using negative VAT. VAT is, of course, a tax which is included in a product price normally, but there's not much difference between that and a discount... but a discount is a negative tax.
- Go to Store -> Configuration -> Taxes -> Tax Types
- Create a new tax type of "Discount".
- Give it a title
- Check "Display taxes of this type inclusive in product prices".
- Go to Store -> Configuration -> Taxes -> Tax Rates
- Add a tax rate - give it a name and a tax rate of -0.10
- Under type, choose the type that you created above.
- Visit "Cart" and you'll see that the discount is being taken.
- Visit the checkout page and you'll see that the discount is explained and accounted for in the subtotal.