Hello,
I added an generic fields but after the validation of the form the data are not registered in the product sheet (attributes)
[cred_generic_field type='select' field='Condition_gn']
{
"required":0,
"default":[""],
"options":[{"value":"","label":"None"},{"value":"as-good-as-new","label":"As good as new"},{"value":"good-normal-traces-of-use","label":"Good – Normal traces of use"},{"value":"in-its-own-element","label":"In it’s own element"},{"value":"need-to-be-restored","label":"Need to be restored"},{"value":"new","label":"New"},{"value":"very-good-no-defect-but-may-show-slight-traces-of-use","label":"Very good – no defect but may show slight traces of use"}]
}
[/cred_generic_field]
///////////////// function.php
add_action('cred_save_data', 'custom_function',10,2);
function custom_function($post_id, $form_data)
{
// if a specific form
if ($form_data['id']==xxx)
{
$vals= isset( $_POST["Condition_gn"] ) ? $_POST["Condition_gn"] : array();
foreach($vals as $val) {
add_post_meta($post_id, 'wpcf-condition', $val, false);
}
}
}
Best regards
Mohammed