I have a custom fields that I have to update in the woocommerce shopping cart, when the user completes his order
the following function:
$moreinfo_values = get_post_meta($_product->id,'more_info_data');
gets me the array:
Array
(
[0] => Array
(
[0] => Array
(
[m] => NSW
[o] => Sydney
[d] => Something
[p] => Array
(
[0] => 13/08/2015
[1] => 14/08/2015
)
[n] => 9am - 4pm
[f] => 20
)
[1] => Array
(
[m] => SA
[o] => Adelaide
[d] => Hotel SA 5000
[p] => Array
(
[0] => 02/04/2015
)
[n] => 9am - 4pm
[f] => 12
)
)
)
I need to update [f] => 12 with the following function:
update_post_meta( $_product->id, 'more_info_data', 'f', '100' );
But I dont seem to figure it out how this function works.
I really appreciate your help on advance
Based on your updates i created
simple function
which doingupdate_post_meta
, as per my knowledge i don’t see any option to update the value using your function likeupdate_post_meta( $_product->id, 'more_info_data', 'f', '100' );
You can make the condition inside the function update_custom_post_meta_data for your wish,am not sure doesn’t know the exactly which data to split the condition as common and hence it is up to you.
so i created alternate function like
You can use this function by replacing the function name of your existing one to this one
It will works for your requirements.
Thanks.