dimanche 19 avril 2015

If WooCommerce Stock Updates, Also Update Specified Field Values

I would like to have a function that should update the Est. Dispatch Date Field ) in whenever WooCommerce Stock Value / Stock Amount changes even when order is placed and stock amount is reduced by woocommerce.


I am unable to achieve this since I am unable to get variations ids and there stock amounts, based on which it should also update that variation's est. dispatch date field as below:


SCENARIO 1: http://ift.tt/1DrMEwJ


SCENARIO 2: http://ift.tt/1biGTvg


The Est. Dispatch date field is different for each variation ID. Likewise for the 1st variation, its name is cuzd-prod-general-v1, for the 2nd its cuzd-prod-general-v2 and so on for every product's variation.


I would like to place this code into my functions.php file to work. Please help. Thanks.


Aucun commentaire:

Enregistrer un commentaire