Hi All
We use price rules to override prices by product and quantity. All prices and pricerules are set on the virtual product. Is there a simple way to count/sum the quantity of different variants to get the overridden price? Simple example: virtual: hat variant 1: red-hat variant 2: yellow-hat If the customer puts a red and a yellow hat to the cart, the price_rule for qty >= 2 should be used. Regards Greg |
Either you need to add all variant products in the rule or you need to
setup a category specific to price rule add virtual product in it and finally link that virtual product to category. These are the two possible solution to your problem. Rishi Solanki Manager, Enterprise Software Development HotWax Media Pvt. Ltd. Direct: +91-9893287847 http://www.hotwaxmedia.com On Sat, May 25, 2013 at 3:22 AM, greg jocher <[hidden email]> wrote: > Hi All > > We use price rules to override prices by product and quantity. > All prices and pricerules are set on the virtual product. > > Is there a simple way to count/sum the quantity of different variants to > get the overridden price? > > Simple example: > > virtual: hat > variant 1: red-hat > variant 2: yellow-hat > > If the customer puts a red and a yellow hat to the cart, the price_rule > for qty >= 2 should be used. > > Regards > Greg > > > > > |
Hi all
and thank you for your answer Rishi. I think, the first way (assign variants to price_rules) will cause performance problems: We have products with more than a thousand variants. So, I gave the category way a try yesterday, but it seems, that this way do not calculate the price like we need it. The price rule (qty >= 2) was activated if I added 2 yellow hats or 2 red hats to the cart, but not, if I added one of each variant. I have done the following: Created a category (type: internal) Added a price_rule with shopid==XX and categoryid==XX and a price override action. Then I tested with the following category members: 1. virtual and variants 2. virtual only 3. variants only Example: Hat price = 10$ Qty >= 2, action: Price = 9$ Result of calculated Prices: 1 yellow + 1 red = 20$ 2 yellow = 18$ How we need it: 1 yellow + 1 red = 18$ 2 yellow = 18$ Where is my fault? Regards Greg On 05/25/2013 10:11 AM, Rishi Solanki wrote: > Either you need to add all variant products in the rule or you need to > setup a category specific to price rule add virtual product in it and > finally link that virtual product to category. > > These are the two possible solution to your problem. > > Rishi Solanki > Manager, Enterprise Software Development > HotWax Media Pvt. Ltd. > Direct: +91-9893287847 > http://www.hotwaxmedia.com > > > On Sat, May 25, 2013 at 3:22 AM, greg jocher<[hidden email]> wrote: > >> Hi All >> >> We use price rules to override prices by product and quantity. >> All prices and pricerules are set on the virtual product. >> >> Is there a simple way to count/sum the quantity of different variants to >> get the overridden price? >> >> Simple example: >> >> virtual: hat >> variant 1: red-hat >> variant 2: yellow-hat >> >> If the customer puts a red and a yellow hat to the cart, the price_rule >> for qty >= 2 should be used. >> >> Regards >> Greg >> >> >> >> >> |
Greg,
There are two issues using the price Rules engine in trying to resolve this: 1. The Quantity Price Product rule (PRIP_PRODUCT_ID) does not consider the virtual product when the variant product id is added to the cart. Therefore the quantity comparison is not even checked. 2. The Price engine does not sum the 'quantity' in the cart for either the virtual or the variant product. It is simply comparing the quantity entered on each cart line against the quantity break rule. This logic works with 'Finished goods' since there can only be 1 cart line in the cart per product (Finished Good). For example if you add Product 'Finished_Good_A' with a quantity of '2' and then again add the same Finished_Good_A with a quantity of '3' the shopping cart would contain 1 cart line with Finished_Good_A and a quantity of '5'. Since variant products are added to the cart on separate cart lines the Price Rule Engine Quantity break rules do NOT work. I have a similar issue and instead of using the Price Rules Engine I am trying to resolve using the Promotion Engine. The Promotion Engine does sum the 'quantity in the cart' as well honors the virtual/variant relationship. Using your example: o Hat price = 10$ o Qty >= 2, action: Price = 9$ Promotion Engine Rules: o Condition: o Cart-Sub Total is > 0 o Action: o X Quantity for Y Discount o Quantity: 2 Amount: 1.00 o Product Include: Virtual Hat Add the following to the cart: o 1 Quantity of yellow hat (variant) o 1 Quantity of red hat (variant) Cart Results o 1 Yellow Hat price of $9.00 o 1 Red Hat price of $9.00 I understand this seems like the solution, however in my testing, I have found the Quantity on the 'Action' rule acts as 'equal to' or a 'minimum'. In my example above all works fine when a sum of quantity for the variant product is '2'. However if the sum of quantity was '3' then only 2 of the 3 products get the discount. Cart Results o 2 Yellow Hat price of $9.00 o 1 Red Hat price of $10.00 I have not noticed a way in the promotion engine to provide a 'range' of quantity in providing the discount. Len -----Original Message----- From: greg jocher [mailto:[hidden email]] Sent: Monday, May 27, 2013 2:07 AM To: [hidden email] Subject: Re: virtual/variants price rules / calculation Hi all and thank you for your answer Rishi. I think, the first way (assign variants to price_rules) will cause performance problems: We have products with more than a thousand variants. So, I gave the category way a try yesterday, but it seems, that this way do not calculate the price like we need it. The price rule (qty >= 2) was activated if I added 2 yellow hats or 2 red hats to the cart, but not, if I added one of each variant. I have done the following: Created a category (type: internal) Added a price_rule with shopid==XX and categoryid==XX and a price override action. Then I tested with the following category members: 1. virtual and variants 2. virtual only 3. variants only Example: Hat price = 10$ Qty >= 2, action: Price = 9$ Result of calculated Prices: 1 yellow + 1 red = 20$ 2 yellow = 18$ How we need it: 1 yellow + 1 red = 18$ 2 yellow = 18$ Where is my fault? Regards Greg On 05/25/2013 10:11 AM, Rishi Solanki wrote: > Either you need to add all variant products in the rule or you need to > setup a category specific to price rule add virtual product in it and > finally link that virtual product to category. > > These are the two possible solution to your problem. > > Rishi Solanki > Manager, Enterprise Software Development > HotWax Media Pvt. Ltd. > Direct: +91-9893287847 > http://www.hotwaxmedia.com > > > On Sat, May 25, 2013 at 3:22 AM, greg jocher<[hidden email]> wrote: > >> Hi All >> >> We use price rules to override prices by product and quantity. >> All prices and pricerules are set on the virtual product. >> >> Is there a simple way to count/sum the quantity of different variants to >> get the overridden price? >> >> Simple example: >> >> virtual: hat >> variant 1: red-hat >> variant 2: yellow-hat >> >> If the customer puts a red and a yellow hat to the cart, the price_rule >> for qty >= 2 should be used. >> >> Regards >> Greg >> >> >> >> >> |
Hi Len
Many thanks for your detailed explanation. Issues: 1. There are two options (we are using the patch, sorry I forgot about that): 1. use patch from: https://issues.apache.org/jira/browse/OFBIZ-5123 2. use PRIP_PROD_CAT_ID (create a category for each rule and assign all variants to it) 2. You are right: a bug or a feature? Promo rules: We have taken a look to promo rules, but decided to use it only for promotions. Meanwhile, I have started changing the ShoppingCartItem implementation to sum the quantity of variants before price calculation. But this needs some more testing - let me know if you are interested. Best regards Greg On 05/28/2013 05:40 PM, Len Shein wrote: > Greg, > > There are two issues using the price Rules engine in trying to resolve this: > > 1. The Quantity Price Product rule (PRIP_PRODUCT_ID) does not consider the > virtual product when the variant product id is added to the cart. Therefore > the quantity comparison is not even checked. > > 2. The Price engine does not sum the 'quantity' in the cart for either the > virtual or the variant product. It is simply comparing the quantity entered > on each cart line against the quantity break rule. This logic works with > 'Finished goods' since there can only be 1 cart line in the cart per product > (Finished Good). For example if you add Product 'Finished_Good_A' with a > quantity of '2' and then again add the same Finished_Good_A with a quantity > of '3' the shopping cart would contain 1 cart line with Finished_Good_A and > a quantity of '5'. Since variant products are added to the cart on > separate cart lines the Price Rule Engine Quantity break rules do NOT work. > > > > I have a similar issue and instead of using the Price Rules Engine I am > trying to resolve using the Promotion Engine. The Promotion Engine does sum > the 'quantity in the cart' as well honors the virtual/variant relationship. > > Using your example: > > > > o Hat price = 10$ > > o Qty >= 2, action: Price = 9$ > > > > Promotion Engine Rules: > > o Condition: > > o Cart-Sub Total is > 0 > > o Action: > > o X Quantity for Y Discount > > o Quantity: 2 Amount: 1.00 > > o Product Include: Virtual Hat > > > > Add the following to the cart: > > o 1 Quantity of yellow hat (variant) > > o 1 Quantity of red hat (variant) > > > > Cart Results > > o 1 Yellow Hat price of $9.00 > > o 1 Red Hat price of $9.00 > > > > I understand this seems like the solution, however in my testing, I have > found the Quantity on the 'Action' rule acts as 'equal to' or a 'minimum'. > In my example above all works fine when a sum of quantity for the variant > product is '2'. However if the sum of quantity was '3' then only 2 of the 3 > products get the discount. > > > > Cart Results > > o 2 Yellow Hat price of $9.00 > > o 1 Red Hat price of $10.00 > > > > > > I have not noticed a way in the promotion engine to provide a 'range' of > quantity in providing the discount. > > > > Len > > |
The second options suggested by Greg is best way to go.
Thanks and Regards Anil Patel Hotwax Media Inc http://www.hotwaxmedia.com/ ApacheCon US 2013 Gold Sponsor http://na.apachecon.com/sponsors/ On May 29, 2013, at 5:03 AM, greg jocher <[hidden email]> wrote: > Hi Len > > Many thanks for your detailed explanation. > > Issues: > > 1. There are two options (we are using the patch, sorry I forgot about > that): > 1. use patch from: https://issues.apache.org/jira/browse/OFBIZ-5123 > 2. use PRIP_PROD_CAT_ID (create a category for each rule and assign > all variants to it) > 2. You are right: a bug or a feature? > > Promo rules: > We have taken a look to promo rules, but decided to use it only for promotions. > > Meanwhile, I have started changing the ShoppingCartItem implementation to sum the quantity of variants before price calculation. > But this needs some more testing - let me know if you are interested. > > > Best regards > Greg > > > > > > On 05/28/2013 05:40 PM, Len Shein wrote: >> Greg, >> >> There are two issues using the price Rules engine in trying to resolve this: >> >> 1. The Quantity Price Product rule (PRIP_PRODUCT_ID) does not consider the >> virtual product when the variant product id is added to the cart. Therefore >> the quantity comparison is not even checked. >> >> 2. The Price engine does not sum the 'quantity' in the cart for either the >> virtual or the variant product. It is simply comparing the quantity entered >> on each cart line against the quantity break rule. This logic works with >> 'Finished goods' since there can only be 1 cart line in the cart per product >> (Finished Good). For example if you add Product 'Finished_Good_A' with a >> quantity of '2' and then again add the same Finished_Good_A with a quantity >> of '3' the shopping cart would contain 1 cart line with Finished_Good_A and >> a quantity of '5'. Since variant products are added to the cart on >> separate cart lines the Price Rule Engine Quantity break rules do NOT work. >> >> >> I have a similar issue and instead of using the Price Rules Engine I am >> trying to resolve using the Promotion Engine. The Promotion Engine does sum >> the 'quantity in the cart' as well honors the virtual/variant relationship. >> >> Using your example: >> >> >> o Hat price = 10$ >> >> o Qty >= 2, action: Price = 9$ >> >> >> Promotion Engine Rules: >> >> o Condition: >> >> o Cart-Sub Total is > 0 >> >> o Action: >> >> o X Quantity for Y Discount >> >> o Quantity: 2 Amount: 1.00 >> >> o Product Include: Virtual Hat >> >> >> Add the following to the cart: >> >> o 1 Quantity of yellow hat (variant) >> >> o 1 Quantity of red hat (variant) >> >> >> Cart Results >> >> o 1 Yellow Hat price of $9.00 >> >> o 1 Red Hat price of $9.00 >> >> >> I understand this seems like the solution, however in my testing, I have >> found the Quantity on the 'Action' rule acts as 'equal to' or a 'minimum'. >> In my example above all works fine when a sum of quantity for the variant >> product is '2'. However if the sum of quantity was '3' then only 2 of the 3 >> products get the discount. >> >> >> Cart Results >> >> o 2 Yellow Hat price of $9.00 >> >> o 1 Red Hat price of $10.00 >> >> >> >> I have not noticed a way in the promotion engine to provide a 'range' of >> quantity in providing the discount. >> >> >> Len >> >> |
Free forum by Nabble | Edit this page |