I need help with a back end loop workflow

Hello, I’m currently working on an online marketplace but I’m having some problems with the back end workflows.

The workflow is something like this:

Customer adds a product to the cart

Selects quantity

Checkout

Back end workflow: make X amount of copies of that product (x is the quantity and everytime a product is copied “quantity -1”

So before the checkout the database looks like this:

Product X example: quantity 3

And after it would look like:

Product X example: quantity 1

Product X example: quantity 1

Product X example: quantity 1

Sometimes it creates too many copies, sometimes the backend worklow is triggered automatically etc.
Here some screenshots:

1

Do you know an easier way of spliting a product from 1x5 to 5x1?

Thank you.
Ibra

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