Magento – Check if the SKU is exist

<?php

$sku = 'Your Product Sku';

$id = Mage::getModel('catalog/product')->getIdBySku($sku);

if ($id){

    echo "SKU {$sku} exists";

}

else{

    echo "SKU {$sku} does not exist";

}

?>

Revisions

No comments yet.

Leave a Reply