Skip Navigation

[Resolved] Form post save product attributes

This support ticket is created 6 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 1 voice.

Last updated by cherifM 6 years, 3 months ago.

Author
Posts
#1156827
Capture d’écran 2018-12-01 à 10.19.02.png
Capture d’écran 2018-12-01 à 10.19.12.png

Hello,

I created a form with a list of the terms after the validation of the form the value do not appear in the product sheet
can someone help me please

[cred_generic_field field="pa_condition" taxonomy="pa_condition" type="select" single_select="true"]
{
"required":0,
"validate_format":0,
"persist":1,
"default":[],
"options":[

{"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]

Best regards
Momo

#1156885

I solved:

function update_post_meta_subito($post_id){

$prova_termine='inzaghi';

$term_taxonomy_ids = wp_set_object_terms( $post_id, $prova_termine, 'pa_autore', true );

$thedata = Array(

'pa_autore'=>Array(
'name'=>'pa_autore',
'value'=>$prova_termine,
'is_visible' => '1',
'is_variation' => '1',
'is_taxonomy' => '1'
),

);

update_post_meta( $post_id, '_product_attributes',$thedata);