63

Magento's CRUD models have three basic class types. A "model" is what you'll most commonly use. This represents data of a particular type in a database agnostic way (product, category, CMS Page, Review, etc.) A "resource model" is a class that, behind the scenes, does the actual fetching of data from Magento. Every model has a resource model that is used ...


27

If you need to change every category page to 2column-left, then use this layout update File : app/design/frontend/<package>/<theme>/layout/local.xml <layout> <catalog_category_layered> <reference name="root"> <action method="setTemplate"> <template>page/2columns-left.phtml</template&...


24

The problem is the new rwd design has two child blocks for the product list: <block type="core/text_list" name="product_list.name.after" as="name.after" /> <block type="core/text_list" name="product_list.after" as="after" /> And in the template itself there are not checks to see if these are present before they are attempted to be loaded and ...


20

Go to admin Store > Configuration > Catalog > Storefront Now there are two things Products per Page on Grid Allowed Values Enter your desired no here with comma like 12,24,48,96 Products per Page on Grid Default Value Value you enter here must be defined in Allowed Values. like you can enter from these values only 12,24,48,96. See how it ...


18

Layout wise, magento distinguishes categories as default categories and layered categories. Magento uses is anchor option in order to make this categorization. If is anchor is set to yes, then that category would be layered category and if it is set tono, then that category will treat as a default catetgory. What happens when we set the property is anchor ...


15

Make sure the attribute manufacturer (and others that you want to list) have the flag Use in product listing set to Yes. After setting the flag you should rebuild your product flat index if Flat catalog is enabled.


15

To change the product page layout: From the Admin menu, select Catalog > Manage Products. Find the product in the list, and click to open the record. In the Product Information panel on the left, select Design. Then in the Design section, set Page Layout to a different column configuration. When complete, click the Save button. To change the category ...


13

Adding attributes via layout XML is obselete as of CE 1.3/EE 1.8: http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/catalog/add-attributes-to-product-grid#update_layout_xml So, there are two ways to add to your collections: Rewrite and Extend: Rewrite Mage_Catalog_Block_Product_List and extend the protected method ...


12

For that you have to change into XML file for your template. NOTE: Don’t direct change the value into base file for this tutorials. Because It will may affect other places. So XML file Change is more preferable. Step 1 : Open your template file folder like app/design/frontend/default/YOUR THEME/layout. Step 2 : Open your catalog.xml file and find the ...


11

If the product names aren't the same, and you only are sorting by name, the order of the products with the same name is undefined. A simple solution might be to enable the flat product catalog of Magento under System > Config > Catalog > Frontend After reindexing, Magento will use the flat table for the store view on product listing pages on ...


11

Solution 1 This moves out of stock products to the end of the list on page, not all over the pagination: 1.Add event observer: <frontend> <events> <catalog_block_product_list_collection> <observers> <ssd_test> <type>model</type> <...


11

You can do that if you create new module to override this block: vendor\magento\module-catalog\Block\Product\ListProduct.php to override this block, you need to create di.xml at app\code\Vendor\Module_Name\etc di.xml content: <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:...


11

You have to override core file into your theme, Category layered navigation comes form core file, vendor/magento/module-layered-navigation/view/frontend/templates/layer/view.phtml You have to get files from core and keep in your theme, app/design/frontend/{Vendor}}/{themename}}/Magento_LayeredNavigation/templates/layer/view.phtml Now you can set ...


10

There are many extensions out there that will give you this functionality (search for "enhanced layered navigation"). I have tried all of the extensions listed below but my favourite is by Ecommerce Team - I like it for its minimalistic nature, it doesn't try to do too much but is very powerful and works well out of the box. It also has support for color ...


10

To set the column count for a particular category, select that category in the backend under Manage Categories. Then select the Custom Design tab—here, add in the following code and modify as needed: <reference name="product_list"> <action method="setColumnCount"><count>3</count></action> </reference>


9

