此产品已在magento后端库存.... 如果自定义选项下拉列表中的0数量隐藏在magento的产品页面中
此代码: - 尝试但不工作
<?php
$product_id = $this->getProduct()->getId();
$productCollection = Mage::getModel("catalog/product")->load($product_id);
foreach ($productCollection->getOptions() as $value) {
$values = $value->getValues();
foreach ($values as $values) {
//print_r($values->getData());
echo $values->getQty();
if($values=="0")
{
}
}
$i++;
}
?>
答案 0 :(得分:0)
$product_id = $this->getProduct()->getId();
$productCollection = Mage::getModel("catalog/product")->load($product_id);
foreach ($productCollection->getOptions() as $value) {
$values = $value->getValues();
foreach ($values as $value) {
echo $value->getQty();
if($value->getQty() == '0')
{
}
}
$i++;
}