Hi, I am currently working on a shopping cart.
I am using the storage extension for the front-end which is going well.
Someone can pick a single item multiple times.
I would like to see the same structure in the back-end.
Something like one entry for a order, with a select box link to the products.
But i would like to select multiple instances of the same product (entry), which looks like isn’t possible with the select box link field or the associations extension…
Does anyone have any suggestion’s how to tackle this or maybe there’s some extension out there for this?

As a general rule of thumb, be careful linking transaction data back to other sections.

While it seems very logical in most cases, from a transaction and audit perspective it can have consequences! Always think of a transaction as an immutable record of what has occurred. The product price, the product name and even the customer details (shipping etc.) should remain fixed so that if you look up the transaction later on you will see the exact same data that was entered at the time of purchase.

For this reason, you can potentially be a little creative with what fields you use to achieve this.

Have you tried creating a Transaction and Transaction Items section? The Transaction Items section can simply be Item, Quantity, Price as text/number fields. The main Transaction section can then link to this section as well as store other information about the transaction (payment type, customer info etc.).

I'd also recommend doing all your sums once, so you don't have to waste processing power in future when attempting to do things like sort by order value :)

Hi Brendo, thanks for your feedback!
I have made a webshop before and there i stored transaction data in a static text field.
But in this case with ‘products’ i actually mean ‘credits’ someone can purchase (which are static).
I am building some kind of webapp and i need the data in my xml in order for the app to work. I just called them products to keep it simple.
The easiest solution in my case would be the scenario i described, so i was just wondering if there was an easy solution for this that i overlooked. Like some kind of extension that can pick multiple instances of the same entry.

Have you tried creating a Transaction and Transaction Items section?

Yes, but that seems like a bit of overkill in this scenario, since a new entry has to be created for every ‘credit’ that is purchased. And there will only be about 10 kinds of ‘credit’s’ someone can purchase which are static.

I think i will go back to the drawing board and store all someone’s ‘credits’ in a separate section linked to someone’s profile and update the credit’s after they are purchased. I’ll be back if i run in any trouble!

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