$product = wc_get_product( $product_id );
//echo $csvpro[7].’
‘; exit;
$product->update_meta_data( ‘ean’,sanitize_text_field( $csvpro[7] ));
$product->update_meta_data( ‘grossweight’, sanitize_text_field( $progrossweight ) );
$product->update_meta_data( ‘expectedinweek’, sanitize_text_field( $proexpectedinweek ) );
$product->update_meta_data( ‘demostock’, sanitize_text_field( $prodemostock ) );

$product->save();

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *