wc_product_has_global_unique_id

FUNCTION woocommerce\includes\wc-product-functions.php (ligne 714) github
Gives plugins an opportunity to verify SKU uniqueness themselves.

Paramètres

Entrée :
$product_id, $global_unique_id
Sortie :
@param bool|null $has_unique_sku Set to a boolean value to short-circuit the default SKU check.
@param int $product_id The ID of the current product.
@param string $sku The SKU to check for uniqueness.
@param int    $product_id Product ID.
@param string $global_unique_id Product Unique ID.
@return bool

Utilisation

// Utilisation de la fonction wc_product_has_global_unique_id
$result = wc_product_has_global_unique_id($product_id, $global_unique_id);

if ($result) {
    // Votre logique ici
}

Actualités

Chargement des actualités...