0
如果字符串的值等于或大于price
字符串,则需要隐藏oldprice
字符串。如果值等于或大于另一个,则不显示字符串
字符串oldprice
的正确语法是什么?
// Save product data into result array
$result['products'][] = array(
'id' => $_product->getId(),
'in_stock' => (bool)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getIsInStock(),
'url' => str_replace('/index.php', null, $result['shop_data']['url']) . $_product->getUrlKey() . $helper->getProductUrlSuffix(),
'price' => $_product->getFinalPrice(),
'oldprice' => $_product->getPrice(),
'currencyId' => $currencyCode,
'categoryId' => $_category->getId(),
'picture' => $picUrl,
'name' => $_product->getName(),
'vendor' => trim($_product->getAttributeText('manufacturer')),
'model' => $_product->getSku(),
'description' => trim(strip_tags($_product->getShortDescription())),
'local_delivery_cost' => $priceship[0],
'market_category' => trim($_product->getAttributeText('market_category')),
'country_of_origin' => trim($_product->getAttributeText('country_of_manufacture')),
'local_delivery_cost' => 500,
'sales_notes' => '100% предоплата',
);
我只是编辑的最后一个代码,现在这个样子: \t \t $ oldPrice = $ _product-> getPrice(); \t \t if($ _product-> getFinalPrice()> = $ _product-> getPrice()){ \t \t $ oldPrice = null; \t \t} –