I'm a noob in PHP and JavaScript (just started learning). And I'm searching for a code for function.php that will remove 1 item stock from all products if someone make a booking but only for the same selected variation.
There are TWO problems:
1.It need to have hours variations of 15:00-15:30, 15:30-16:00 and also 15:00-16:00, so someone can book the place for half hour or full hour, and there is only ONE place so one stock for each half of hour. And I need to change stock of both other half hour variations when someone book with variation for full hour. All those variations have shortage name of 1500-1530, 1530-1600, 1500-1600.
2.It need to update stock for all products with the same variation.
Earlier I was able to do some coding with the help of internet by changing code to my desire when something wasn't working exactly how I needed, but it's hard to write something from zero and also I never did something like forcing changing stock of an item, so I don't even know how to make it work in PHP, so even a link/links to make me read and learn part from part how to make it would be really great help.
And no I'm not looking for any payable plugin.