woocommerce check if product is variable
global $product;
// $product->is_type( $type ) checks the product type, string/array $type ( 'simple', 'grouped', 'variable', 'external' ), returns boolean
if ( $product->is_type( 'variable' ) ) {}
woocommerce check if product is variable
global $product;
// $product->is_type( $type ) checks the product type, string/array $type ( 'simple', 'grouped', 'variable', 'external' ), returns boolean
if ( $product->is_type( 'variable' ) ) {}
check if a customer bought the product woocommerce
wc_customer_bought_product( $customer_email, $user_id, $product_id );
check if a customer bought the product woocommerce
if ( !function_exists( 'wc_customer_bought_product' ) ) {
require_once '/includes/wc-user-functions.php';
}
// The customer email.
$customer_email = '';
// The user id.
$user_id = -1;
// The product id.
$product_id = -1;
// NOTICE! Understand what this does before running.
$result = wc_customer_bought_product($customer_email, $user_id, $product_id);
Copy
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us