Go to: Products > Add Product (or edit an existing one). Select the Attributes tab in the Product Data. There you can choose any of the attributes that you've created in the dropdown menu. Select Add.
Log in to your WordPress account and go to the dashboard. There, navigate to Products and select the products you want to show the product attributes. If you want to create a new product, click on Add Product. If you just want to edit the existing one, select the Edit button below the item.
Product attributes are stored in two locations - in wp_terms, wp_term_taxonomy and wp_term_relationships (that's the first place - each attribute is preceded by pa_ for its taxonomy name - e.g. if you have a color attribute, it's under pa_color) then also as a PHP serialized array in wp_postmeta under '_ ...
The products in my clients website require certain attributes which I have added via Products -> Attributes in the Wordpress administration. In this import script I'm coding I need to use the function update_post_meta($post_id, $meta_key, $meta_value)
to import the proper attributes and values.
Currently I have the function like so:
update_post_meta( $post_id, '_product_attributes', array());
However I'm not sure how to properly pass along the attributes and their values?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With