Where in the liquid code does an inventory stock level get deducted from a sale? Obviously when a sale is generated it would happen, but is there a temporary variable storage before this is done? I'm currently sifting through all the liquid files and I can't seem to see where this or something similair to this is done.
Any help or questions would be great thanks,
Britton here with the Shopify support team.
Adjusting the inventory level after a sale actually happen right in the Shopify core code and has nothing to do with liquid. It also occurs inside of the checkout process where code customization is similarly impossible.
What are you wanting to do with that process though? If you can explain it a little more then I might be able to offer you some alternative solutions.
Hi Britton Thanks for replying!
Ahh ok that explains why I can't find anything like it.
I am trying to let one product change the stock levels of multiple product inventorys when a sale goes through.
Its basically a bundle but the customer picks 12 items from a dropdown list totaling at a fixed price. I'm not worried about discounts or adjusting prices, I just need to have it so the stock levels of each item is deducted.
Hope that makes sense, if not fire as many questions as you like.
Hi again Phil,
that sounds like it will be pretty complicated! The only way I can think of doing it offhand would be to set up a webhook for whenever an order is fulfilled. You then check that info from the webhook to see which products were sold. You can then use our API to adjust the inventory quantity of your products based on what was sold in the order.
There might be some other ways to do it as well but I suspect they would also require the API.
I hope that helps!
|an hour ago|