Home Forums WoodMart support forum Problem with REST API (PUT in products/attributes) Reply To: Problem with REST API (PUT in products/attributes)

#94036

Artem Temos
Keymaster

Try to add the following PHP code snippet to the child theme functions.php file to fix this

add_action( 'woocommerce_attribute_updated', 'woodmart_wc_attribute_update', 20, 3);
function woodmart_wc_attribute_update( $attribute_id, $attribute, $old_attribute_name ) {
	update_option( 'woodmart_pa_' . $attribute['attribute_name'] . '_swatch_size', $_POST['attribute_swatch_size'] );

	update_option( 'woodmart_pa_' . $attribute['attribute_name'] . '_show_on_product', $_POST['attribute_show_on_product'] );

	// Change value of selected option
	if( function_exists( 'woodmart_admin_scripts_localize' ) ) 
	woodmart_admin_scripts_localize();
}