Displaying sub-products on More Info page but not on prod pg

General ShopSite user discussion

Displaying sub-products on More Info page but not on prod pg

Postby bobthebuilder » Tue Oct 07, 2008 8:17 pm

I'm using the "DefaultCustomProductTemplate" template. I've run into a snag. On my store page I do "NOT" want to display any sub-product information. However, when the user click on a product to go to a "More Info" page then I want to display sub-products of the main product. I haven't been able to figure out what template tags I should use in the template to make this happen. Below is the template I'm using. Thanks in advance.

---------------------


# Generic Product Template with No "View Cart" button

#########################
[-- DEFINE SUBPRODUCT --]
#########################
[-- IF VAR.MoreInfoTemplate --]
<div class="Subproduct">
[-- IF ANALYTICS_MULTI_DOMAIN --]
<form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method="post" onSubmit="javascript:__utmLinkPost(this)">
[-- ELSE --]
<form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method="post">
[-- END_IF --]

[-- INCLUDE Subproduct-Name PROCESS --]
[-- INCLUDE Subproduct-Price PROCESS --]
[-- INCLUDE Subproduct-AddToCartButton PROCESS --]
</div>
[-- ELSE --]
[-- INCLUDE Subproduct-Name PROCESS --]
[-- INCLUDE Product-Price PROCESS --]
[-- INCLUDE Subproduct-AddToCartButton PROCESS --]
[-- END_IF --]

#############################
[-- END_DEFINE SUBPRODUCT --]
#############################



######################
[-- DEFINE PRODUCT --]
######################
### Set a bunch of variables ###
[-- VAR.TableLayout no --]
#[-- VAR.Form no --]
[-- VAR.Options no --]
[-- VAR.Quantity no --]
[-- VAR.Graphic no --]

### Start the form for Add to Cart button ###
[-- IF PRODUCT.Subproduct --]
# do nothing
[-- ELSE --]
[-- IF ANALYTICS_MULTI_DOMAIN --]
<form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method="post" onSubmit="javascript:__utmLinkPost(this)">
[-- ELSE --]
<form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method="post">
[-- END_IF --]
[-- END_IF --]

#####################
# GRAPHIC ALIGNMENT #
#####################
[-- INCLUDE Product-GraphicAlign PROCESS --]

####################
# PRODUCT GRAPHIC #
####################
[-- INCLUDE Product-Graphic PROCESS --]

########################
# PRODUCT NAME #
########################
[-- INCLUDE Product-Name PROCESS --]

########################
# PRODUCT SUBPRODUCTS #
########################
[-- IF PRODUCT.Subproduct --]
# Product has subproducts, so just show description for this product
# and then loop through subproducts
[-- INCLUDE Product-Description PROCESS --]

[-- VAR.MoreInfo no --]

[-- LOOP SUBPRODUCTS --]
[-- SUBPRODUCTS --]
[-- END_LOOP SUBPRODUCTS --]

[-- ELSE --]
# Product does not have subproducts

####################
# PRODUCT PRICE #
####################
[-- IF PRODUCT.QuantityPricing --]
#do nothing
[-- ELSE --]
[-- INCLUDE Product-Price PROCESS --]
[-- END_IF --]

########################
# PRODUCT SKU #
########################
[-- INCLUDE Product-Sku PROCESS --]

########################
# PRODUCT DESCRIPTION #
########################
[-- INCLUDE Product-Description PROCESS --]

#######################
# ADD TO CART BUTTON #
#######################
[-- INCLUDE Product-AddToCartButton PROCESS --]

# end the IF PRODUCT.subproducts
[-- END_IF --]

###########################
# PRODUCT GRAPHIC #
# align=right, wrap=off #
###########################
[-- INCLUDE Product-GraphicRight PROCESS --]

[-- IF PRODUCT.Subproduct --]
# do nothing
[-- ELSE --]
</form>
[-- END_IF --]

[-- END_DEFINE PRODUCT --]



#############################
[-- DEFINE MORE_INFO_PAGE --]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
#############################
[-- VAR.MoreInfo "yes" --]

[-- IF VAR.MoreInfoTemplate --]
[-- INCLUDE VAR.MoreInfoTemplate PROCESS --]
[-- ELSE --]
[-- INCLUDE Classic-MoreInfoPage PROCESS --]
[-- END_IF --]


[-- VAR.MoreInfo "" --]
[-- END_DEFINE MORE_INFO_PAGE --]
bobthebuilder
 
Posts: 35
Joined: Mon Sep 29, 2008 9:36 am

Postby Jim » Tue Oct 07, 2008 8:22 pm

Remove this part from the Define Product section and put it in the Define moreinfo section.
[-- LOOP SUBPRODUCTS --]
[-- SUBPRODUCTS --]
[-- END_LOOP SUBPRODUCTS --]
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby bobthebuilder » Wed Oct 08, 2008 9:44 am

Thanks Jim. I have another question now. On the MoreInfo page I will be listing the sub-products. I have added the following code to loop through each of the sub-products:

<table width="100%" align="left" border="0" cellpadding="3">
[-- LOOP SUBPRODUCTS 3 --]
<td valign="center" align="left">&nbsp;[-- SUBPRODUCTS --]</td>
[-- END_LOOP SUBPRODUCTS --]
</table>

How can I control what each sub-product looks like in each table cell? Right now each table cell looks like the following:

• Product 6 $0.00 add_to_cart_button

I can't find where the sub-product layout is defined. I would like each table cell with a sub-product look like the following:

Product_Graphic
Product_Name Product_Price
More_Info_Button Add_To_Cart_Button

Thanks in advance.

-Adam
bobthebuilder
 
Posts: 35
Joined: Mon Sep 29, 2008 9:36 am

Postby Jim » Wed Oct 08, 2008 11:39 am

The [-- DEFINE SUBPRODUCT --] section of the product template contains the layout for what the individual subproducts look like on a page. So just edit that section and define how you want it to look.
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 56 guests