Need a Workflow to get data from Point A copied to Point B

I am currently working on an ecommerce store.
I have all of the functionality set up for a USER to add PRODUCTS to their SHOPPING CART.

However, I need this data to be transferred to data type ORDERS once they checkout so that I can build a “Past Orders” element for each USER, as well as, so I can see the ORDER myself so I can build it and ship it.

Basically, I would need the lines of DATA from data type SHOPPING CART to be transferred to data type ORDERS when they checkout. The only way I can get this is for all of the products to be grouped together in one line under ORDERS.

But I need the right product to match the right amount of quantity. They all must fall under the same Order # as well so that I know they belong together and can sort them that way.

Here are screenshots of my data setup:

I do something similar, although not for a shopping cart, but the principle is the same. (I skip step #s in my description below which don’t necessarily apply to you, and instead use the step #s in the image attached.)

Step 0, your customer adds the contents of their cart, which adds (and then presumably modifies) a database entry to CART. Upon purchase, they trigger a backend workflow.

Step 1, the backend workflow finds the most recent CART row with some sort of matching criteria. (Maybe the slug of the CART submittal which triggers the backend workflow.)

Step 3, create a new ORDERS entry copying the data for every field for the results of step 1. (Which includes numbers which represent multiple values of the same products.)

Step 4, delete CART record. (Or move the record to a database named CART ARCHIVES, in case you ever need to troubleshoot or compare CARTS to ORDERS.)

Edit : I see your point about the ability to store multiple quantities of multiple items… the way I’d do it, which is admittedly a little messy, is to pick some arbitrary number like 25, and say in my CART that there are fields, “SKU_1” and “SKU_1_QTY” all the way up to “SKU_25” and “SKU_25_QTY”, and adding items to the CART fills those fields in order with the item (SKU) and quantity (QTY).

The result is that if they buy one SKU and a quantity of 1, then you have 48 blank fields leftover, which is no big deal.

Okay just so I make sure I understand here.

Are you suggesting that I add Data Fields to CART for “SKU_1” / “SKU_1_QTY” and so on until I have enough Fields to match the amount of products? Just so I am clear on this. If so, what exactly is the functionality that would allow me to have a RG with data source set to PRODUCTS that would allow add to specific (or maybe most recent) data field in CARTS?

Also Step 3 here confuses me a little bit. What kind of functionality would allow me to copy the data over from CART into ORDERS and keep it matching? Maybe this will be answered with the same functionality as above, maybe not. What I am trying to say is that if I have an Order # created upon Checkout, how can I apply that to each line in the ORDER so that I can sort by Order #? For example, all the functionality I can find right now is to Add the List of the CART items over into ORDERS, but they all end up falling under the same data field of the same data line so I cannot match with QUANTITIES.

I apologize for my ignorance here, and definitely appreciate what info you’ve given me already!

This topic was automatically closed after 70 days. New replies are no longer allowed.