Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 5 of 5
“Featured Product” feature
 
davidgrun
Sr. Member
 
Total Posts:  245
Joined:  2008-07-10
 

It just started working for me!
No clue what did it… all I can say is I fixed all the compatibility probles the the Lazzymonk’s Blog extension…

My code in the CMS (following BungleFeet’s tutorial):

<!-- *********** Display FEATURED Products - block *********** -->
{{block type="catalog/product_featured" num_products="9" orderby="rand()" template="catalog/product/featured.phtml" }}

 
Magento Community Magento Community
Magento Community
Magento Community
 
chrisandy
Sr. Member
 
Total Posts:  92
Joined:  2007-10-17
 

Yours is the closest solution I’ve seen after a lot of searching but I’m trying to do something slightly different.

Instead of just showing featured products I’m trying to show all products of the selected category in a static block - is this possible.

The answer would seem to lie in changing the following:

$_productCollection $this->get??????();
?>

But to what?

Many thanks and apologies if this is off at a tangent.

 
Magento Community Magento Community
Magento Community
Magento Community
 
JustinZ
Member
 
Total Posts:  36
Joined:  2008-09-17
 

So ive gotten BungleFeet’s method to work

but when the users click an image it jsut goes to ( Home / Product Name ) instead of say ( Home / Apparel / Product Name )

is there any way to fix this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
MacKniven
Member
 
Total Posts:  51
Joined:  2009-01-09
 

I have BungleFeets original post to work well. I take away the orderby="rand()" as I want them ordered by date added instead.The only problem is that it automatically sorts the products by “ASC"ending and I really need them newest first which is “DESC"ending.

I think that an ASC is getting thrown into the SQL statement, any ideas how I can sort them descending?

 
Magento Community Magento Community
Magento Community
Magento Community
 
MacKniven
Member
 
Total Posts:  51
Joined:  2009-01-09
 

Thanks to a bit of help from BungleFeet, I have come up with a work around for my own problem and a’m posting here incase it helps others…

In the featured.phtml file when it is doing the “foreach” loop, I just make it write each value into a new array.
Once that array is written, I use the php statement
array_reverse

and that then gives me a new array with all the values reversed and when I print it out it is as if it was sorted by DESC instead of ASC.

Here’s the code…

<?php $i=0; foreach ($_productCollection as $_product): ?>
            
                <?php $newarray[]
$_product ?>
            
    <?php 
endforeach ?>

    <?php $newarray 
array_reverse($newarray?>
    <?php $i
=0; foreach ($newarray as $_product): ?>
            
<li class="item">
                
                <
h5><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->htmlEscape($_product->getName()) ?></a></h5>             
                
            </
li>
    
<?php endforeach ?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
t_rodriguez
Sr. Member
 
Avatar
Total Posts:  229
Joined:  2009-01-14
 

@andy101010, @Ron Phillips, @BungleFeet: many tnx! On Magento 1.3.2.4 works fine.

 
Magento Community Magento Community
Magento Community
Magento Community
 
stephane1405
Jr. Member
 
Total Posts:  1
Joined:  2010-01-05
 

Thank you Andy for this great tuto,

When getting on a category page I get the following error message :

Can’t retrieve entity config: catalog/product_store

I think it’s coming from this line in app/code/local/MyCompany/Catalog/Block/Product/Featured.php :
$productStoreTable = $resource->getTableName(’catalog/product_store’);

I’ve only got one store on my website.

Have you got any ideas ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
EYEMAGINE
Member
 
Avatar
Total Posts:  35
Joined:  2008-02-14
Irvine, CA
 

Hi Stephane,

I haven’t seen that error, but the module was created quite a while ago.  You many need to update the table reference and change it from catalog/product_store to catalog/product_website and pass the website ID instead of the store ID?

Andy

 
Magento Community Magento Community
Magento Community
Magento Community
 
magewidgets
Jr. Member
 
Avatar
Total Posts:  18
Joined:  2010-03-24
USA
 

for anyone moving to 1.4 or on 1.4 and wants this functionality in a widget that can be embed anywhere on your site in 1 click . Its available here http://www.magewidgets.com/featured-products-widget.html

 
Magento Community Magento Community
Magento Community
Magento Community
 
carlosrob4
Member
 
Total Posts:  67
Joined:  2012-10-28
 

You can do it by using this advance Featured products Magento extension to display items at homepage.

View Demo

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 5 of 5