PDA

View Full Version : How to display products on home page as featured items



cnoel
June 6th, 2003, 03:44 PM
SEveral months ago you gave me the instructions how to display feature items on the shopping cart 1.0.9 see link

http://www.squirrelcart.com:/forums/viewtopic.php?t=102

I used the same instructions for the upgrade 1.1.0 version but the record displays but without the content. Has the code changed for the demo.php

Please advise

Jamie
June 9th, 2003, 03:46 PM
Hi,

That post is in our old forums, which is no longer available. The same post can be found here:

http://www.ldev.com/forums/showthread.php?s=&threadid=93&perpage=15&pagenumber=2

We made a few changes to the code in the post. Can you please go thought it, and confirm that this is the way you have your's setup?

Thanks,
Jamie

cobra
July 31st, 2005, 05:58 PM
Jamie, how can I add the featured code under or over the right navigation area?

Cobra

LouDog
August 1st, 2005, 10:56 AM
Jamie,

This should maybe be moved to request, but it would be nice to have a area in the admin interface to easily change this. This way it would be easier to change your featured products weekly, monthly, etc. Just a thought.

Louie

PENorwood
January 20th, 2006, 01:10 PM
The site I use squirrelcart on had no need for listing the new products on the front page as is default so with a simple modification of the SQL query used to call the New Products for the main page I changed it to randomly pick four products to be featured. This changes every time the page is refreshed.

My cart is still being worked on and all the products have yet to be added (migrating from a different cart with less features) but if anyone would like to see what I have done with these small changes go to http://store.behlerpublications.com and check it out. I'd be very happy to share my change with anyone who asks.

--Paul Norwood
PEN Development

LouDog
January 20th, 2006, 09:02 PM
I like it... I like it... Please share the info.

Thanks,
Louie

PENorwood
January 21st, 2006, 02:20 AM
To have the cart display random featured products is a two step process. Please back up any files before changing them.

In the file new_product_preview.func.php located at squirrelcart/functions/storefront/common/catalog_viewing look for the area that starts with


// put query together

$query = "
SELECT
p.record_number
FROM
Products p
$stock_join
WHERE
p.Not_For_Sale != 1
AND Date_Added_to_Cart >= '$cutoff_date'
$stock_where
$stock_group_by



All I do is eliminate the WHERE clause of the SQL since it is not necessary for my needs and then change the ORDER BY clause to be this:



ORDER BY
rand() DESC


This pulls all products from the database and then randomly orders them.

Simple.

Finally if you change the category name for New Products to Featured Products it all works well.

Hope this helps!

--Paul Norwood
PEN Development