Search

Hi Guys

I'm looking to develop a basic ecommerce extension for symphony and just wanted to run my data model and workflow by you guys as although I know it would work for my use case (the clients site I'm working on), I want to develop it as an extension rather than custom code. This is partly as there are some great extensions here that I've benefitted from but also because I quite want to learn how to write my code into the extension format. I've written extensions for various cms's in the past but finally want to dive into symphony!

My Design Overview

This is only in the rough design stages but I think I've got quite a nice concept for how it could work. I'm not developing this initially with members in mind but I reckon it could easily be integrated in the future.

The checkout is not designed to handle any payment details, it is designed to offer support for gateways such as sagepay forms integration and paypal standard payments. It will handle the information, provide the code to redirect to the gateway and handle the IPN. Again onsite processing could potentially be developed in nicely in various forms

1 basket extension

This will basically handle adding to basket on the current users session. It will consist of:

  1. Event: Add Item (takes an item-id and quantity)
  2. Event: Remove Item
  3. Event: Change Quantity
  4. DS: get basket data - return xml of the basket data

You can then set the price field in the config so that the basket knows how to calculate the price. I'll also be writing some 'delegates' style code into this as for my client I need to be able to offer volume discounts.

2 Checkout extension

The first key feature of this (as suggested in another thread) is that payment gateway code will be written in mini-extensions through a common data model that I've roughed out. I'll initially be doing paypal standard and sagepay

This will primary consist of four parts

1, A transaction custom field This will store the following data: order total, shipping rate, status, transaction details (ie IPN feedback). This is intended to be added to your orders section

2, A checkout event filter This can be added to a 'new order' event to process the checkout and generate the necessary stuff to send to the gateway

3, Gateway datasource The intention here is that this will generate the necessary form data to post to the gateway. This is so that the page can display this data in the necessary format, in my use case I need to offer the choice between sagepay and paypal.

4, IPN Handler Handles the IPN callback and processes the transaction data (similar to the paypal extension)

Work flow overview Just to give you an idea of how they will interact:

  1. New Order Event fills in order information and calls the event filter.
  2. The event filter uses the current basket to calculate the totals and add data to the transaction field in the Order
  3. Shipping is then selected (still roughing this out)
  4. The gateway datasoure returns the form code which is displayed on the page
  5. The gateway is selected by the user, the user visits the gateway and pays
  6. The IPN is called by the gateway to process the results.

Overview

I'm going to be started a git repository soon for this, I just wanted any feedback on my approach and if there could be better ways of doing it to make it a better, more versatile extension

I've not really touched on the gateway extensions exactly but my plan is that they'll extend a class and each have several methods, which roughly are:

  1. generateFormData - generates the form to post
  2. isIPN - reads the ipn response to see if it is form their gateway
  3. processIPN - processes the IPN data and returns the appropriate response

Thanks in advance for your feedback anyway, if this is clear as mud then let me know and I'll try and explain better :)

the basket extension is already available

Thanks for that, will have a look into it

Also for populating your sections with products you might want to consider using the OS ERP application Tryton, export and import as xml. Since you might need accounting and other functionalities that are part of doing business, and don't want to enter all your data twice. Or if you want automated orders use Tryton's rest api, in that case you must run the trytond application (needs postgresql, phyton, shell) on the web, otherwise for manual you can run Neso a trytonclient with integrated server as an app on your desktop.

Thanks for the information, I don't need that kind of functionality yet but I may look into it in the future as it sounds like it could be a very nice way to integrate things.

@makenosound has done some work using PayPal as a payment gateway. Perhaps that might help as you go.

the TS might want to keep an eye on the crm thread, as ecom and crm are closely intertwined.

Hi Guys

Sorry for the lack of input on my part but have had a pretty hectic schedule developing things. I've got an initial working copy of this on the site Core Flooring - it is purely symphony run with a few custom datasources and events.

The basket/checkout code is in need of a massive tidy up and I need to work reduce some of the features/add more friendly configuration but then I'll get it into GIT I'm away for the next week so it'll be a few weeks before I've got something up but I'll keep you posted.

Thanks

There is my current code now on github. This is completely pre-release in terms of using it as an extension but I intend to refactor the code over the coming weeks to make it more usable.

Congrats on the site, davjand. Are you happy with the store and the way it's running?

There's been a potential project or two in the past where I was looking at having something done in Symphony, but they didn't happen. I've just been given the go-ahead for one today, though, which doesn't require online payments - just orders. I'm thinking it might be a nice project to try with Symphony, so I'll be sure to try your extension. Thanks for releasing it.

Hi

Sorry for my lack of response, haven't logged into here for a while :)

The store is running well but I've got round to refactoring the code at all yet. Did you have much success?

Hi davjand, welcome back :)

We haven't tried it yet, but I believe it's still our plan to do so.

We're concentrating on getting the catalogue/listing part of the site done first. We hope to try your extension soon.

Cheers!

davjand, Would like to know if the site you've used this extension on is integrating with SagePay and not Sage Payments?

I have a potential use for this very soon.

Spam from @jamesdev above.

@Petertron Thanks.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details