Bestsellers

Questions and answers about ShopSite Custom Templates

Bestsellers

Postby joediffdez » Thu Jul 07, 2011 9:08 pm

I've seen some sample shopsite sites that have a row of best selling products, how is this done?
www.differentdezine.com
joediffdez
 
Posts: 43
Joined: Mon Aug 23, 2010 3:47 pm

Re: Bestsellers

Postby Jim » Fri Jul 08, 2011 6:27 am

Using the Global or Product cross sell feature would be one way.

Another would be to add some text to a field in the product and then in the template do a loop products and check the products to see if they have the text and if so out put that product.

Another way would be to create the html for products and put that in a text field or and include file and display that in the location you want it.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Bestsellers

Postby joediffdez » Fri Jul 08, 2011 7:52 am

Thank you Jim,

I'm not entirely sure what Global or Product Cross sell is, so I will have to do some more research on that.

I don't really understand your second recommendation.

I was thinking of hard coding the best selling products based on the stats that the ShopSite dashboard provides but I would much rather it be automated based on that list. Since this is a new site we won't have any bestsellers at first so it would probably have to be hard coded but eventually it would be best for me if it could be automated. Would cross selling accomplish this?
www.differentdezine.com
joediffdez
 
Posts: 43
Joined: Mon Aug 23, 2010 3:47 pm

Re: Bestsellers

Postby Jim » Fri Jul 08, 2011 9:20 am

Cross-sell is a ShopSite Pro level feature and is not available in the Manager or Starter versions of ShopSite.
Cross sell is found under Merchandising > Cross sell and is integrated into some of the ShopSite templates provided or can be added to custom templates. Essentially you select a few products that will be the cross sell items either store wide (Global cross-sell) or individually for each product (Product cross-sell).

Depending on the type of cross sell, Global, Product, they will be displayed in different places. Global can be on store pages, more info pages and the shopping cart. Global cross sell items are selected on the Merchandising > Cross sell screen.

Product cross-sell are selected on the Product > Edit Product Info screen for each product individually.
Product cross-sell can be displayed in the shopping cart or on more info pages.

For the second suggestion that would require custom template work but isn't too difficult. I know this has been discussed in the forum so you could probably do a search for multiple loops and find some posts about it.

For the third suggestion you could create a simple page template that only had the loop product section in it and use that for your top sellers page template. Assign products you want to be top sellers to that page and publish. Then load that page in your browser and copy out the section with the products and use that for the code to display your top sellers. If you copied that to an include file (under Merchandising > Custom Templates > includes) you could just use an [-- include filename --] to insert the topsellers into your pages.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Bestsellers

Postby joediffdez » Fri Jul 15, 2011 5:59 pm

Jim wrote:For the third suggestion you could create a simple page template that only had the loop product section in it and use that for your top sellers page template. Assign products you want to be top sellers to that page and publish. Then load that page in your browser and copy out the section with the products and use that for the code to display your top sellers. If you copied that to an include file (under Merchandising > Custom Templates > includes) you could just use an [-- include filename --] to insert the topsellers into your pages.


When you say copy out the code, do you mean grab the html that the page outputs?

Since I would like to use the best sellers on different pages, is this same html what should be put into the include file?
www.differentdezine.com
joediffdez
 
Posts: 43
Joined: Mon Aug 23, 2010 3:47 pm

Re: Bestsellers

Postby Jim » Mon Jul 18, 2011 6:11 pm

Yes you would view the source of the html page and copy out just the section that contains the product information. You could define a minimal page template like this.
[-- DEFINE PAGE --]
<html><head></head>
<body>
<!-- copy code below this line --><br>
[-- Loop Products --]
[-- product --]
[-- end_loop products --]
<br><!-- end copy above this line -->
</body>
</html>
[-- END_DEFINE PAGE --]

Create a page where you will assign you best sellers and set the page template to what you call the above template. Then assign the Best Sellers to that page and publish. Once published you would load the page in the browser and view the page source and copy everything between the comments and paste that into either text fields of pages where you want the best sellers to appear or into a custom template that will be used where you want the best sellers to appear. You could also create an include template file using just that html (lets say you call it "mybestsellers" ) and then use the [-- include mybestsellers --] where you want to include the best sellers in other templates.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Bestsellers

Postby joediffdez » Wed Jul 20, 2011 9:43 am

Thanks Jim...two questions, If we add items to the best sellers page, do we need to go back and copy the code again? And, how do I get the items to appear in one row, not stacked on top of each other?
www.differentdezine.com
joediffdez
 
Posts: 43
Joined: Mon Aug 23, 2010 3:47 pm

Re: Bestsellers

Postby Jim » Wed Jul 20, 2011 9:57 am

Yes you would need to Add or Remove items from the best sellers page and then republish and copy the html code again.

To get item in a single row you would need to include the looping in a table, set the number of items you want on a row where I have NUM, and add an opening and closing <td></td> around the product so it would look something like this.
[-- DEFINE PAGE --]
<html><head></head>
<body>
<!-- copy code below this line --><br>
<table>
[-- Loop Products NUM--]
<td>[-- product --]</td>
[-- end_loop products --]
</table>
<br><!-- end copy above this line -->
</body>
</html>
[-- END_DEFINE PAGE --]
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Bestsellers

Postby joediffdez » Thu Oct 06, 2011 12:49 pm

