As discussed on Minimal e-shop for Tryton it makes sense to have a web frontend for selling Tryton. II think it makes sense to be able to have some connectors for people that already have a webshop and they want to sync it with Tryton. I think we should develop one for WooCommerce, as it’s been widely used nowadays. This connector will reuse the the web_shop module from the minimal webshopt but create a new module (web_shop_woocommerce) to sync data with woocommerce.
The WooCommerce REST API can be used to retrieve and push data to WooCommerce. There is an available Python Wrapper for it, so It makes sense to us it.
Using this wrapper we can create the following cron jobs:
- Export products data to WooCommerce
- Sync products stock with WooCommerce
- Import Customer Orders from WooCommerce: Download customer orders and it’s related data from woocommerce to Tryton.
There are several order states on WooCommerce so once the order progress on Tryton, we should upate the states back to woocoomerce so the customer knows that he’s order has been updated.
- Pending Payment and On-Hold orders should be on Tryton’s Quotation
- Processing order should be on Tryton’s Processing state.
- Once the shipment is sent, the order should be in *Completed" woocommerce state.
I think this should be the default behaviour of Tryton but It should be configurable per Tryton shop. So I propose to store the WooCommerce state field on the Sale and allow the developer to customize the state. A task in the queue should be responsible to sync the WooCommerce state with the webshop.