How to create a $1 bargains page in Magento
At some of our Magento projects we were required to create custom pages that contained a large collection of products that meet specific requirements. An example? The € 2, - gadgets page at www.chinese-gadgets.nl/2-euro-gadgets. Because the promotion 'Catalog Price Rules' slow down Magento extremely - and in addition to that would be just a workaround. We have solved this problem by creating a custom block on which we apply our filters directly to the productCollection and calling this block through a simple Layout XML Update on a CMS page.
The main advantage of this way of realizing such pages in Magento is that the toolbar, pagination, navigation layered, caches & indexes all continue to function correctly. You could use this method for a variety of things, given that you can obviously use a custom template to display the products anyway you want. You could use this method to create a:
- 'Favorites' product page
- $1 bargain page
- Featered product slider
- Bestsellers block or page
Enought said, here is how you create a €1 Bargain page in Magento:
Step one
Create a new CMS page, name it and click on the design tab. Place the following in the Layout XML Update field:
Note that I have set 2 as the categoryId, because this the id of my root category. I actually want to display ALL the products in my store that meet the price filters, but you could also use a specific category. Be sure that you use the correct id of your category and be sure that it's set to be an Anchor (or it won't display any products in the first place).
Step two
In the XML update above, you can see we call catalog/product_bargains as the block type. What we are going to do now, is creating a custom block where we actually apply our custom pricefilters. To do so, make a copy of /app/code/core/Mage/Catalog/Block/Product/List.php, create the directory /app/code/local/Mage/Catalog/Block/Product and place it there. Rename this file to Bargains.php
Step three
Edit Bargains.php and change the class definition (the first line of actual code, line number 35):
to
Then scroll to around line 59, and you'll that this is where your productCollection is build. This is the part that we are going to extend with our filters. At line 89, you'll see the following defintion:
Below this definition, place the following code:
What the first two lines do is pretty straightforward. We calculate the max price excluding tax (19% in the Netherlands) and CurrencyRate and apply an attribute filter, which is in this case the price. Save the file, and view your bargains CMS page. You'll see that you have successfully created a custom filtered collection page, that behaves exactly as a normal category page.


LiQcrX,
People in the whole world order the already written essays or custom essays at the writing service reffering to this post. The students heard about the essay writing from the writing services.
When you buy essay papers at professional academic papers writing firms, you can be sure that you are completely safe.
is the script updated for 1.6? anyone tried?
i put this code in product description view.phtml file 87 num line and it works very nice
Do not want to be frustrated anymore? Have complex research papers to compose? Don’t realize even how to begin? Do not worry so much and just buy cheap custom term paper!