سؤال

أريد تصفية المنتجات في صفحة قائمة المنتجات وإظهار نوع المنتجات القابلة للتكوين فقط.

في ملف الكتالوج/المنتج/list.phtml بعد

$_productCollection=$this->getLoadedProductCollection(); أنا أضيف

 // First make a copy, otherwise the rest of the page might be affected!
$_productCollection = clone $this->getLoadedProductCollection();

// Unset the current products and filter before loading the next.

$_productCollection->clear()
                   ->addAttributeToFilter('type_id', 'configurable')
                   ->load();

في صفحة قائمة المنتجات تظهر لي رسالة خطأ Column not found: 1054 Unknown column 'e.type_id' in 'where clause'.

ملحوظة:أنا أستخدم امتداد مرشح منتج Amasty.

هل كانت مفيدة؟

المحلول

لا لا لا.

إذا كنت تريد أن تفعل هذا على الجميع الصفحات، فقط قم بإلغاء تنشيط أو إزالة جميع البسطاء من الموقع.

إذا كنت تريد القيام بذلك لصفحات معينة فقط، فيجب عليك تنفيذ مراقب يتم ربطه به catalog_block_product_list_collection وأضف مرشحاتك هناك.

إعادة تحميل قائمة المنتجات يكلف الأداء دون أي فوز.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top