Câu hỏi được gắn thẻ «filter»

Biểu thị các câu hỏi về lọc trong Magento (điều hướng theo lớp, lọc bộ sưu tập)



2
Lọc bộ sưu tập sản phẩm theo thuộc tính khác trong Bộ sưu tập sản phẩm, ví dụ: 'attribX', mảng ('gt' => 'attrib-Y')
Khi sử dụng bộ sưu tập sản phẩm như vậy: $_productCollection= Mage::getModel('catalog/product')->getCollection() ->addAttributeToSelect('*') ->addAttributeToFilter('special_price', array('neq'=>'')); Có thể sử dụng addAttributionToFilter trên một thuộc tính so với thuộc tính khác không? ví dụ: Tôi có thể lọc Special_price lớn hơn giá bằng thứ gì đó như $_productCollection= Mage::getModel('catalog/product')->getCollection() ->addAttributeToSelect('*') ->addAttributeToFilter('special_price', array('gt'=>'price'));

5
Lọc bộ sưu tập sản phẩm theo nhiều danh mục?
Tôi có đoạn mã này nhận được các sản phẩm được thêm gần đây nhất: $_productCollection = Mage::getResourceModel('catalog/product_collection') ->addAttributeToSelect('*') ->addAttributeToFilter($preorderAttribute, array( 'eq' => Mage::getResourceModel('catalog/product') ->getAttribute($preorderAttribute) ->getSource() ->getOptionId($preorderValue) )) ->setVisibility(array(2,3,4)) ->setOrder('created_at', 'desc') ->setPage(1, 12); Tôi muốn lọc thêm theo danh mục, ví dụ: các danh mục có id 3 và 4. …
Khi sử dụng trang web của chúng tôi, bạn xác nhận rằng bạn đã đọc và hiểu Chính sách cookieChính sách bảo mật của chúng tôi.
Licensed under cc by-sa 3.0 with attribution required.