New looped output

Questions and answers about ShopSite Custom Templates

New looped output

Postby avefenix » Sun Oct 03, 2010 7:31 am

Although it is very heavily modified, I started with the modern theme. Recently on the more info page I decided to put the 'folks who purchased...' (cross sell) data under the product data, and that's just fine. In my case this is frequently an accessory or battery or such that adds to the original product. THEN I got the idea that I would like to also add a 'related products' offering, and I got to thinking how I could select and load SKUs to a delimited extra product field (local software before upload), define a 'RELATED PRODUCT' template, and loop them out. Great plan, huh? The LOOP specs seemed to bring me back to earth.

OK, then. Can LOOP and END_LOOP be made to deal with other than product and cross sell? I could JS a simulation, but I'm not a whiz on JS and it would take me awhile.

Thanks
avefenix

Lo contrario del amor no es el odio, sino la indiferencia
The opposite of love is not hate, but indifference
Charley Christman
avefenix
 
Posts: 22
Joined: Fri May 01, 2009 4:57 am
Location: Costa Rica

Re: New looped output

Postby Jim » Sun Oct 03, 2010 8:18 am

In a product template, depending on which level of ShopSite you have and which version, there is a loop tag for subproducts, product cross-sell and global cross-sell. In a page template there are loops for Links, products, global corss-sell and "items" (which is a mixture of the pages and products). LOOP tags cannot be made to handle other fields.

You could used the extra page field (or extra product field on a moreinfo page) to specify information you want to add to a page but all information would need to be in that field since it would not be able to access the database to get additional information such as price, description etc.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: New looped output

Postby avefenix » Mon Oct 04, 2010 8:26 am

Well, Jim, thanks for the info, even though it wasn't what I hoped for.

I think this is going to be an embarrassment for me, but I CANNOT find the original define product_cross_sell, AND no matter where I put mine, at pub I get an error something about already in the template block, documentation for which I cannot find either. I'm on ver9, and the basic logic is still from the Modern Theme.

Can you guide me a bit .
Charley Christman
avefenix
 
Posts: 22
Joined: Fri May 01, 2009 4:57 am
Location: Costa Rica

Re: New looped output

Postby Jim » Mon Oct 04, 2010 10:13 am

Cross-sell products were only allowed in the cart in ShopSite 9. The ability to add them to store pages and product more information pages was added in ShopSite 10 sp1. So you would need to upgrade to 10 sp1 or 10sp2 to get that functionality. You an see it in the New Features list on this page: http://www.shopsite.com/help/10.1/en-US/new-features.html In the Commerce Tools section.

Prior to ShopSite 10 sp1 cross selling products on store pages was done using the subproduct feature.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: New looped output

Postby avefenix » Mon Oct 04, 2010 12:12 pm

Jim, I read that twice, and I'm responding too fast, but I don't think I'm misinterpreting.

First of all, I have v. 9 0 3 0 1 and I have product cross sell on the more info page. In fact, I believe it was there from the beginning with the Modern theme. I DID have to get creative to get the cart itself out on the more info page. I had them in the right sidebar, and the form or the cross sell was just name and price. Just now I felt it was a little isolated up there, and moved it down below the more info data section. There I can control it for columns and such, but I have been unsuccessful at either finding the define for it, or specifying one to override, so that I could put in the image, and maybe a bit more. I only use it for accessories or batteries and such, to complete or augment the original product.

It was then that the original question came up, because I liked the idea of yet another section in the same ilk, with related, similar, or such products, to give the client some options, but I'm off that right now. Just the way to change the definition of the PRODUCT_CROSS_SELL. I've done text level searches on much of the code on the site. The following is working well, but only puts out name and price.

#FNCR Working on a cross sell table before the boilerplate and below the MI data.
#<!-- Product Cross-sell -->#
[-- IF PRODUCT.CrossSell "0" --]
#do nothing
[-- ELSE --]
# Put out the table
<div class="products">
<table class="products" width="100%" align="center" border="[-- VAR.border --]" cellpadding="3" cellspacing="0">
<tr>
<td id="related" colspan="2">People who ordered [-- PRODUCT.Name--] also ordered:
</td>
</tr>
[-- LOOP PRODUCT_CROSS_SELL 2 --]
<td valign="top" align="left">[-- PRODUCT_CROSS_SELL --]</td>
[-- END_LOOP PRODUCT_CROSS_SELL --]
</table>
</div>
[-- END_IF --]

Thanks, Jim - This is not the most important thing on my plate.
Charley Christman
avefenix
 
Posts: 22
Joined: Fri May 01, 2009 4:57 am
Location: Costa Rica

Re: New looped output

Postby Jim » Mon Oct 04, 2010 12:55 pm

There was only one product template theme (Modern) that tried to implement the cross-sell on a moreinfo page in ShopSite 9 but the feature was not fully functional in that version for the moreinfo pages. I believe the DEFINE for the product layout came from the shopping cart template Modern-Cart.sst. The Defines for the cross-sell are at the end of the file so try editing that and see if you can make it display the way you want. Note that the same format will be used for the shopping cart and the moreinfo page so you need to make sure it looks good in both places.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: New looped output

Postby avefenix » Mon Oct 04, 2010 1:30 pm

Thanks again, Jim.

I'll work on it in the morning and let you know.

In line with your comment, the CART cross sell I have not changed either. It has a small photo and looks good. In fact, it would be a step up for the product cross sell if it were just like that. With your help I'm starting to feel that I will get all this under control soon.

Best from Costa Rica
Charley Christman
avefenix
 
Posts: 22
Joined: Fri May 01, 2009 4:57 am
Location: Costa Rica

Re: New looped output

Postby avefenix » Tue Oct 05, 2010 4:14 am

OK, Jim, Like I said, this was going to be an egg on face operation.

The only product file for the Modern Theme in the Products Folder is ModernProductTemplate.sst which I had modified to allow distinct individual page image sizes and others, but at that time I didn't even know about DEFINES. I just went to the 'modern' product file , searched around in the HTML, and made changes.

It turns out that there are four DEFINES in that file: Subproduct, Product_Cross_Sell, Product (which I had modified without seeing that it was a define), and More_Info_Page (which just calls the modern one or the default).

I have now modified the Product_Cross_Sell, and all is well.

Thanks very much for your guidance. In spite of all the modifications, I was just coming to grips about all this code being specified inside DEFINES, and how they worked. My father always said I just dug in looking for gizzards, when I didn't even know if it was a chicken.

Close this one.

Charley in Costa Rica
Charley Christman
avefenix
 
Posts: 22
Joined: Fri May 01, 2009 4:57 am
Location: Costa Rica


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 5 guests