FAQ
Hi all, Spree is an awesome framework.

I am a spree beginner and I'm looking for an extension that supports
different discounts to different variants of a product on a promotion. For
example, there is a T-shirt, which has a variant with red color and another
one with blue color, I want to assign a 30% discount to the red and 20% to
the blue. Is there any existed extension can do this? If not, can you
provide some tips?

Thank you!

--
Don't miss SpreeConf on May 20-21: http://spreeconf.com
Spree is hiring: http://spreecommerce.com/careers

Search Discussions

  • Zach Karpinski at May 17, 2013 at 2:58 pm
    As far as official extensions I am pretty sure you could do this with
    spree_volume_pricing. You'd have to be willing to accept some caveats/bugs
    about properly displaying the price. I know it allows you to define
    discount tables on a per variant basis. If you do not intend to offer
    volume discounts you would only define one range and set that to be the
    discount you would like.

    Since I am not using this extension I am unsure how well it works in
    1-3-stable. The build indicator on it's github page indicates failure. The
    bugs I referred to involve incorrectly price displays on some order line
    item areas. It also does not seem to like it when your quantity discount
    starts at one. If these problems were fixed it may be a good choice.

    If you're willing to try an extension that is still under development, has
    no tests right now and isn't being used in production then there is another
    option. My own volume discount system also does pricing on a per variant
    basis. The biggest difference is that the pricing schedules are defined
    outside of the product admin and have a more simple quantity/discount entry
    system. It also makes a point to display the list price in the product
    properties area so there is an indicator that the price is lower for each
    variant. The above concerns with the official extension are not present in
    the one I am working on https://github.com/zkarpinski/spree_volume_discounts

    I tried to figure out if you could do this with the normal promotion system
    but ran into a problem with the product dropdown for that rule. I assume
    it always uses the master variant?
    On Friday, May 17, 2013 3:06:54 AM UTC-5, Martin Hong wrote:

    Hi all, Spree is an awesome framework.

    I am a spree beginner and I'm looking for an extension that supports
    different discounts to different variants of a product on a promotion. For
    example, there is a T-shirt, which has a variant with red color and another
    one with blue color, I want to assign a 30% discount to the red and 20% to
    the blue. Is there any existed extension can do this? If not, can you
    provide some tips?

    Thank you!
    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers
  • Martin Hong at May 17, 2013 at 6:07 pm
    Thanks Zach, but I don't need a volume prices or discounts right now. I
    just want to make it able to assign different discounts to variants, which
    should not be dependent on selected
    quantities of line items. I don't know whether it is a good idea to add a
    new field named 'discount' to the existed model Spree::Variant and then
    implement a calculator to calculate total
    adjustments through this field? Besides, I will override the default
    variant edit page to enable the admin to set detailed discounts.

    在 2013年5月17日星期五UTC+8下午10时58分08秒,Zach Karpinski写道:
    As far as official extensions I am pretty sure you could do this with
    spree_volume_pricing. You'd have to be willing to accept some caveats/bugs
    about properly displaying the price. I know it allows you to define
    discount tables on a per variant basis. If you do not intend to offer
    volume discounts you would only define one range and set that to be the
    discount you would like.

    Since I am not using this extension I am unsure how well it works in
    1-3-stable. The build indicator on it's github page indicates failure. The
    bugs I referred to involve incorrectly price displays on some order line
    item areas. It also does not seem to like it when your quantity discount
    starts at one. If these problems were fixed it may be a good choice.

    If you're willing to try an extension that is still under development, has
    no tests right now and isn't being used in production then there is another
    option. My own volume discount system also does pricing on a per variant
    basis. The biggest difference is that the pricing schedules are defined
    outside of the product admin and have a more simple quantity/discount entry
    system. It also makes a point to display the list price in the product
    properties area so there is an indicator that the price is lower for each
    variant. The above concerns with the official extension are not present in
    the one I am working on
    https://github.com/zkarpinski/spree_volume_discounts

    I tried to figure out if you could do this with the normal promotion
    system but ran into a problem with the product dropdown for that rule. I
    assume it always uses the master variant?
    On Friday, May 17, 2013 3:06:54 AM UTC-5, Martin Hong wrote:

    Hi all, Spree is an awesome framework.

    I am a spree beginner and I'm looking for an extension that supports
    different discounts to different variants of a product on a promotion. For
    example, there is a T-shirt, which has a variant with red color and another
    one with blue color, I want to assign a 30% discount to the red and 20% to
    the blue. Is there any existed extension can do this? If not, can you
    provide some tips?

    Thank you!
    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers
  • Zach Karpinski at May 17, 2013 at 6:16 pm
    Have you considered just making a new Promotion Rule that uses variants
    instead of products? Take a look here:
    https://github.com/spree/spree/blob/1-3-stable/promo/app/models/spree/promotion/rules/product.rb

    Copying that and updating it to use variants seems like a pretty straight
    forward exercise. This method lets you avoid worrying about migrations or
    overriding the admin forms for variants etc...
    On Friday, May 17, 2013 1:07:22 PM UTC-5, Martin Hong wrote:

    Thanks Zach, but I don't need a volume prices or discounts right now. I
    just want to make it able to assign different discounts to variants, which
    should not be dependent on selected
    quantities of line items. I don't know whether it is a good idea to add a
    new field named 'discount' to the existed model Spree::Variant and then
    implement a calculator to calculate total
    adjustments through this field? Besides, I will override the default
    variant edit page to enable the admin to set detailed discounts.
    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers
  • Martin Hong at May 18, 2013 at 1:19 am
    Looks like a good idea. But I still have a question: If I make a new
    Promotion Rule that uses variants and want to achieve the goal of different
    discounts, do I need to create some promotions so that I can create
    different adjustments?

    在 2013年5月18日星期六UTC+8上午2时16分23秒,Zach Karpinski写道:
    Have you considered just making a new Promotion Rule that uses variants
    instead of products? Take a look here:

    https://github.com/spree/spree/blob/1-3-stable/promo/app/models/spree/promotion/rules/product.rb

    Copying that and updating it to use variants seems like a pretty straight
    forward exercise. This method lets you avoid worrying about migrations or
    overriding the admin forms for variants etc...
    On Friday, May 17, 2013 1:07:22 PM UTC-5, Martin Hong wrote:

    Thanks Zach, but I don't need a volume prices or discounts right now. I
    just want to make it able to assign different discounts to variants, which
    should not be dependent on selected
    quantities of line items. I don't know whether it is a good idea to add a
    new field named 'discount' to the existed model Spree::Variant and then
    implement a calculator to calculate total
    adjustments through this field? Besides, I will override the default
    variant edit page to enable the admin to set detailed discounts.
    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers
  • Zach Karpinski at May 18, 2013 at 1:12 pm
    Yes, you'd have to make a promotion for each percentage off that you'd like
    to make available. You would then add the appropriate variant(s) to each
    of those promotions.

    For your original example you would have two promotions. One would be
    for 30% off and have the red shirt variant the other 20% off and contain
    the blue shirt variant.
    On Friday, May 17, 2013, Martin Hong wrote:

    Looks like a good idea. But I still have a question: If I make a new
    Promotion Rule that uses variants and want to achieve the goal of different
    discounts, do I need to create some promotions so that I can create
    different adjustments?

    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers
  • Martin Hong at May 18, 2013 at 4:46 pm
    I think your solution might make admins of a spree site confused. Standing
    on the user's perspective, it's hard to explain why different promotions is
    needed. It's more direct that just one promotion needed to create and able
    to assign discounts within a same promotion.

    在 2013年5月18日星期六UTC+8下午9时12分33秒,Zach Karpinski写道:
    Yes, you'd have to make a promotion for each percentage off that you'd
    like to make available. You would then add the appropriate variant(s) to
    each of those promotions.

    For your original example you would have two promotions. One would be
    for 30% off and have the red shirt variant the other 20% off and contain
    the blue shirt variant.
    On Friday, May 17, 2013, Martin Hong wrote:

    Looks like a good idea. But I still have a question: If I make a new
    Promotion Rule that uses variants and want to achieve the goal of different
    discounts, do I need to create some promotions so that I can create
    different adjustments?

    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedMay 17, '13 at 8:06a
activeMay 18, '13 at 4:46p
posts7
users2
websitespreecommerce.com
irc#RubyOnRails

2 users in discussion

Martin Hong: 4 posts Zach Karpinski: 3 posts

People

Translate

site design / logo © 2022 Grokbase