matthiask / plata

Plata - the lean and mean Django-based Shop
https://plata-django-shop.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
197 stars 63 forks source link

The option to choose between shipping methods #31

Open Uznick opened 11 years ago

Uznick commented 11 years ago

Is there such option in Plata?

I've grepped through the code, and found a field "shipping_method" in the Order model, but I did not find where it is set.

The use case is simple: the user can choose between several shipping methods with different costs, and after that, the costs are added to the bill.

matthiask commented 11 years ago

While Plata does come with the infrastructure to plug in your own shipping backends, it's not of very much help. It definitely is possible, but there's some work involved.

What you have to do is this:

That's it! Just ask if you have additional questions or need some guidance.

Uznick commented 11 years ago

Thanks!

And can I modify a form in the checkout process? It's not pluggable, as I can see.

Just override the /shop/checkout/ url with my own view and do there what ever i need?

matthiask commented 11 years ago

The official way would be to subclass the plata.shop.views.Shop class, override a few methods (for example discounts_form or checkout_form), and use this instead of the standard Shop class for inclusion into the URLconf.

class MyShop(Shop):
    def checkout_form(...):
        # return XYzzyForm

shop_views = MyShop(Order, ...)

urlpatterns = patterns(
    urL(r'^shop/', include(shop_views.urls)),
)

Hope it helps!

flaiming commented 7 years ago

I was solving just that, you can found it here: https://github.com/Draciinfo/calendar-eshop/blob/master/calendareshop/shopping/forms.py Go for shopping.views.py for view implementation.