when creating a custom cart & checkout, what is the best way to check for inventory without using any scripts.
I have an order’s table.
I filter these orders to only the ones that are Completed.
Using a multiple relation for every products in the products table I find the orders that contain that products and return an order summary text back to the products table showing the order details.
the text looks like this in the products table
Product 1 (product1+5, product2+2, product3+1) if 1 order
Product 2 (product1+1, product2+1) (product2+5) (product2+8) if 3 orders
what is the best way to filter out how many Product1 were purchased and deduce that form the total inventory?
has anyone tried doing this for inventory? i tried also doing it the opposite way. relating the products table to the last order in checkout & if its complete deduce the value from the product inventory, but since a lot of the data is in user specific columns that didn’t work well at all.