Bob,
I'm thinking thought 1 is closer to what I was trying to do. The hard part
here to putting it in the template is the slightly limited template
language.
I was thinking I could do:
for title in CartItem.product.category.all()
ifequal title "one of my three qualifying categories"
show the white glove option
endifequal
endfor
But that could possibly show multiple copies of that form. I would then
need to break out of that loop. (Still trying to find out if that can be
one in django which I don't believe so).
I'm very intrigued by your second thought and it sounds MUCH cleaner. I
just have no clue how to set that up. But thats what google and django-docs
are for I guess.
I'll let you know what I come up with.
Thanks
On Tue, Oct 27, 2009 at 7:43 AM, Bob Waycott <[email protected]> wrote:
> Ryan,
>
> Thought 1:
>
> If you are wanting it to show up at the standard shipping choices spot,
> can't you just modify the template itself to check
> CartItem.product.category.all() and, if one of the categories is your
> special category, show the white glove option?
>
> Thought 2:
>
> Create a simple context processor that performs the same check while
> someone is shopping. This context processor would execute
> Cart.from_request() to get the current cart, then loop through CartItems to
> see if each item's product.category.all() contained your white glove
> category. If True, your context processor could set a simple
> request.session['white_glove'] = True. Then, in your template, you could
> have a simpler block like:
>
> {% if request.session.white_glove %}
> [white glove option code]
> {% endif %}
>
> Just my two thoughts ...
>
> Bob
>
>
> On Mon, Oct 26, 2009 at 11:26 PM, lifewithryan <[email protected]>wrote:
>
>> I assume that I can instead query the product category? Again if the
>> customer buys more than one product, if one of those product is in the
>> qualifying category I need to show the white glove option as a selection. I
>> think I see where you are going with this. Worth a look...
>>
>> Would be easier I think to just be able to hide the white glove option if
>> the cart doesn't contain a qualifying item though... Kind of thought that is
>> what the tiered shipping was all about
>>
>>
>>
>> Sent from my iPod
>>
>> On Oct 26, 2009, at 9:08 PM, Chris Moffitt <[email protected]> wrote:
>>
>> You can create a custom shipping module to do this. If you look at an
>> existing shipping module, you'll see that there is a "valid" method. You can
>> query the order total and if it meets your dollar threshold, you can return
>> True and the user will have the option to select the "White Glove" option.
>>
>>
>> -Chris
>>
>> On Mon, Oct 26, 2009 at 4:20 PM, lifewithryan < <[email protected]>
>> [email protected]> wrote:
>>
>>>
>>> We have to ways to ship, both added via the tired shipping and
>>> carriers configuration.
>>>
>>> 1) free shipping
>>> 2) $200 white glove shipping
>>>
>>> We only want to offer the white glove shipping on the big ticket
>>> items. Thinks like accessories and parts will be free shipping (for
>>> now)
>>>
>>> is there a to configure this or am I forced into writing a template
>>> tag that checks the cart to see if there are any products that qualify
>>> for the $200 white glove shipping and if so, show that option along
>>> with the free shipping option?
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>
> >
>
--
http://www.sudovi.com/
http://www.twitter.com/lifewithryan
http://www.thecommontongue.com
http://www.lifewithryan.com/
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---