Magento News
Retrieving a product’s custom options via PHP
by EricO (Posted Thu, 01 Jul 2010 23:49:53 GMT)
I’d like to get a product’s custom options via PHP, and I’m not entirely sure how. I can load a product this way (assuming $_item is an item object):
- Code:
$product = Mage::getModel('catalog/product');
$productId = $product->getIdBySku($_item->getSku());
$product->load($productId);
I read on a site that this should tell you whether a product has custom options:
- Code:
$product->hasCustomOptions()
However, that is returning false for an item that I know has custom options. I also found this function call, which sounds like it should return options:
- Code:
$product->getOptions()
However, that returns a huge array rather than just custom options.
How can I retrieve just the custom options of a product in Magento via PHP?
http://magento-forum.co.uk/viewtopic.php?f=5&t=330#p1193
Possibly Related Posts:
- Hiring #Magento #Developers at #Ahmedabad location. http://t.co/O5PmfSqi #Magento #PHP #Mysql #Jobs #Ahmedabad
- わかってるよ………… あんたの「鉄球」はツェペリの一族のより上の技術があるんだろ? 安心してるよ
- Magento Upgrade by blugreen http://t.co/ZyH6G2MO #jobs #Freelance
- Looking for #Zend #Developers at #Ahmedabad location. http://t.co/O5PmfSqi #Magento #PHP #Mysql #Jobs #Ahmedabad
- Looking for #Zend #Developers at #Ahmedabad location. http://t.co/xDkodbp4 #Magento #PHP #Mysql #Jobs #Ahmedabad
RSS Feed