请帮助在结帐时获取 magento 属性。我有“only_registered”属性。我试图通过此代码获取属性:
$cart = Mage::getSingleton('checkout/session')->getQuote()->getAllVisibleItems();
foreach ($cart as $_item){
$_product = Mage::getModel('catalog/product')->load($_item->getProduct());
$registeredonly = $_product->getRegisteredOnly();
}
但是这段代码会产生 magento 错误。
Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1";i:1;s:4723:"#0 /work/www/topps.loc/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)