1
약간의 딜레마가 있습니다. 다음 코드는 최소 가격을 무시하면서 할당 된 제품을 올바르게 표시합니다. "as as as low"옵션.Magento 도움말 -> 어려움을 겪고있는 신제품
<?php
$cat_id = 123; // category id
$category = Mage::getModel('catalog/category')->load($cat_id);
$todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
$_products = $category->
getProductCollection()->
addCategoryFilter($category)->
addAttributeToFilter('news_from_date', array('date' => true, 'to' => $todayDate))->
addAttributeToFilter('news_to_date', array('or'=> array(
0 => array('date' => true, 'from' => $todayDate),
1 => array('is' => new Zend_Db_Expr('null')))
), 'left')->
addAttributeToSelect('*');
if (($this->getProductCollection()) && $_products->getSize()): ?>
마지막 줄을 약간 조정하면 "낮은 가격대로"표시되지만 해당 범주 내에서 할당되지 않은 제품이 추가됩니다.
if (($_products = $this->getProductCollection()) && $_products->getSize()): ?>
무엇이 누락 되었습니까? 감사합니다.