Cross-Sell Items on More Info page custom template?

General ShopSite user discussion
Post Reply
MgmtSpec
Posts: 204
Joined: Mon Apr 30, 2007 8:25 am

Cross-Sell Items on More Info page custom template?

Post by MgmtSpec »

Hi,

I've found a few threads regarding this but can't find the answer.
Can I display cross-sell items on PRODUCT MORE INFO pages?
I want to cross-sell by PRODUCT, not GLOBAL.
Looking at the templates it appears they are all for the cart and I get invalid tag errors if I try to incorporated into product templates.
If it can be done can someone show sample code?

I see where and how it can be customized on the cart templates.
Can't imagine why that function is not available on MORE INFO page.
I must be overlooking something.

Please advise!
Jim
Site Admin
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Post by Jim »

The only product template that includes Cross-sell on the moreinformation page is the ModernProductTemplate.sst . If you are creating your own template you should look at that template for an example of how it is done.
MgmtSpec
Posts: 204
Joined: Mon Apr 30, 2007 8:25 am

How to add cross-sell to more info page

Post by MgmtSpec »

Hi,

Yes I saw the thread mentioning that template and tried it yet have problems. It shouldn't be that difficult and I'm sure others would like to know.

If I add the code [-- DEFINE PRODUCT_CROSS_SELL --] to
[-- END_DEFINE PRODUCT_CROSS_SELL --] to my custom prod temp - more info section.

I can only insert OUTSIDE of [-- DEFINE MORE_INFO_PAGE--] or I get errors.

If I try to add (the below from Modern-MoreInfoPage.sst) In the [-- DEFINE MORE_INFO_PAGE--] I get errors.

#<!-- Product Cross-sell -->#
[-- IF PRODUCT.CrossSell "0" --]
#do nothing
[-- ELSE --]
<table id="subproduct_table">
<tr>
<td id="related">[-- STORE.CartCrossSellHeader --]
</td>
</tr>
[-- LOOP PRODUCT_CROSS_SELL 1 --]
<td align="center">[-- PRODUCT_CROSS_SELL --]</td>
[-- END_LOOP PRODUCT_CROSS_SELL --]
</table>
[-- END_IF --]


If I add the [-- DEFINE PRODUCT_CROSS_SELL --] code OUTSIDE the
[-- DEFINE MORE_INFO_PAGE--] on the custom prod template I get the
cross-sell to display on cart pages.

The loop codes in Help files reference either cart-loop or GLOBAL.

Mike
Jim
Site Admin
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Post by Jim »

The
[-- DEFINE PRODUCT_CROSS_SELL --]
...

[-- END_DEFINE PRODUCT_CROSS_SELL --]

is a separate section in the product template and is not included in another section just like

[-- DEFINE MORE_INFO_PAGE --]
...
[-- END_DEFINE MORE_INFO_PAGE --]

[-- DEFINE SUBPRODUCT --]
...
[-- END_DEFINE SUBPRODUCT --]

[-- DEFINE PRODUCT --]
...
[-- END_DEFINE PRODUCT --]

Then in the place where you want your cross-sell items displayed you use code similar to what you copied from the Modern-MoreInfoPage.sst template.

Putting the code in the product template should have no affect on the shopping cart screen because that uses defines from the shopping cart template not the product template.

If you are getting errors what are they? Have you assigned cross-sell products to the product that your more-information page represents? Have you published after making the changes?
MgmtSpec
Posts: 204
Joined: Mon Apr 30, 2007 8:25 am

Cross-sell errors

Post by MgmtSpec »

Hi again,

The custom product template I'm using shows no errors when I generate pages. A cross-sell item is assigned and cross-sell by product set up in SS.

When I add the code:

#<!-- Product Cross-sell -->#
[-- IF PRODUCT.CrossSell "0" --]
#do nothing
[-- ELSE --]
<table id="subproduct_table">
<tr>
<td id="related">[-- STORE.CartCrossSellHeader --]
</td>
</tr>
[-- LOOP PRODUCT_CROSS_SELL 1 --]
<td align="center">[-- PRODUCT_CROSS_SELL --]</td>
[-- END_LOOP PRODUCT_CROSS_SELL --]
</table>
[-- END_IF --]


I get:

wp-product [14]: DEFINE MORE_INFO_PAGE illegal for page template
wp-product [16]: Template Error: Product tag is not allowed
wp-product [17]: Template Error: Product tag is not allowed
wp-product [18]: Template Error: Product tag is not allowed
wp-product [71]: Template Error: Product tag is not allowed
wp-product [74]: Template Error: Product tag is not allowed
wp-product [77]: Template Error: Product tag is not allowed
wp-product [79]: Template Error: Product tag is not allowed
wp-product [83]: Template Error: Product tag is not allowed
wp-product [100]: Template Error: LOOP has illegal parameter: 1
wp-product [101]: Template Error: Product tag is not allowed
wp-product [102]: Template Error: END_LOOP tag does not have a matching LOOP tag
wp-product [118]: Template Error: END_DEFINE needs a matching DEFINE tag

Which the errors do not make sense - I know DEFINE MORE_INFO_PAGE is a PRODUCT definition and that it is NOT a PAGE template. W/O the cross sell loop and toggle I get NO errors when publishing....

I thought do I need to define Cross Sell outside of MORE INFO DEFINE - which produced the same errors.

Maybe I'm missing something obvious due to lack of sleep!
Jim
Site Admin
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Post by Jim »

The first error message says
wp-product [14]: DEFINE MORE_INFO_PAGE illegal for page template

So is this a page template or a product template? Note that product templates contain the definition for the moreinformation page since that is information about the product.
MgmtSpec
Posts: 204
Joined: Mon Apr 30, 2007 8:25 am

Odd Error

Post by MgmtSpec »

Jim wrote:The first error message says
wp-product [14]: DEFINE MORE_INFO_PAGE illegal for page template

So is this a page template or a product template? Note that product templates contain the definition for the moreinformation page since that is information about the product.
Yup - it is a PRODUCT template - see the template name of 'wp-product'
I often use product or page in the template to make sure I keep them straight. So getting the error "illegal for page template" only happens when I add the cross sell tags - w/o that I got no errors....
MgmtSpec
Posts: 204
Joined: Mon Apr 30, 2007 8:25 am

GOT IT!

Post by MgmtSpec »

Thanks Jim!

The key was placing the [-- DEFINE PRODUCT_CROSS_SELL --] ABOVE the MORE INFO DEFINE on the product template since SS will generate the code in order. Placing it below caused the errors since cross-sell was undefined when SS tried to generate the page.
Post Reply