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

Magento

eCommerce Software for Online Growth

Magento Forum

   
ways to show products at the home page
 
Kimura
Member
 
Avatar
Total Posts:  47
Joined:  2008-04-21
Hungary
 

nobody knows?

 Signature 

sokkal szerényebben

 
Magento Community Magento Community
Magento Community
Magento Community
 
joseph
Jr. Member
 
Total Posts:  11
Joined:  2007-12-19
Winnipeg, Manitoba, Canada
 

@Kimura
I am using a custom attribute “featured on homepage”, not new products.  The code is the same that is shown at: http://www.magentocommerce.com/boards/viewreply/18209/

It shows the items, even after they have been set to “no” in the admin section.  see: http://www.littlezenminds.com/index.php for our site

 Signature 

WInnipeg Web Design & New Media Marketing
http://www.vinemultimedia.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
vichuNakamura
Jr. Member
 
Total Posts:  4
Joined:  2008-05-02
 

UPDATE!! o yeah!!! it works… i just do it everything again, and now is working!!
Thanks!!

hi,
i recently install magento in a server and im trying to use this script, buy i get this error.

NoticeUndefined variableblock  in /home/antury/public_html/store/app/code/core/Mage/Core/Model/Email/Template/Filter.php on line 47
Trace
:
#0 /home/antury/public_html/store/app/code/core/Mage/Core/Model/Email/Template/Filter.php(47): mageCoreErrorHandler(8, 'Undefined varia...', '/home/antury/pu...', 47, Array)
#1 /home/antury/public_html/store/lib/Varien/Filter/Template.php(122): Mage_Core_Model_Email_Template_Filter->blockDirective(Array)
#2 /home/antury/public_html/store/app/code/core/Mage/Cms/Block/Page.php(75): Varien_Filter_Template->filter(Array, Array)
#3 /home/antury/public_html/store/app/code/core/Mage/Core/Block/Abstract.php(554): Mage_Cms_Block_Page->_toHtml('

thanks for answer!!
SeeYa!

 
Magento Community Magento Community
Magento Community
Magento Community
 
speedfight
Jr. Member
 
Total Posts:  1
Joined:  2008-05-09
 

Paul,
Glad to hear you’re starting to get things sorted. The reason that it’s showing in one column, is because you embedded the block in a column of the sample table that comes with magento. That table was hard-coded for design reasons in some of the earlier reasons to show the look that “could” be achieved. You’ll probably want to remove the block from the table and alter the css that controls the homepage.phtml to achieve a “best-sellers table” look.

Dan

Could anybody explain how to do that?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Andrea, Argentina
Sr. Member
 
Total Posts:  158
Joined:  2007-12-05
Buenos Aires, Argentina
 

Hi all. I need help showing two rows of new products.

Now my code is showing two rows but the same three new products in each row.

Here is my code:

////////////////
<?php if (($_products = $this->getProductCollection()) && $_products->getSize()): ?>
<div class="box recently">
<div class="recently-list-head"><h3><?php echo $this->__('Novedades') ?></h3></div>
<div class="recently-list-middle">
<table cellspacing="0" class="recently-list" id="recently-compared-list-table">
<tr>
<?php $i=0; foreach ($_products->getItems() as $_product): ?>
<?php if ($i>2): continue; endif; ?>
<td>
<div>
<a href="<?php echo $_product->getProductUrl() ?>” title="<?php echo $this->htmlEscape($_product->getName()) ?>">
<img class="product-image" src="<?php echo $_product->getSmallImageUrl() ?>” width="80" height="77" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/>
</a>
</div>
<p><a class="product-name" href="<?php echo $_product->getProductUrl() ?>” title="<?php echo $this->htmlEscape($_product->getName()) ?>)"><?php echo $this->htmlEscape($_product->getName()) ?></a></p>
<?php echo $this->helper('review/product')->getSummaryHtml($_product, 'short') ?>
<?php echo $this->helper('catalog/product')->getPriceHtml($_product) ?>
<?php if($_product->isSaleable()): ?>
<button class="form-button" onclick="setLocation(’<?php echo $this->getAddToCartUrl($_product) ?>’)"><span><?php echo $this->__('Add to Cart') ?></span></button>
<?php else: ?>
<div class="out-of-stock"><?php echo $this->__('Out of stock') ?></div>
<?php endif; ?>
<div class="clear"></div>
<p class="add-to">
<?php if ($this->helper('wishlist')->isAllow()) : ?>
<a href="<?php echo $this->getAddToWishlistUrl($_product) ?>” class="link-cart"><?php echo $this->__('Add to Wishlist') ?></a>
<?php endif; ?>
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?><br/>
<a href="<?php echo $_compareUrl ?>"><?php echo $this->__('Add to Compare') ?></a>
<?php endif; ?>
</p>
</td>
<?php $i++; endforeach; ?>
</tr>
<tr>
<?php $i=2; foreach ($_products->getItems() as $_product): ?>
<?php if ($i>4): continue; endif; ?>
<td>
<div>
<a href="<?php echo $_product->getProductUrl() ?>” title="<?php echo $this->htmlEscape($_product->getName()) ?>">
<img class="product-image" src="<?php echo $_product->getSmallImageUrl() ?>” width="80" height="77" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/>
</a>
</div>
<p><a class="product-name" href="<?php echo $_product->getProductUrl() ?>” title="<?php echo $this->htmlEscape($_product->getName()) ?>)"><?php echo $this->htmlEscape($_product->getName()) ?></a></p>
<?php echo $this->helper('review/product')->getSummaryHtml($_product, 'short') ?>
<?php echo $this->helper('catalog/product')->getPriceHtml($_product) ?>
<?php if($_product->isSaleable()): ?>
<button class="form-button" onclick="setLocation(’<?php echo $this->getAddToCartUrl($_product) ?>’)"><span><?php echo $this->__('Add to Cart') ?></span></button>
<?php else: ?>
<div class="out-of-stock"><?php echo $this->__('Out of stock') ?></div>
<?php endif; ?>
<div class="clear"></div>
<p class="add-to">
<?php if ($this->helper('wishlist')->isAllow()) : ?>
<a href="<?php echo $this->getAddToWishlistUrl($_product) ?>” class="link-cart"><?php echo $this->__('Add to Wishlist') ?></a>
<?php endif; ?>
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?><br/>
<a href="<?php echo $_compareUrl ?>"><?php echo $this->__('Add to Compare') ?></a>
<?php endif; ?>
</p>
</td>
<?php $i++; endforeach; ?>
</tr>
</table>
</div>
<div class="recently-list-bottom"><?php echo $this->__('') ?></div>
</div>
<?php endif; ?>
////////////////////////

