Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once '../app/Mage.php';
- /**
- * @author odahcam
- *
- * @version 1.0.0
- *
- * @param {string|int} $product_id
- *
- * @return {string}
- **/
- function getSkuById($product_id)
- {
- $adapter = Mage::getSingleton('core/resource')->getConnection('core_read');
- $select = $adapter
- ->select()
- ->from(Mage::getResourceModel('catalog/product')->getEntityTable(), 'sku')
- ->where('entity_id = :entity_id');
- return $adapter->fetchOne($select, [':entity_id' => (string) $product_id]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement