Magento에서 특정 가격대의 제품을 얻으려고합니다. 나는 내가 생각할 수있는 처음 두 논리적 인 방법을 시도했다. 첫 번째는 내 코드에 두 개의 addAttributeToFilter() 문을 추가하는 것입니다.Magento 컬렉션의 singel 속성에 두 조건 적용
$products->addAttributeToFilter('price', array('gteq' => $r['price_low']));
$products->addAttributeToFilter('price', array('lteq' => $r['price_high']));
주사위가 없습니다. 이것은 단지 저에게 두 번째 것을주었습니다.
그때 나는이 같은) 하나의 addAttributeToFilter (모두에 조건문을 추가 한 시도하기로 결정 무엇을 :
$price_array['gteq'] = $r['price_low'];
$price_array['lteq'] = $r['price_high'];
$products->addAttributeToFilter('price', $price_array);
을 다시 바로 하이 엔드. 나는 내 컬렉션에서 getSelect()를 수행하여 하이 엔드 만 적용한다는 쿼리에서 확인했습니다.
누구나 가격대가있는 제품을 어떻게 얻을 수 있는지 알고 있습니다.