Any help?
It would be great to learn this to customize our boxes of products!!
Thank you
Andrea

 
Magento Community Magento Community
Magento Community
Magento Community
 
jonahhill87
Jr. Member
 
Total Posts:  8
Joined:  2008-04-02
 

Hello everyone. I’m very new to magento and was having a hard time finding a way to display products on the homepage as well. I followed Dan’s guide for using the feature attribute and it works well but I would like to have the products display in 3 columns instead of one. jwebber’s code(page2 of thread) looks like a solution but I was just wondering where do I insert the css code? I’m looking in the skin/frontend/default/default/css and there’s 11 css files. If anyone could help me out, I’d really appreciate it. Here is the css code from jwebber’s post. Thanks to Dan and jwebber btw for helping out newbs like me smile

/* Controls featured items on home page */
.home-page-cntr{
    width
445px;
    
floatright;
    
margin0 0 0 15px;
    
border1px solid #ccc;
    
}
.home-page-cntr a{
    text
-decorationnone;
    
font-weightnormal;
    
}
.home-page-cntr a:hover {
    color
#000000;}
.home-page-cntr h3 {
    padding
2px 5px;
    
background-color#eee;
    
border-bottom1px solid #ccc;}
.home-page-item, .home-page-item1{
    float
left;
    
width120px;
    
height170px;
    
padding8px;
    
border-right1px solid #ccc;
    
margin5px 5px 10px 5px;
    
line-height16px;
    
}
.home-page-item1{
    border
-rightnone;
    
}
.home-page-img{
    }
.home-page-txt{
    font
-size11px;
    
font-weightbold;
    
}

 
Magento Community Magento Community
Magento Community
Magento Community
 
Autofittings
Jr. Member
 
Total Posts:  18
Joined:  2008-04-03
 

Here is what Dan_w taught me;

Ok, open up the file boxes.css in whatever skin you are using. I’m guessing it you might just be altering the default? If so, you can find boxes.css in skin->frontend->default->default->css. Add the following line to the file:
.home-page-item{width:150px; padding:7px;}

Make sure that it has that period before the word home. Save the file, refresh cache if enabled and reload the page and see if that makes a difference.

My work in progress;
http://www.autofittings.co.uk

 
Magento Community Magento Community
Magento Community
Magento Community
 
jonahhill87
Jr. Member
 
Total Posts:  8
Joined:  2008-04-02
 

Thanks for the reply Autofittings. But no, that css code does nothing. I see that this class is used in the homepage.phtml file. As Dan says, it is the container for the product items which I think is the reason why the items only display in one column. There must be a way to add table data and row tags using the php for each product item. Lets say I wanted 3 columns, so three products in one row. Once the third product is reached a new table row is made for the 4th, 5th and 6th product item and so on. Does that make sense to anyone? I was thinking a for loop would do this but I’m not sure how it would be done. Anyway, back to jwebber’s css code. This would be placed in the boxes.css file as well? Any help from anyone would really be appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jerry
Jr. Member
 
Total Posts:  2
Joined:  2007-11-26
 

Kind of missing after go thought what had been wirte here…

How can I show the latest 10 products on my front page?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jonahhill87
Jr. Member
 
Total Posts:  8
Joined:  2008-04-02
 

I was able to get my products to display in columns but for some reason I can only display 5 products yet I have about 9 enabled with the feature attribute. I’m using the original code from hompage.phtml that Dan provided and this modified css code. Here’s the codes. Any ideas anyone?

hompage.phtml:

<?php if (($_products $this->getProductCollection()) && $_products->getSize()): ?>
<div class="home-page-cntr">
<?php $i=0; foreach ($_products->getItems() as $_product): ?>
    <?php 
if ($i>5): continue; endif; ?>
<div class="home-page-item">
        <
div class="home-page-img">
            <
a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>">
                 <
img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(125,125); ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/>
            </
a>
        </
div>
        <
div class="home-page-txt">
            <
class="product-name" href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>)"><?php echo $_product->getName() ?></a>
            
<?php echo $this->helper('review/product')->getSummaryHtml($_product'short'?>
            <?php 
echo $this->helper('catalog/product')->getPriceHtml($_product?>        
</div>
</
div>
<?php $i++; endforeach; ?>
<?php 
for($i;$i%5!=0;$i++): ?>
    <?php 
endfor ?>
</div>
<?php endif; ?>

CSS:

.home-page-cntr{
    width
680px;  
    
}
.home-page-cntr a{
    text
-decorationnone;
    
font-weightnormal;
    
}
.home-page-cntr a:hover {
    color
#000000;}
.home-page-cntr h3 {
    padding
2px 5px;
    
background-color#eee;
    
border-bottom1px solid #ccc;}
.home-page-item {
    float
left;
    
width125px;
    
height160px;  
    
margin5px 5px 5px 5px;
    
line-height16px;
    
}
.home-page-item1{
    border
-rightnone;
    
}
.home-page-img{
    }
.home-page-txt{
    font
-size11px;
    
font-weightbold;
    
}

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jono
Member
 
Avatar
Total Posts:  36
Joined:  2008-05-04
Sydney
 

You need to modify the php file

$products->setOrder('hot_deals')->setPageSize(5)->setCurPage(1);

change to

$products->setOrder('hot_deals')->setPageSize("YOURSIZE")->setCurPage(1);

Cheers

 Signature 

check out Weirdo :: T-Shirts for Humans | Weirdo [NZ] | Weirdo Tees | Charitees | Karma Police

 
Magento Community Magento Community
Magento Community
Magento Community
 
Andrea, Argentina
Sr. Member
 
Total Posts:  158
Joined:  2007-12-05
Buenos Aires, Argentina
 

Hi all again… sure somebody could help me!
I wrote a post above with a code to modify to show New products in a grid of (for example) two rows and three columns, instead the way that works by default the NEW.PHTML layout.

Please, read my post and help?

Thanks!!!
Andrea

 
Magento Community Magento Community
Magento Community
Magento Community
 
alkarim
Sr. Member
 
Total Posts:  276
Joined:  2008-04-10
 

hi , does anybody have complete the CSS of this homepage ? I need it. thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
phr34k
Jr. Member
 
Total Posts:  2
Joined:  2008-05-27
 

First, let me say thanks to everyone (especially Dan.)

I am fairly new to Magento and seem to be having a problem… I got Dan’s “featured products” code to work, with a couple of exceptions—my images don’t show up and some of the url’s are incorrect.

To explain in a bit more detail, each “featured product” does indeed show up on the home page, but they all show the default “no image” image. Also, some of the url’s are rewritten while some are not. Some show up as /category/product_name and some show up as /product?id=1234

The images are definitely there— If you view the product, the images show up. That is, of course, unless you click the link that is shown in the “featured products” block...then the images aren’t there. I am totally clueless :-(

I don’t think this is an issue with Dan’s code, I think it has something to do with Magento itself. Any ideas?

Thanks in advance, any help is greatly appreciated!

 
Magento Community Magento Community
Magento Community
Magento Community
 
bloggleme
Sr. Member
 
Total Posts:  91
Joined:  2008-05-06
 
jwebber - 28 March 2008 05:07 PM

Dan, I would like to just get the Final price for an item, instead of showing the strikethrough and Special text. What is the best way to get the final price of an item, whether it is on special or not, and just echo it out as a dollar amount?

I tried this in homepage.phtml but I dont think it pulls the correct Special price:

<?php echo "$".round($_product->getPrice(), 2) ?>

thanks!

<?php echo "$".round(($this->helper('catalog/product')->getFinalPrice($_product)),2?>

That PHP statement will get you what you are looking for smile

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
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
52314 users|430 users currently online|105635 forum posts