Change steps in order process

29 views
Skip to first unread message

Andrey

unread,
Mar 3, 2017, 10:51:14 AM3/3/17
to django-oscar
Hi!

I'm trying to invert steps "shipping address" and "shipping method" in order process. I need this because I have "pick up" shipping method and it's don't need address information. 
First of all I forked checkout app and override IndexView redirect:
class IndexView(CoreIndexView):
    success_url
= reverse_lazy('checkout:shipping-method')

It's worked, but there is a second 302 redirect in logs:
[03/Mar/2017 15:06:32] "GET /checkout/ HTTP/1.1" 302 0
[03/Mar/2017 15:06:32] "GET /checkout/shipping-method/ HTTP/1.1" 302 0
[03/Mar/2017 15:06:32] "GET /checkout/shipping-address/ HTTP/1.1" 200 16329

I found it in get method in class ShippingMethodView:
# Check that shipping address has been completed
if not self.checkout_session.is_shipping_address_set():
    messages
.error(request, _("Please choose a shipping address"))
   
return redirect('checkout:shipping-address')

Okay, I override this function without this condition. But redirect is still working. After some research I found that this method has not been overridden.
If I'm changing original "def get" my idea is working. But it is not good idea to change original oscar code, right?
Why I cant override this method? Maybe there is other way to implement subject?

Thanks!
Reply all
Reply to author
Forward
0 new messages