Hi, dan, I followed the steps and the featured products did show in homepage, but I also got a fatal error:
Fatal error: Class ‘Mage_Review_Helper_Product’ not found in E:\xampp\htdocs\app\code\core\Mage\Core\Model\App.php on line 779
I was using this:
{{block type=”category/product_list” category_id=”15” template=”catalog/product/list.phtml”}}
After re-reading your post, I changed it to this:
{{block type="catalog/product_list" category_id="15" template="catalog/product/list.phtml"}}
All is well and good in the universe now. Thank you very much!
Thank you mikej165. That works on me. But now, can anybody show how to display the “Shop By” box on the LEFT side so we can sort the items by attribute? because it didnt appear. Thank you very much
<global> .... bunch of stuff... <blocks> <catalog> <!-- block from the other tutorial for featured products on catalog pages --> <rewrite> <product_featured>STORENAME_Catalog_Block_Product_Featured</product_featured> </rewrite> <rewrite> <category_view>STORENAME_Catalog_Block_Category_View</category_view> </rewrite> <!-- block for the homepage feature and goes along with the rest of these changes --> <rewrite> <product_homepage>STORENAME_Catalog_Block_Product_Homepage</product_homepage> </rewrite> </catalog> </blocks> </global>
finally in the CMS > Manage Pages > Home page > Custom Design
My client turned out to not ‘need’ the featured products on the homepage, but I have a feeling they’ll use it more than they know. So to accompany the possibility of not having any products selected as featured I changed the Homepage.php to load the 3 most recently added products (regardless of the new from/to date). I also commented out the getSingleton lines and it still worked, so I don’t know what purpose they served, but it probably reduced some overhead by commenting them out.
So yeah… contributing back
Use in place of the class in my previous post
class STORENAME_Catalog_Block_Product_Homepage extends Mage_Catalog_Block_Product_Abstract { public function __construct() { parent::__construct();
// if less than 3 products have been entered as featured, fall back and get the 3 more recently added products if($_size < 3) { $products = $product->setStoreId($storeId)->getCollection() ->addAttributeToSelect(array('name', 'price', 'small_image'), 'inner') ->addAttributeToSelect(array('special_price', 'special_from_date', 'special_to_date'), 'left') ;
Hi, dan, I followed the steps and the featured products did show in homepage, but I also got a fatal error:
Fatal error: Class ‘Mage_Review_Helper_Product’ not found in E:\xampp\htdocs\app\code\core\Mage\Core\Model\App.php on line 779
Question: How do you list the most viewed products / most popular products on the homepage? I know that the site admin has a section that displays the most viewed products under the Reports section, so there *should* be a way to display that on the frontend. I hope you can point me in the right direction. :D
None of those items are currently new, nor are any of them out of stock (as you can see by viewing them on any other page of the store)! How can that be?
Under the ‘General’ tab on the edit product page you can set as from DATE to DATE, those items will show up.
Should’ve been clearer: I get how it’s supposed to work, and I double- and triple-checked all the settings (make sure the stock setting is correct in multiple places, make sure I know what’s set to “new” for today, etc.), but the items showing up on that “new” page are marked to have stopped being “new” back in July, and other items that are marked “new” aren’t showing up.
On a potentially related note, since I noticed a bizarre date flaw in the Pricing section, what format do you suppose dates are meant to be in? They appear to work correctly when in mm/dd/yy, but if I leave one blank under pricing it autofills in dd/mm/yy — but still behaves as though it were mm/dd/yy, which makes me think that the system reads mm/dd/yy but writes dd/mm/yy. So I’m using mm/dd/yy. But I could be wrong to do so.
I found this wiki http://www.magentocommerce.com/wiki/groups/248/display_products_on_home_page and used the method outlined and it worked like a charm. Didn’t have to adjust any code and I restyled the new.phtml to fit my needs (i.e. got rid of table layout and did a vertical div so products stacked floating left)
I found this wiki http://www.magentocommerce.com/wiki/groups/248/display_products_on_home_page and used the method outlined and it worked like a charm. Didn’t have to adjust any code and I restyled the new.phtml to fit my needs (i.e. got rid of table layout and did a vertical div so products stacked floating left)
Then this is an even greater mystery than I realized, because I copy/pasted exactly the text off that same Wiki page, and I’ve got all the wrong products and they’re marked “out of stock” when they’re not. I saw in another thread (http://www.magentocommerce.com/boards/viewreply/54761/) that someone has put together a patch for the issue, but I would like to see it approved by someone who knows patches (and Magento) before I try it. I’d feel a lot better if I understood why the anomaly affects some installations and not others, though.
I copy/pasted exactly the text off that same Wiki page, and I’ve got all the wrong products and they’re marked “out of stock” when they’re not.
@ Sunday Paper
I apologize I forgot that I had to make one change to a file to get this working
I made a copy of /app/code/Mage/Catalog/Block/Product/New.php and moved it to/app/code/local/Catalog/Block/Product/New.php
I added a line to grab the status of the product so that it knows if it is instock or outofstock. I found this on another post but don’t remember where. With the code change I simply set some products with a date for new in the manage product page and it worked great
The original code looks like this for New.php
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magentocommerce.com so we can send you a copy immediately. * * @category Mage * @package Mage_Catalog * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */
/** * New products block * * @category Mage * @package Mage_Catalog * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Catalog_Block_Product_New extends Mage_Catalog_Block_Product_Abstract { public function __construct() { parent::__construct();
so that you now have in your local copy of New.php
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magentocommerce.com so we can send you a copy immediately. * * @category Mage * @package Mage_Catalog * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */
/** * New products block * * @category Mage * @package Mage_Catalog * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Catalog_Block_Product_New extends Mage_Catalog_Block_Product_Abstract { public function __construct() { parent::__construct();