0
Magento에서 내 피드 순서를 변경 한 사용자 지정 관찰자를 만들었습니다. config.xml에서이 부분을 활성화했습니다.Magento - 피드 정렬 기준 날짜 속성
<ewfeed_feed_products>
<observers>
<example_ewfeed_products>
<type>singleton</type>
<class>ewfeed/observer_example</class>
<method>feedProducts</method>
</example_ewfeed_products>
</observers>
</ewfeed_feed_products>
나는 이것을 Example.php로 변경했다.
static function feedProducts(Varien_Object $observer)
{
$feed = $observer->getFeed();
$productCollection = $observer->getProductCollection();
$transport = $observer->getTransport();
//lets try sorting
$productCollection->addAttributeToSort('news_to_date', 'DESC');
$originalIds = $productCollection->getAllIds();
// any ids set here are products that will be used in the feed. they will be listed in the order of the ids in the array
// so if you change the order it will change the order of the outputted products. you can also filter products here
$transport->setProductIds($originalIds); // set to null to use default
}
'new_to_date'는 날짜 값이있는 속성입니다. 이제 내가 필요한 것은 피드가이 날짜에 따라 내림차순으로 정렬된다는 것입니다. 그러나 addAttributeToSort를 추가해도 아무런 변화가 없습니다. 누군가 나를 도와 줄 수 있습니까?
1. 예. 이렇게 설정됩니다. 2,3 나는 이걸 어떻게 확인할 수 있습니까? – Alex
설정 : 카탈로그 검색> 검색 엔진을 확인해야합니다. – oscprofessionals
포인트 3에 대해 Google에 Solr을 쿼리하는 방법이 필요합니다. – oscprofessionals