Im fetching Product Attributes from Woocommerce, and echo them out in a script tag as variable to use with javascript in frontend. This might be a bad practice, feel free to enlighten me. Example: Product Attributes: Total height: 43m Total length: 55m PHP queries “Total-height” as Attribute Name and “43m” as Attribute Value. PHP replaces empty space with “-“. I
Tag: attributes
Add_filter to add new column to Woocommerce product attributes table (Attributes add / edit page)
I would like to add a new column to the Attributes table on the Attributes add / edit page within Woocommerce / Wordpress admin, using the Wordpress / PHP add_filter command. As a reference, to add columns in WordPress admin to the Woocommerce All Products add / adit table, the following filter works: add_filter( ‘manage_edit-product_columns’, ‘add_product_column’, 10, 1 ) The
How to get attribute name instead of slug in variation?
I need to get attribute from woocommerce product variation. This code is giving me an attribute slug instead of name. How can I get attribute name? Thank you so much in advance! Answer What you are getting is the slug of a taxonomy… In WooCommerce, attribute_pa_color without the attribute_ is a taxonomy. So you can try something like this.. to