Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to get product id by sku in woocommerce

$product_id = $wpdb->get_var(
    $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key='_sku' AND meta_value='%s'", $sku_name)
  );
//this code working in wordpress(woocommerce)
Comment

PREVIOUS NEXT
Code Example
Php :: redrectnh to https n laravel 
Php :: get post data in laravel 
Php :: laravel 8 make model with migration and controller 
Php :: array find php 
Php :: steps to create laravel project 
Php :: composer require no cache 
Php :: What does "as" keyword mean in Laravel route ? 
Php :: laravel created_at changing 
Php :: random string in php 
Php :: how to set base url in codeigniter 
Php :: php now 
Php :: php select option selected from database 
Php :: how to add php file in html 
Php :: Installing PHP and Configuring Nginx to Use the PHP Processor 
Php :: report simple error in php 
Php :: laravel check if request has value 
Php :: php ofreach 
Php :: laravel faker seeder 
Php :: laravel 6 tymon/jwt-auth 
Php :: get domain url with https in laravel 
Php :: laravel eloquent without relation 
Php :: php read csv 
Php :: get_previous_posts_link add class wordpress 
Php :: get numbers from string php 
Php :: php get file location 
Php :: how to change php version in cpanel 
Php :: laravel eloquent search json column 
Php :: laravel multiple group by 
Php :: Add WooCommerce Price Suffix 
Php :: http_response_code 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =