Woocommerce let 'Gravity addon' product reduce stock automatically

Avg Bid (EUR)
14 / hr
Project Budget (EUR)
€12 - €18 / hr

Project Description:

I have got a webshop with woo commerce. I am using the plugin 'Gravity Addon' so customers can select an option.

The options are also related to 'simple products' in the shop.

What I want is when a customer selects an option, I need the stock of the 'simple product' (that is related to that option) to be reduced.

1.)My client sells bathrobes and belts.

2.)The bathrobes are variable products (sizes) and have each the same 'gravity addon' form. The form is called 'Do you want a belt with it?' and
the options are 'No Belt - Belt 1 - Belt 2 (+euro 21,-) - Belt 3 (+euro 34)'

3.)But you have also got these options as 'simple products' in the shop like: Belt1, Belt2, Belt3...

4.)I use SKU for all products. What needs to be done is that when the customer selects the option 'Belt3' for instant, the simple product 'Belt 3' needs to be reduced with 1 in the stock. And offcourse when the client selects a quantity of 2, it needs to be reduced with 2 in the stock.

# So actualy the value of the options in the form need to be the SKU of the simple products, telling the shop that it needs to be reduced in the stock by the number of quantity (????)

Can you help me with this?

It is important to only make changes in the functions.php of the theme. So when I need to upgrade woo commerce, it will have no affect and I can make simply the changes when there are new belts.

Greets Jair

Hours of work: 2 Project Duration: < 1 week Skills required:
PHP, Wordpress
About the employer:
Public Clarification Board
Bids are hidden by the project creator. Log in as the employer to view bids or to bid on this project.
You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.

€20 / hr
Hours: 6 hr/ week
€12 / hr
Hours: 8 hr/ week
€15 / hr
Hours: 10 hr/ week
€18 / hr
Hours: 10 hr/ week
€13 / hr
Hours: 40 hr/ week
€15 / hr
Hours: 2 hr/ week
€18 / hr
Hours: 20 hr/ week
€15 / hr
Hours: 2 hr/ week
€16 / hr
Hours: 2 hr/ week
€12 / hr
Hours: 5 hr/ week