I thought of another idea. Make free_gift a product attribute. Then
make its value the slug of the other item you want to add for free.
When you loop through product attributes in the product template check
if free_gift is an attribute (as of django 1.2 you can use comparison
operators like == in if template tags). If its in there add the item
using the syntax from the quickorder page (you still need to use a
signal to make the price free but this might make it easier to add a
free gift to a product since you just have to add a product
attribute).
The quickorder form is something like this:
<form name="quickorder" method="post" action="{% url
satchmo_quick_order %}">
<input type="text" size="5"
name="qty__{{ product.slug }}" value="1" class="text"
id="id_{{ product.slug }}">
<input type="hidden" name="qty__{{ att.value }}"
value="1" class="text" id="id_qty__{{ att.value }}">
<input type="submit" value='{% trans "Add with Scroll"
%}' onclick= "calc_num();" />
</form><br />
Just another thought, hopefully that wasn't confusing.
-Josh
On Nov 18, 9:54 am, Josh <[email protected]> wrote:
> As far as I know there is nothing like this built in, but I don't know
> too much so don't take my word for it.
>
> I think idea #2 of using signals is probably the right way to approach
> the situation. You could make a model which contains the target
> product and the product[s] to add as gifts, when you get the
> add_complete signal check if one of the target products was added and
> if so add the appropriate gift[s] for free. Since it is in a model it
> won't be very difficult to get it to show up in the admin and you
> should be good to go.
>
> Again there might be a better way but thats what I am thinking.
>
> -Josh
>
> On Nov 16, 2:37 pm, abrg <[email protected]> wrote:
>
> > Hopefully the subject is self-explanatory. Basically, we'd like to
> > create "free gift" products for customers who order certain target
> > products during a specific time frame. Some initial thoughts I've had
> > on how to tackle this:
>
> > 1. Use automatic discounts. The functionality we're after is mostly
> > there, but with a key short-coming - discounts do not allow for
> > associating the discounted products with a target product.
>
> > 2. Use the "satchmo_cart_add_complete" signal to listen for products
> > of a certain type being added to the cart, then append add'l products
> > to the cart with a price of "free"
>
> > 3. Do basically the same thing as #2 but implement it with a
> > ContextProcessor
>
> > We'd want an admin screen (similar to discounts) that allows users to
> > configure target and gift products as well as a start and stop time
> > for the promotion.
>
> > Thus far, I haven't been unable to find any documentation on how to
> > accomplish this with out-of-the-box Satchmo functionality. Am I
> > missing something built-in that would get us the functionality we're
> > looking for with minimal added effort? I'm looking for any feedback
> > from the community on this as I'm really unsure of what the best
> > approach might be.
>
> > Thanks in advance for any help provided!
--
You received this message because you are subscribed to the Google Groups
"Satchmo users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/satchmo-users?hl=en.