Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-12-28 16:44:47

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,962
Website

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:

  1. 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.
  2. 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.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#2 2019-12-28 16:56:29

kuopassa
Plugin Author
From: Porvoo, Finland
Registered: 2008-12-03
Posts: 197
Website

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.

Offline

#3 2019-12-28 17:48:09

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,962
Website

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!


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 Today 04:05:49

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,330
Website

Re: Plugin platform: e-commerce

Hi Stef.

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.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

Board footer

Powered by FluxBB