Try this. I worked for me: $products = Mage::getModel('catalog/product')->getCollection(); $products->addAttributeToSelect(array('name', 'thumbnail', 'price')); //feel free to add any other attribues you need. Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products); Mage::getSingleton('catalog/product_visibility')->...


9

add the following code in your local.xml file <catalog_category_layered translate="label"> <reference name="root"> <action method="setTemplate"> <template>page/2columns-left.phtml</template> </action> </reference> </catalog_category_layered>


9

Either set keepFrame to true, so it's always exact 160x210, or set keepAspectRatio to false. Now it is making sure both width and height won't exceed the values you feed it. But since you don't want a frame, and want to keep your aspect ratio, it has to change both width and height in the same ratio. <?php echo $this->helper('catalog/image')->...


8

It would be better to override the getCacheKeyInfo() method instead of getCacheKey(). public function getCacheKeyInfo() { $info = parent::getCacheKeyInfo(); // Add any additional data you want $info[] = Mage::app()->getRequest()->getOriginalRequest()->getRequestUri(); return $info; } The hashing of the value is taken care of ...


8

If you are only interested in converting default layered navigation to check boxes the solution is very easy and placing it here. Edit the code of app/design/frontend/ourpackage/ourtheme/template/catalog/layer/filter.phtml file as follows: <ol> <?php foreach ($this->getItems() as $_item): ?> <li> <?php if ($_item->...


8

I have run into the same issue during a site I am managing. The proposed solutions do not appeal to me, as they require creating blocks to extend the core product list class, or as proposed to manipulate the collection directly in a template. I wanted a cleaner way, and found one. Since we are not interested in a linkfest, I re-created (most) of my blog ...


8

Easiest way to do this is to create a custom extension that works with an Observer and a Cronjob. Create a category for the sales products. This way you can use the normal Magento functionalities in the frontend like layered navigation etc. To get the products in this category automatically we will use the observer and cronjob. The observer will observe ...


8

I have found another way of implementing this, which has some distinct advantages over the {{block}}-in-a-CMS-page method. Shows the native toolbar, for sorting/pagination Makes your "All" products "page" show up in the category navigation menu (you can change this with "Show In Navigation" dropdown.) Allows you to set the default sorting preferences, to ...


8

My suggestion is to look into the Mage_Catalog_Block_Product_List class. I think the problem with the filters not being applied is caused by how you initialize the product collection in the brand helper getProductCollection function. Maybe you could try doing something like this in your helper: public function getLayer() { $layer = Mage::registry('...


8

In System > Configuration > Catalog > Configurable Swatches set Product Attribute to Use for Swatches in Product Listing to -- Please Select --


8

Better to use as: <?php if($filter->getRequestVar() != 'cat') { // ... } ?>


8

Update your extended catalog_category_view.xml file and Find it at your extended theme path app/design/frontend/vendorname/themename/Magento_Catalog/layout/catalog_category_view.xml To remove compare from listing Page use this code <referenceBlock name="category.product.addto.compare" remove="true"/> I hope this will help you if not then let me ...


8

quick workaround can be add a condition in theme templates file Magento_Catalog/templates/product/list/toolbar/sorter.phtml like if $key != 'position' then don't add in drop down options : <select id="sorter" data-role="sorter" class="sorter-options"> <?php foreach ($block->getAvailableOrders() as $_key => $_order): ?> <?...


8

You can get Media collection of particular product by loading it in custom helper as below: <?php namespace Your\Module\Helper; use Magento\Catalog\Api\ProductRepositoryInterface; class Data extends \Magento\Framework\Url\Helper\Data { public function __construct( ... ProductRepositoryInterface $productRepository, ... ) {...


7

Make sure your attribute is available on product listing page by setting "Used in Product Listing" to "Yes" when editing your attribute — screenshot Add your logic to template/catalog/product/list.phtml to show Add to Cart/View details button


Only top voted, non community-wiki answers of a minimum length are eligible