• Resolved bbfreelance

    (@bbfreelance)


    Hello,

    I’m trying to save product_attributes (attribute ‘pa_raretes’ and value ‘RR’ exist) :

    $product_attributes['pa_raretes'] = array (
                            'name' => 'pa_raretes',
                            'value' => 'RR',
                            'position' => 0,
                            'is_visible' => 1,
                            'is_variation' => 0,
                            'is_taxonomy' => 1
                        );
    update_post_meta($id, '_product_attributes', $product_attributes);
    

    The problem is that the value is not saved, only the attribute as taxnonmy with empty value.. When I set is_taxonomy => 0 I have to update manually the product to make it works. I don’t understand …

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter bbfreelance

    (@bbfreelance)

    Anyone has already had this problem ?

    • This reply was modified 6 years, 5 months ago by bbfreelance.
    Thread Starter bbfreelance

    (@bbfreelance)

    So fund the solution if interested. You need to do before update_post_meta :

    wp_set_object_terms( $id, 'RR', 'pa_raretes', true );

    Even if the value already exist in attributes.

    • This reply was modified 6 years, 5 months ago by bbfreelance.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[BUG] Product attribute save, is_taxonomy = 1’ is closed to new replies.