Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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));
Comment

PREVIOUS NEXT
Code Example
Php :: reindex after post api magento 2 
Php :: Invalid datetime format: 1366 Incorrect string value 
Php :: laravel websockets 
Php :: PHP - Elegant way of removing values from Associative Arrays based on a key value duplication 
Php :: wp get_results count 
Php :: laravel hide columns 
Php :: php ifelse 
Php :: @admin @endadmin 
Php :: php insert char before each letter using regex 
Php :: How to check if a session is expired or never was set in php 
Php :: view blob phpmyadmin 
Php :: php file_put_contents 
Php :: php check if input is a positive integer 
Php :: get attachment by id wordpress 
Php :: Token capabilities in vault 
Php :: php.validate.executablepath docker 
Php :: cant upload file to directory php 
Php :: laravel collection shift 
Php :: htaccess after trailing slash page return status 200 
Php :: change apply coupon text woocommerce 
Php :: toggle switch php 
Php :: php unique id length 
Php :: laravel faker value or null 
Php :: include JS or Css in wordpress plugin 
Php :: server.php not found 
Php :: rand in codeigniter 
Php :: check dir php 
Php :: laravel sanctum authentication 
Php :: trim php 
Php :: laravel where in query builder 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =