A wagtail shop

481 views
Skip to first unread message

James Ramm

unread,
Jan 24, 2017, 4:08:30 AM1/24/17
to Wagtail support
Hi
I have been very impressed by Wagtail CMS and its' 'developer first' approach. Using it feels like both a fully fledged, mature CMS and also a totally non-intrusive app which allows me to just code almost like I am using pure Django when I need to 'break out'.
Thumbs up to the developers. 

As such, I decided to build my e-commerce website using Wagtail. I wasn't completely convinced by the existing Django e-commerce options out there and since my needs are quite 'light weight' (I am a low-volume vendor making & selling audio electronics stuff as hobby outside my day job) I decided to roll my own. This basically amounted to me implementing the following (so far):

- a 'products' app which has the products models. This is the only truly 'wagtail' app, with models which inherit from the wagtail Page
- a 'basket' app, which offers a regular django model for basket items. I wanted my 'basket' display to be a dynamic modal popup, so I wrote it as essentially a rest api and used react.js on the front end. Since wagtail expects you to take full control of your front end, this was more than easy to integrate.
- a 'checkout' app, which goes hand in hand with the basket app and essentially just provides an interface to the backend payment gateway
- a 'shipping' app. Just a simple model to set different shipping rates
- an 'orders' app. Obviously, this keeps track of orders. Despite writing as a regular django model, I was able to use the excellent ModelAdmin to have a fully fledged 'Orders' interface on the Wagtail admin. 

A very early, alpha version of the site I am building is here:


There is still much work to do and I have a couple of questions. 
Specifically I would like to override the template used for the Orders in the wagtail ModelAdmin. I think I gathered that this is possible, but there are a couple of areas I am not sure about:

- What context is passed in to the template (or do I need to write my own view and provide the context)?
- The orders model (a standard django model) has some foreign key relationships - is it possible to display these, or will I need to provide the context (as above)?
- Can I add custom javascript somehow? I.e. I would like to include a 'fufill' button for each order which will edit the order model (to 'fufill it')


I will happily open source the shop code if anyone thinks it will be interesting. I have written it to allow you to provide your own product model(s), payment backends and other customisations. I will also happily open source the react apps for the shopping basket and checkout if anyone would find it useful.

Alex House

unread,
Feb 1, 2017, 8:52:34 PM2/1/17
to Wagtail support
Hi. I myself have faced this problem. This is an interesting project. I am ready to take part in it.
The idea to make a separate application, which will be responsible for the shopping cart, catalog and ordering.

вторник, 24 января 2017 г., 19:08:30 UTC+10 пользователь James Ramm написал:

James Ramm

unread,
Feb 3, 2017, 5:39:42 AM2/3/17
to Wagtail support

I have separated out the shop apps and pushed it to github here:


There is a lot of work to do before it can be considered releasable. I havent yet tested it as a reusable app, so my next port of call will be to update my website configuration to use this instead and check it is all still working. 

James Ramm

unread,
Apr 13, 2017, 5:03:10 AM4/13/17
to Wagtail support
Hi
Small update on the development of this app. I'm happy to say the first release of Longclaw has been made available via pypi. 
There is also a demo site available here: https://github.com/JamesRamm/longclaw_demo


James Ramm

unread,
Aug 25, 2017, 4:13:27 AM8/25/17
to Wagtail support
Hallo!

I just released Longclaw v0.2.0. (Longclaw is e-commerce for Wagtail). 
Major features we have worked on include improving the checkout views & integration with payment gateways and adding a client JS library for the longclaw API. 
The next release is planned to be the first major release - 1.0!
We will be overhauling the products app to increase customisation and adding more admin functionality. 
All contributions welcome!


Reply all
Reply to author
Forward
0 new messages