Promotion: "buy now" instead of "add to basket"

155 views
Skip to first unread message

Joris Vankerschaver

unread,
Mar 26, 2014, 6:25:11 AM3/26/14
to django...@googlegroups.com
Hi guys,

I'm building a store with Oscar (loving the experience so far!) and I'm somewhat stuck on one particular feature that I would like to implement. I have a number of promotions of my home page and I would like to replace the "add to basket" button by one that says "buy now", so that if a user clicks that button, the product is added and he/she is taken immediately to the checkout.

Is there a partial that I could use to replace add_to_basket_form_compact.html, and if not, how should I go about writing a "buy now" partial? 

Thanks for your time and suggestions, and keep up the awesome work,
Joris.

David Winterbottom

unread,
Apr 4, 2014, 4:11:34 PM4/4/14
to django-oscar
On 26 March 2014 10:25, Joris Vankerschaver <joris.van...@gmail.com> wrote:
Hi guys,

I'm building a store with Oscar (loving the experience so far!) and I'm somewhat stuck on one particular feature that I would like to implement. I have a number of promotions of my home page and I would like to replace the "add to basket" button by one that says "buy now", so that if a user clicks that button, the product is added and he/she is taken immediately to the checkout.

Is there a partial that I could use to replace add_to_basket_form_compact.html, and if not, how should I go about writing a "buy now" partial? 

​I think you should be able to modify the add_to_basket_form_compact partial and add a 'next' field which specifies the URL to redirect to. You can see where the basket view decides to redirect to here:

 

Thanks for your time and suggestions, and keep up the awesome work,
Joris.

--
https://github.com/tangentlabs/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-oscar.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-oscar/9bb7bd0e-36dc-4472-8ffe-287113388914%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
David Winterbottom
Technical Director

Tangent Labs
84-86 Great Portland Street
London W1W 7NR
England, UK

Joris Vankerschaver

unread,
Apr 5, 2014, 5:27:49 PM4/5/14
to django...@googlegroups.com

Is there a partial that I could use to replace add_to_basket_form_compact.html, and if not, how should I go about writing a "buy now" partial? 

I think you should be able to modify the add_to_basket_form_compact partial and add a 'next' field which specifies the URL to redirect to. You can see where the basket view decides to redirect to here:


Wonderful, thanks! I ended up subclassing from BasketAddView and overriding get_success_url to do something similar but this looks cleaner and less intrusive.

Thanks again,
Joris
 
Reply all
Reply to author
Forward
0 new messages