Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $thedata = array();
- foreach ( $artikel->attributes->attribute as $property ) {
- $attribute_name = 'pa_' .sanitize_title_with_dashes($property->attributes()->name);
- $attribute_value = $property->attributes()->value;
- wp_set_object_terms( $insertProduct, (string)$attribute_value, $attribute_name , true);
- $thedata[$attribute_name] = array(
- 'name'=> $attribute_name,
- 'value'=> (string)$attribute_value,
- 'is_visible' => '1',
- 'is_variation' => '1',
- 'is_taxonomy' => '1'
- );
- }
- update_post_meta( $insertProduct,'_product_attributes', $thedata) ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement