What methods are there to somehow implement some kind of discount structure ? Can we just use rules itself for something like this? Or must you have a module made for this feature?

thanks!

Comments

rfay’s picture

Category: feature » support
Status: Active » Fixed

Please take a look at the options (and screencasts) in http://www.drupalcommerce.org/node/461

patoshi’s picture

great.. just what i was looking for. but what about coupon codes and volume discounts? can rules even do that?

rfay’s picture

Title: Drupal Commerce ability to do discounts just by using rules? » Document volume discounts and special offers (buy one, get one, etc.)
Assigned: Unassigned » rfay
Status: Fixed » Active

For coupons, I guess you want http://drupal.org/project/commerce_coupon

Yeah, I guess we need some more work and documentation in the area of special offers. I haven't mastered that yet.

patoshi’s picture

thanks!... no volume discounts yet =(

rszrama’s picture

Component: User experience » Contributed modules
Assigned: rfay » Unassigned
Status: Active » Postponed

For volume discounts, you can use the condition "Order contains a particular product" to provide a discount based on the number of a particular product in the cart... you could also use an Order Total condition to discount based on the total price of the order. However, offers (such as a buy one get one scenario) must be supported through a contributed module that just doesn't exist yet.

I'll unassign / postpone this, and perhaps someone can come along and reopen this when they write the module later.

1kenthomas’s picture

Ping/subscribing. Just making sure no one has altered the state of this re: volume discounts.

m_wiking’s picture

Anybody know if there is any update to "buy one - get one free"-functionality?

josephsergio’s picture

I am actually looking for something quite similar - 1 for $2, 3 for $5, etc.

Does anyone have any update on this yet?

rtdean93’s picture

I have created a rule for Buy one get one that adds the product to the cart again as a new line item... however, I am trying to use rules to set that new price to zero - or add a discount to the new product which equals the same price.... but the pricing rules are not working.

Any suggestions on changing the price after using the Add Product To Cart action?

davident’s picture

Is there any progress on this front or a solution through Rules?

rszrama’s picture

Kind of in relation to Commerce Kickstart 2.x; you can follow along at http://drupal.org/project/commerce_discount.

bojanz’s picture

Commerce Discount won't be implementing this in the next two months (the team has no time).
Alternative implementations are welcome.

Horroshow’s picture

Buy 1 get 1 free or 2 for 1 promo are easy to do on Magento. I'm sure there's a solution with rules. Help please :-)

Horroshow’s picture

Here's how I want to do a "Buy 1 get 1 free (lesser or equal product is free)" discount with rules.

EVENT
After adding a product to the cart

CONDITIONS
Line item product has term "B1G1F"

ACTIONS
Get total number of items in the cart with term "B1G1F" (ex.: return 5)
Divide total number of items by 2 (ex.: return 2.5)
Get the integer of the previous results using PHP (ex.: return 2)
*Get the 2 lowest priced products in the cart
*Make an addition of price of those 2 products (ex.: $2 + $3 = $5)
*Add discount to the cart for the previous value (ex.: -$5)

What managed to do with actions:
I used "Add a variable" action to get the number of items in the cart
I used "Calculate a value" action to divide the number of items by 2
I used "Execute custom PHP code" action to get the integer with int()
...
All I miss are the last 3 actions of the list. Any idea?

Horroshow’s picture

To get the 2 lowest priced items in the cart what about using PHP? Could be an array, reorder the prices in the array and then get the 2 lowest prices. But I'm not a developer. I would need help to make it happen.

Horroshow’s picture

I'm bad at coding :-) but I think there's an hint here.

To get unit prices in the cart loaded in an array, I would add an action "Add a variable" using PHP eval code:

global $user;
$order = commerce_cart_order_load($user->uid);
$wrapper = entity_metadata_wrapper('commerce_line_item', $line_item);
$unit_price = commerce_price_wrapper_value($wrapper, 'commerce_unit_price', TRUE);
$unit_prices = array(
  'amount' => $unit_price,
  'data' => array(),
);

...then I would need to re-order the value in the array from lowest to highest... and then adds the 2 lowest prices. That would give me a variable that I could use to apply a discount in the cart.

Am I in the right direction?

panditvarun20’s picture

Issue summary: View changes

@rtdean93 I am having same problem Is there any rule will be defined for this?
Actually whenever I want to add to cart my rule add another product of same type but this have problem that It shows the price of free item that should be not to do. So any help will be acceptable. Please help me?

panditvarun20’s picture

Hey Horroshow can you describe comment #14. I want to add a simple rule for buy 2 & get 1 free product. Please help that how can I write rules, If you will write the steps of rules it will be my pleasure.

Please help me

panditvarun20’s picture

Try this one.

Go to store -> Discounts -> Add discounts

Choose discount types-> order discounts

Choose offer types -> Free products

Set Order discount condition & dates.

you are done now. Enjoy

bruiseviolet’s picture

This only works if you want to give a specific item to the customer. However if you have 100 items, and want to offer the customer to buy any 2 items and get a 3rd item of their choice (equal or lesser value- or discount just applied to least expensive item in cart) this does not work. There is a module for Ubercart that will do this, but still searching for one that works with Commerce.

akalata’s picture

bojanz’s picture

Status: Postponed » Closed (outdated)

Confirming #21.