FAQ
Hello everyone,


I am using Spree 1-3-stable in a restaurant web store in Brazil
(store.bullmarket.com.br) and I need to create a custom promotion with the
following rule (after 10th order the client will be eligible to receive a
meal for free). I am open to receive suggestion about how to implement it
in the very best way.


Thank you very much,

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

Search Discussions

  • Michael Bianco at May 13, 2013 at 1:54 pm
    Giulliano,

    Take a look at existing rules in the spree code base as an
    example: https://github.com/spree/spree/blob/master/core/app/models/spree/promotion/rules/first_order.rb

    What you are trying to do isn't too tricky, in the `eligible?` method you
    would just have to look through `order.user.orders` and check for 10
    completed orders.

    - Mike
    On Saturday, May 11, 2013 10:57:52 PM UTC-4, Giulliano Bueno wrote:

    Hello everyone,


    I am using Spree 1-3-stable in a restaurant web store in Brazil (
    store.bullmarket.com.br) and I need to create a custom promotion with the
    following rule (after 10th order the client will be eligible to receive a
    meal for free). I am open to receive suggestion about how to implement it
    in the very best way.


    Thank you very much,
    --
    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 12, '13 at 2:57a
activeMay 13, '13 at 1:54p
posts2
users2
websitespreecommerce.com
irc#RubyOnRails

2 users in discussion

Giulliano Bueno: 1 post Michael Bianco: 1 post

People

Translate

site design / logo © 2022 Grokbase