Product looping for homepage

General ShopSite user discussion

Product looping for homepage

Postby natez311 » Sat Nov 07, 2009 1:46 pm

Hi,

I am looking to list products that have the highest amount of sales on my homepage, otherwise the default would be just listing products alphabetically or something along that line. What type of loops would allow for this and are there any examples up currently? Thanks in advance!
Thanks!

-Nate
natez311
 
Posts: 26
Joined: Fri Oct 30, 2009 10:52 am
Location: New York

Postby Jim » Sat Nov 07, 2009 8:18 pm

There is nothing in ShopSite that keeps track of the products that have the highest sales. So you would need to manually select the products that you find have the highest sales and assign them to the page.

Some merchants use one of the custom product fields to contain a value that they then use a a sort key for assigning certain products to a page. This requires a custom page template and possibly a custom product template to look for the key value that you entered on the extra product field and do a loop looking for products with the value set.

Check the ShopSite custom template help and the cook book for more information. Start at:
http://www.shopsite.com/help/10.0/en-US ... lates.html
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby natez311 » Sun Nov 08, 2009 10:55 am

Hi Jim,

Thanks for your answer. Is there any way to loop and list any product in your store? For now this is what I am doing on the homepage:

<ul>
[-- IF PAGE.NumProducts 0 --]
# skip this section
[-- ELSE --]
[-- LOOP PRODUCTS 4 --]
<li>[-- PRODUCT --]</li>
[-- END_LOOP PRODUCTS --]
</ul>

From there I would like to list 4 random products from my store. Is this possible? I have 3 products in my store so far and it is only showing 1 at the moment from the code above. Thanks again!
Thanks!

-Nate
natez311
 
Posts: 26
Joined: Fri Oct 30, 2009 10:52 am
Location: New York

Postby Jim » Sun Nov 08, 2009 2:48 pm

Only products actually assigned to the page can be displayed on the page. So unless you assign all products to the page you can't display a random selection of them.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: No registered users and 117 guests

cron