This code : {{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}} was working well.
But I try to follow Dan’s steps. There were many errors, I dont know why.
the code I used will display all products with a new dat on the home page just like the example you posted. if you want to display a whole category then you would probably use something different. Are you lookingto display just new products or a whole category?
Does anyone know how to resize the thumbnails for new and featured lists? It appears that the thumbnails used are the full size product images so the load time for the front page is very slow compared to what it should be. I tried the standard ->resize(80) after getSmallImageUrl() but it doesn’t work. Anyone have a workaround?
Has anyone else run into a problem with these where it does not tell you if the product is in stock even if it is (for instance, the magento-created pages such as category pages successfully show if the product is in stock, but our popular method here of grabbing products does not).
I had to get my product collection via:
$layer = Mage::getSingleton('catalog/layer'); $category = Mage::getModel('catalog/category')->load(5); //'stuff' category $layer->setCurrentCategory($category); $products = $layer->getProductCollection(); //add filters here .. some don't work, such as setting visibility, etc //perhaps using the layer singleton already sets the visibility, etc? It's the method Magento uses to get products in it's category views.
yeah its a common error. There are several threads about the subject, many bug reports with different titles, and even a temp solution. just search for “out of stock”
can anyone verify that the thumbnails being used are the full size product images?
It appears that my method above (using ‘catalog/layer’) only works once per page request and will keep the first category ID you set. I have multiple instances of the above where it loads different categories. This works on separate pages, but on the home page, where it displays products of several categories, this method is now only showing products of the FIRST set category of the layer :(
That SUCKS. The other method of showing products both had the out of stock bug and caused server time outs when users edited products in the back end (admin) area!!!
WTF??
(p.s. sorry pixelpusher, i don’t have a good answer for your particular problem, but I do have a feeling I’m going to be running into that problem as well).
actually it doesn’t give me the solution, because there is a WEIRD error where when people edit the products in the admin section, the front end starts timing out for something like 10-20 minutes.
I had to use the singleton catalog/layer (as Magento does to list category views in the core code) to get around that (for some reason, that works better). This also fixed the out of stock issue. However, it made it so my home page (which shows products of different categories) only show products from one category, as apparently, you can’t change the category of the ‘catalog/layer’ singleton more than once per page request :(
As for your imageproblem:
When you upload images, you’ll notice that there are 3 different image ‘types’ can upload per file (base image, small image, thumbnail). If you didn’t upload one for the “small image” area, then it won’t show an image when you use “getSmallImageUrl()” [I’m not 100% sure of what I’m saying here, just 85% sure]. Do you have an image uploaded in the “small image” area ?
Otherwise, I believe it will show the full image size. I haven’t seen to many places where adjusting the image size via that helper function has worked, but I also have not messed around with it too much yet.
Hi, I’m trying to put the New and Featured products on my home page, but with the same look, if you visit: http://www.mymobishop.net/index.php, you’ll see that the new products are displaying without the “add to cart” button, and the featured has this buttom. I made some modifications to the list.phtml and saved as listNew.phtml.
Hi, I’m trying to put the New and Featured products on my home page, but with the same look, if you visit: http://www.mymobishop.net/index.php, you’ll see that the new products are displaying without the “add to cart” button, and the featured has this buttom. I made some modifications to the list.phtml and saved as listNew.phtml.
But when I change this:
{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}
for this:
{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/listNew.phtml"}}
I get this error:
Fatal error: Call to a member function count() on a non-object in /nfs/c01/h04/mnt/45277/domains/mymobishop.net/html/app/design/frontend/default/modern/template/catalog/product/listNew.phtml on line 29
I just want to apply the listNew template to the New Products Block to make it look the same as the Featured Products Block.
This homepage featured solution doesnt work with the 1.1.4 updgrade, any ideas on how to bring it back into play again? Its a bit beyond my capabilities at present.