Answers for "php get woocommerce attribute from database"

PHP
0

php get woocommerce attribute from database

//This article helped me put everything together - https://www.webhat.in/article/woocommerce-tutorial/how-product-attribute-are-stored-in-database/

global $wpdb;
$posts = $wpdb->get_results("SELECT DISTINCT name FROM $wpdb->terms WHERE term_id in (SELECT DISTINCT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = 'pa_yourattributename' AND count > 0)");
print_r(array_values($posts));
Posted by: Guest on March-07-2022

Code answers related to "php get woocommerce attribute from database"

Browse Popular Code Answers by Language