Textpattern CMS support forum
Plugin platform: e-commerce
Although this is probably not the right time to mention this, I have some vague ideas about building an e-commerce platform for Txp in the form of a plugin that ties together various aspects of the system. Not sure if anyone’s familiar with yab_shop (which I modded to add a whole bunch of stuff for a client, once). But I’d like to revisit that idea and redo it, in a little more modular fashion, using modern Txp components as building blocks.
The reason I’m holding back on this is because I think unlimited custom fields are an absolute must to make this work. They’re coming (honest).
The general idea is to use Articles as Things to Sell – whether they be downloads or physical products, using:
- Custom fields as attributes like size, price, colour, features, etc
- Excerpt and Body as short/long description
- Article images as product images
- Keywords as tags (forthcoming in Txp, we hope)
and so forth. That way, you can put sellable items in Sections and/or tag them (categories/tags) so people can find them. You can filter them (natively in v4.8) from the URL, use custom permlink schemes per section (again, from v4.8+). A lot of the functionality in 4.8 allows us to do this, and adding unlimited custom fields and (perhaps) keywords tagging in the next version is the final piece of the puzzle.
Anyway, integral to this e-commerce platform/plugin are two additional features:
- The ability to tie a product combo to an image set, so if you pick, say, medium + red, the image changes accordingly. That’s complex and I don’t know how to manage that yet, but I expect matching custom fields across content types to feature heavily.
- The ability to add modular plugins to accept payment gateways such as PayPal (IPN), MoneyButton, Visa/Mastercard, Square, Authorize.net, WePay, Stripe, AmazonPay, WorldPay, ApplePay, blah blah.
The latter feature, I envisage, would be bolt-ons to the main plugin’s cart functionality, so anyone using it could add the main shopping cart system and then either roll their own 3rd party payment system (perhaps offsite) or install one or more payment modules to have the main plugin support those gateways at checkout.
I’ve not thought it through much beyond that, but I think a project like that has good scope for Textpattern – if we define what it is and, more importantly, what it isn’t.
Current options in the marketplace are the usual cart platforms like Shopify or OScommerce or even Wix if you’re a masochist. But they want your entire site to be “the selling platform” with other stuff on the side. If you have a site with selling on the side (e.g. small cafe offering branded merch, paintings/photos to sell, an event photographer who wants to offer bundles of services, etc) then these platforms either work out too expensive or too unwieldy to manage as your portfolio grows. That’s where I see a Txp solution fitting.
If anyone’s interested in being part of this when the time comes, I’d love to put together a bunch of us to scope out how this platform might work and integrate with Textpattern.
- Plugin Author
- From: Porvoo, Finland
- Registered: 2008-12-03
- Posts: 197
Re: Plugin platform: e-commerce
Good stuff. :-] yab_shop did things so nicely that it could be used 1:1 as a source of ideas. I think it could’ve been much better with more payment methods, an inventory system, and with logging (saving to a database significant events that happen).
Inventory could be as simple as having a custom field with an integer that decreases when someone makes a successful purchase.
Re: Plugin platform: e-commerce
Yes, I really like yab_shop. As you say, things that would make it better in this next realisation would be:
- Some configuration mechanism to map CFs so that combos can be made more easily. Bonus points if they can be tied to images and other entities (see below).
- Modularised payment systems.
- Product dimensions – w x h x d and weight, per combo.
- Postage and packing table band options, by carrier/weight/size. This is something I built into my fork, but it was a kludge and needs to be done better.
- Tax rates. This is an absolute minefield, because some tax jurisdictions and rules apply to the product/combo (and perhaps where it’s sourced) while others apply to the shipping depending on where it’s being sent. Quite often both, with different rates. I added a “product tax rate” custom field based on a bunch of pre-configured rates, but it was unsatisfactory. It needs applying to the ‘article + CF combo’, not just the article. For example, in the UK, physical books don’t attract tax, but e-books do. So if you made one product (article) for a book, and used a “type” custom field (paperback/kindle) to distinguish which format the buyer wanted, the tax rate for the paperback would be 0 but the kindle edition would be 20%. If you don’t permit this level of config, you need to create two articles – one for each ‘version’ – which doubles the amount of duplicate metadata.
- Inventory – good idea. Hadn’t thought of that, but very handy.
- An event table – yes, this is something that I added as part of smd_ipn so when a transaction was complete and the webhook was pinged, it updated the table with the txn ID and details (payment amount, tax, product SKU, success/failure and reason, etc). This was then (via a little admin panel) tied to the product to see what was sold, and when. It was a hack, but it worked.
Instead of handling such event logging in the payment gateway module, it would be better if we had a simple API in the main plugin so that when the return path from a webhook fires and the transaction is complete, results can be recorded in a central table. The hook could then go on to perform a chain of customisable “business logic” depending on the outcome. So, for success, it might decrement the inventory counter against that product, send off an email to a nominated dispatcher/dropship supplier/customer, and so on.
yab_shop has a lot going for it. Just really needs to have the payment stuff stripped out and modularised (using callbacks to handle them instead), add webhook management, and shoehorn the above stuff in somehow!
Re: Plugin platform: e-commerce
I’m very interesting about this kind of new enhanced e-commerce plugin and I can support its development (up to 100€) in the next 3 months.