Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Magento Forum

   
Page 10 of 12
ways to show products at the home page
 
DDMAN
Sr. Member
 
Total Posts:  101
Joined:  2008-01-08
 

did you follow the instrucitons in this wiki http://www.magentocommerce.com/wiki/groups/248/display_products_on_home_page and then make the changes I outlined in post #134 of this thread?

It looks like you did something different

 
Magento Community Magento Community
Magento Community
Magento Community
 
zero cool
Jr. Member
 
Total Posts:  4
Joined:  2008-08-26
 

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.

How to display the list of products on the homepage? Like this: http://www.sentientclothing.co.uk/

 
Magento Community Magento Community
Magento Community
Magento Community
 
DDMAN
Sr. Member
 
Total Posts:  101
Joined:  2008-01-08
 

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?

 
Magento Community Magento Community
Magento Community
Magento Community
 
pixelpusher
Member
 
Avatar
Total Posts:  62
Joined:  2008-04-23
SoCal
 

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?

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  421
Joined:  2008-07-11
New Haven, CT
 

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.

 Signature 

@ My Magento Blog

- Handy tutorials on programming and designing Magento. A continual work in progress!
- Now with a new design, new hosting and a new domain! Check it out!

 
Magento Community Magento Community
Magento Community
Magento Community
 
pixelpusher
Member
 
Avatar
Total Posts:  62
Joined:  2008-04-23
SoCal
 

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?

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  421
Joined:  2008-07-11
New Haven, CT
 

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).

 Signature 

@ My Magento Blog

- Handy tutorials on programming and designing Magento. A continual work in progress!
- Now with a new design, new hosting and a new domain! Check it out!

 
Magento Community Magento Community
Magento Community
Magento Community
 
pixelpusher
Member
 
Avatar
Total Posts:  62
Joined:  2008-04-23
SoCal
 

its actually a really easy fix although you do have to edit the core code.
in
app/code/core/Mage/Catalog/Block/Product/New.php

find

$products   $product->setStoreId($storeId)->getCollection()
            
            ->
addAttributeToFilter('news_from_date', array('date'=>true'to'=> $todayDate))
            ->
addAttributeToFilter(array(array('attribute'=>'news_to_date''date'=>true'from'=>$todayDate), array('attribute'=>'news_to_date''is' => new Zend_Db_Expr('null'))),'','left')
            ->
addAttributeToSort('news_from_date','desc')
            ->
addAttributeToSelect(array('name''price''small_image'), 'inner')
            ->
addAttributeToSelect(array('special_price''special_from_date''special_to_date'), 'left')
        ;

then add

$products->addAttributeToSelect('status');

right after it.

So now you can move to the thumbnail image size problem wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  421
Joined:  2008-07-11
New Haven, CT
 

edit: double post

 Signature 

@ My Magento Blog

- Handy tutorials on programming and designing Magento. A continual work in progress!
- Now with a new design, new hosting and a new domain! Check it out!

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  421
Joined:  2008-07-11
New Haven, CT
 

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.

Hope that helps.

 Signature 

@ My Magento Blog

- Handy tutorials on programming and designing Magento. A continual work in progress!
- Now with a new design, new hosting and a new domain! Check it out!

 
Magento Community Magento Community
Magento Community
Magento Community
 
tronics
Member
 
Total Posts:  33
Joined:  2008-01-17
 

you have to use this to use resize:

<img class="product-image" src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(200); ?>” alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/>

Regards,
tronics

 
Magento Community Magento Community
Magento Community
Magento Community
 
mollon
Jr. Member
 
Total Posts:  3
Joined:  2008-09-03
Mexico City
 

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.

This is the code that I’m usign under CMS:

{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}

{{block type="catalog/product_list" category_id="13" template="catalog/product/listNew.phtml"}}

What do I need to do to apply the “listNew.phtml” template to the “product_new” block?

If I just change the template for this block it sends me some errors.

Help, please.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  421
Joined:  2008-07-11
New Haven, CT
 
mollon - 03 September 2008 09:36 AM

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.

This is the code that I’m usign under CMS:

{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}

{{block type="catalog/product_list" category_id="13" template="catalog/product/listNew.phtml"}}

What do I need to do to apply the “listNew.phtml” template to the “product_new” block?

If I just change the template for this block it sends me some errors.

Help, please.

I’m not sure I understand what you are changing -

What are the errors?

 Signature 

@ My Magento Blog

- Handy tutorials on programming and designing Magento. A continual work in progress!
- Now with a new design, new hosting and a new domain! Check it out!

 
Magento Community Magento Community
Magento Community
Magento Community
 
mollon
Jr. Member
 
Total Posts:  3
Joined:  2008-09-03
Mexico City
 
nikefido - 04 September 2008 05:24 AM

mollon - 03 September 2008 09:36 AM


I’m not sure I understand what you are changing -

What are the errors?

Ok, I just want that the “new products” look the same as the “featured products” at my home page: http://www.mymobishop.net/index.php

This is the code that I’m using under CMS/Manage Pages/Home page:

{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}

{{block type="catalog/product_list" category_id="13" template="catalog/product/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.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
IrishC
Member
 
Total Posts:  69
Joined:  2008-01-29
 

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.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 10 of 12
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
52316 users|472 users currently online|105637 forum posts