Jim, I have one more question on this. Is there a way to have the loop use a smaller size image? At the moment it is using the largest size and I need it to use the thumbnail size.
www.differentdezine.com
joediffdez
 
Posts: 43
Joined: Mon Aug 23, 2010 3:47 pm

Re: Bestsellers

Postby Jim » Thu Oct 06, 2011 1:42 pm

The loop outputs the product using the template defined for the product. There are a couple of ways you could change how the product looks.
1. The easiest would be to create a separate product template with a smaller image to use in this situation . Then you change the loop tag so that it uses that template. So in this code
[-- Loop Products NUM--]
<td>[-- product --]</td>
[-- end_loop products --]
replace the [-- product --] with [-- PRODUCT template --] (Note: template tags are not case sensitive so PRODUCT and product and Product would be the same.) The "template" would be replaced with your new template.

2. Another way would be to create two sections of code in the product template, one to display the larger image and the other to display the smaller image. Then just before the [-- Loop Products NUM --] you define a VAR to indicate which section of the product template to use.

Code for page template
# set VAR for which image size to use in the product template.
[-- VAR.imagesize "small" --]
[-- Loop Products NUM--]
<td>[-- product --]</td>
[-- end_loop products --]
# clear the image size VAR until needed again.
[-- VAR.imagesize "" --]

Code for product template
...
[-- IF VAR.imagesize "small" --]
code to output small image
[-- ELSE --]
code to output normal image
[-- END_IF --]

The above code could be done 2 ways. If everything else in the layout will be the same then you could just use the IF statements around the line where the image itself is being output. If there is difference in the layout, in addition to the image size, you could have an entire product layout in each section of code. The first section would be used when the VAR.imagesize is "small" the second section would be executed if the image size is not set (i.e. there was no [-- VAR.imagesize "small" before the [-- loop products num --] code.)

How to specify the image size itself might be a little more difficult. I'm not sure if all image fields can be used in all types of templates. You might be able to use [-- product.graphic --] and [-- PRODUCT.MoreInformationGraphic --] if they are set to different sizes. However, you might have to build the complete url for the image from various tags and specify the size directory and base image name something like.
<img src="[-- OUTPUT_DIRECTORY_URL --]/media/<image size>/[--image product.graphic --]> where <image size> is ss_size1, ss_size2 or ss_size3 for the resized images or blank for the original size image.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Bestsellers

Postby joediffdez » Fri Oct 07, 2011 10:32 am

Jim, thank you for your response. I'm not entirely sure how to do what you are saying here. Maybe by taking a look at the site, www.thebestebooksonline.com/store...scroll down about 1/3 of the page and you will see 5 sections with products: Internet Marketing, Health Diet and Fitness, Children and Young Adults, Selling Internet Tips, Business and Economics. The first section used your suggestion but the images are too big. I need the image sizes to be like the following four sections but with their price, wishlist, add to cart, view cart buttons.

Which of the two suggestions would you recommend and how would you get it to select the image sizes?
www.differentdezine.com
joediffdez
 
Posts: 43
Joined: Mon Aug 23, 2010 3:47 pm

Re: Bestsellers

Postby Jim » Fri Oct 07, 2011 1:53 pm

Please post or send me (by PM or Emails using the links at the right of the post) a copy of the product template you are using for the products displayed in the Internet Marketing section.
Is it just the image you want smaller? If you reduce the size of the images it probably won't make the product boxes smaller because of the text and add and view cart buttons being displayed.

Are the products in the Health, Diet, and Fitness etc sections hand coded? Is that the exact look, i.e. name over image, that you want for all?
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Bestsellers

Postby joediffdez » Fri Oct 07, 2011 8:04 pm

The code I am using is from what you recommended earlier in this post. I have a page template with the following code:
Code: Select all
[-- DEFINE PAGE --]
<html><head></head>
<body>
<!-- copy code below this line --><br />

<div class="features">
<table>
[-- Loop Products 4--]
<td width="25%">[-- product --]</td>
[-- end_loop products --]
</table>
</div>

<br><!-- end copy above this line -->
</body>
</html>
[-- END_DEFINE PAGE --]


I then assigned that to a page, published the page and then copied the code that it generates within the <!-- copy code below this line --><br /> and
<br><!-- end copy above this line --> and put that into an include. The include is then output in the home page's template.


My end goal would be to put 4 images per section, to fit at least 1024 x 768 layout, it is a fluid layout meant to at least accommodate that resolution. If the buttons have to be stacked it shouldn't be an issue. I would like to at least have all of those buttons in there in that order and if the client doesn't like it I can remove things as we go.

As far as the other sections, yes, they are hard coded because initially they weren't going to have the price, and all the other buttons but client changed their mind. I was practicing with the Internet Marketing Section to see if I can make it work before I do it to the remaining sections.
www.differentdezine.com
joediffdez
 
Posts: 43
Joined: Mon Aug 23, 2010 3:47 pm

Re: Bestsellers

Postby Jim » Fri Oct 07, 2011 8:55 pm

What do yo have in the product template? That is what determines what each product block looks like.
It would be the one assigned to the product on the Edit Product > Layout screen.

What sizes have you set for the resized images under Images > Configure?
What size image have you selected for the Product image, for the Product Moreinfo image, and for the Product Extra more info images? ( all on the Product > Edit Product info screen.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 3 guests

cron