Get Product ID from SKU

Submitted by deeperdata - 3 years ago

I used this code on the shopping cart page to derive the ID.

<?php
$product_sku = 123456; // use your own sku number
$product_id = Mage::getModel("catalog/product")->getIdBySku( $product_sku );
?>
affiliate_link
Learn PHP
comments powered by Disqus
Proudly hosted on Digital Ocean