product has a custom options or not in magento?

2019-09-07 12:41发布

how to check that product has a custom options or not in magento?

Mage::setIsDeveloperMode(true);         
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$product    = Mage::getModel('catalog/product')->load($sku, 'sku');
$code = $product->getAttribute()->getAttributeCode();

标签: magento
1条回答
ら.Afraid
2楼-- · 2019-09-07 13:02
$product    = Mage::getModel('catalog/product')->load($sku, 'sku');
$hasOptions = $product->hasCustomOptions();

Simple as that. At the end $hasOptions should be true or false.

查看更多
登录 后发表回答