Template add'l info is not being captured

Questions and answers about ShopSite Custom Templates

Template add'l info is not being captured

Postby dafiwow » Wed Dec 26, 2012 9:29 pm

My custom template worked for two years, now that I upgraded to ShopSite 11.2 (Pro) the information entered in the four additional fields is not being captured/recorded. My subproducts with radio buttons work and are sent to the shopping cart, but the main product with the addition fields information is not being sent to the cart. Can you please tell me what has to be changed?
Here is my template coding:

[-- DEFINE SUBPRODUCT --]
<input type="radio" checked="checked" name="itemnum" value="[-- PRODUCT.RecordNumber --]">[-- PRODUCT.Name --]
[-- IF PRODUCT.SaleAmount --][-- PRODUCT.SaleAmount --][-- ELSE --]
[-- PRODUCT.Price --][-- END_IF --]
[-- END_DEFINE SUBPRODUCT --]

[-- DEFINE PRODUCT --]
<CENTER>
[-- INCLUDE Product-Graphic PROCESS --]
[-- INCLUDE Product-Name PROCESS --]
[-- INCLUDE Product-Sku PROCESS --]
[-- INCLUDE Product-Description PROCESS --]

<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
<input type=hidden name="[-- PRODUCT.RecordNumber --]:finoptnum" value=4>

<input name="[-- PRODUCT.RecordNumber --]:finopt:0" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:0" value="Name "><b>Name</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:0" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:0" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:1" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:1" value="Member Number "><b>Member Number</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:1" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:1" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:2" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:2" value="Chapter Affiliation "><b>Chapter Affiliation</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:2" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:2" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:3" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:3" value="Number of previous Ride-Ins attended "><b>Number of previous Ride-Ins attended</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:3" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:3" value="" size="5"><br>

<br>

########################
# SUBPRODUCTS #
########################
<form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method=post>
<input type=hidden name=storeid value=[--Store.id--]>
<input type=hidden name=dbname value=products>
<input type=hidden name=function value=add>

<TABLE>
<TR><TD>
[-- IF PRODUCT.SubProduct --]
[-- LOOP SUBPRODUCTS --]
[-- SUBPRODUCTS --]<br>
[-- END_LOOP SUBPRODUCTS --]
[-- ELSE --]
<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
[-- END_IF --]
</TD><TD>

########################
# ADD TO CART #
########################
<input type=image src="[-- OUTPUT_DIRECTORY_URL --]/media/add_to_cart.gif" width=83 height=20 alt="add_to_cart.gif" hspace=3 vspace=3 border=0 align="bottom" name="Add to Cart" alt="Add to Cart">
</TD></TR></TABLE>
</form>
[-- INCLUDE Product-GraphicRight PROCESS --]
[-- END_DEFINE PRODUCT --]
dafiwow
 
Posts: 17
Joined: Mon Jan 24, 2011 8:58 pm
Location: Wisconsin

Re: Template add'l info is not being captured

Postby Jim » Wed Dec 26, 2012 10:09 pm

It looks like all of these inputs are outside of the <form ...> ... </form>
========================
<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
<input type=hidden name="[-- PRODUCT.RecordNumber --]:finoptnum" value=4>

<input name="[-- PRODUCT.RecordNumber --]:finopt:0" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:0" value="Name "><b>Name</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:0" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:0" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:1" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:1" value="Member Number "><b>Member Number</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:1" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:1" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:2" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:2" value="Chapter Affiliation "><b>Chapter Affiliation</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:2" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:2" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:3" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:3" value="Number of previous Ride-Ins attended "><b>Number of previous Ride-Ins attended</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:3" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:3" value="" size="5"><br>
===============================
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Template add'l info is not being captured

Postby dafiwow » Thu Dec 27, 2012 6:37 pm

Okay, I added the <form> and </form> coding and am still not seeing the additional four field information being captured/recorded. The fields are displayed and allow entry of information, but the information entered is not recorded. In the past a record with zero price (the product) was listed in the cart with the information entered in the additional fields. This is not longer happening. The subproducts are working great as radio button options. Here is what I now have: (Did I put the form coding in the wrong place?)

[-- DEFINE SUBPRODUCT --]
<input type="radio" checked="checked" name="itemnum" value="[-- PRODUCT.RecordNumber --]">[-- PRODUCT.Name --]
[-- IF PRODUCT.SaleAmount --][-- PRODUCT.SaleAmount --][-- ELSE --]
[-- PRODUCT.Price --][-- END_IF --]
[-- END_DEFINE SUBPRODUCT --]

[-- DEFINE PRODUCT --]
<CENTER>
[-- INCLUDE Product-Graphic PROCESS --]
[-- INCLUDE Product-Name PROCESS --]
[-- INCLUDE Product-Sku PROCESS --]
[-- INCLUDE Product-Description PROCESS --]

<form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method=post>
<input type=hidden name=storeid value=[--Store.id--]>
<input type=hidden name=dbname value=products>
<input type=hidden name=function value=add>

<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
<input type=hidden name="[-- PRODUCT.RecordNumber --]:finoptnum" value=4>

<input name="[-- PRODUCT.RecordNumber --]:finopt:0" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:0" value="Name "><b>Name</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:0" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:0" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:1" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:1" value="Member Number "><b>Member Number</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:1" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:1" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:2" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:2" value="Chapter Affiliation "><b>Chapter Affiliation</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:2" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:2" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:3" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:3" value="Number of previous Ride-Ins attended "><b>Number of previous Ride-Ins attended</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:3" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:3" value="" size="5"><br>

</form>
<br>

########################
# SUBPRODUCTS #
########################
<form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method=post>
<input type=hidden name=storeid value=[--Store.id--]>
<input type=hidden name=dbname value=products>
<input type=hidden name=function value=add>

<TABLE>
<TR><TD>
[-- IF PRODUCT.SubProduct --]
[-- LOOP SUBPRODUCTS --]
[-- SUBPRODUCTS --]<br>
[-- END_LOOP SUBPRODUCTS --]
[-- ELSE --]
<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
[-- END_IF --]
</TD><TD>

########################
# ADD TO CART #
########################
<input type=image src="[-- OUTPUT_DIRECTORY_URL --]/media/add_to_cart.gif" width=83 height=20 alt="add_to_cart.gif" hspace=3 vspace=3 border=0 align="bottom" name="Add to Cart" alt="Add to Cart">
</TD></TR></TABLE>
</form>
[-- INCLUDE Product-GraphicRight PROCESS --]
[-- END_DEFINE PRODUCT --]
dafiwow
 
Posts: 17
Joined: Mon Jan 24, 2011 8:58 pm
Location: Wisconsin

Re: Template add'l info is not being captured

Postby Jim » Thu Dec 27, 2012 10:01 pm

I'm not entirely sure what you are trying to accomplish. Are the extra fields suppose to be entered for every product, every subproduct, etc.
But I think you probably put the form tags in the wrong place, or rather you have the input fields in the wrong place and you don't have a submit for that form.
You already had the <form... ></form> tags in this section:
Code: Select all
########################
# SUBPRODUCTS #
########################
<form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method=post>
<input type=hidden name=storeid value=[--Store.id--]>
<input type=hidden name=dbname value=products>
<input type=hidden name=function value=add>

<TABLE>
<TR><TD>
[-- IF PRODUCT.SubProduct --]
[-- LOOP SUBPRODUCTS --]
[-- SUBPRODUCTS --]<br>
[-- END_LOOP SUBPRODUCTS --]
[-- ELSE --]
<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
[-- END_IF --]
</TD><TD>

########################
# ADD TO CART #
########################
<input type=image src="[-- OUTPUT_DIRECTORY_URL --]/media/add_to_cart.gif" width=83 height=20 alt="add_to_cart.gif" hspace=3 vspace=3 border=0 align="bottom" name="Add to Cart" alt="Add to Cart">
</TD></TR></TABLE>
</form>


You should probably move these lines of code

Code: Select all
<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
<input type=hidden name="[-- PRODUCT.RecordNumber --]:finoptnum" value=4>

<input name="[-- PRODUCT.RecordNumber --]:finopt:0" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:0" value="Name "><b>Name</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:0" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:0" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:1" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:1" value="Member Number "><b>Member Number</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:1" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:1" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:2" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:2" value="Chapter Affiliation "><b>Chapter Affiliation</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:2" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:2" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:3" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:3" value="Number of previous Ride-Ins attended "><b>Number of previous Ride-Ins attended</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:3" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:3" value="" size="5"><br>


somewhere within that existing form, either in the [-- ELSE --] section or perhaps before the <TABLE> in a separate table.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Template add'l info is not being captured

Postby dafiwow » Fri Dec 28, 2012 6:36 pm

I want the information entered in the four fields to be recorded with each product. I was told two years ago that I had to use the same custom template for each subproduct and the product to get these field to record. With the update to ver. 11 it no longer works. The following is the template that worked prior to the upgrade:

[-- DEFINE SUBPRODUCT --]
<input type="radio" checked="checked" name="itemnum" value="[-- PRODUCT.RecordNumber --]">[-- PRODUCT.Name --]
[-- IF PRODUCT.SaleAmount --][-- PRODUCT.SaleAmount --][-- ELSE --]
[-- PRODUCT.Price --][-- END_IF --]
[-- END_DEFINE SUBPRODUCT --]

[-- DEFINE PRODUCT --]
<CENTER>
[-- INCLUDE Product-Graphic PROCESS --]
[-- INCLUDE Product-Name PROCESS --]
[-- INCLUDE Product-Sku PROCESS --]
[-- INCLUDE Product-Description PROCESS --]

<br>

########################
# SUBPRODUCTS #
########################
<form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method=post>
<input type=hidden name=storeid value=[--Store.id--]>
<input type=hidden name=dbname value=products>
<input type=hidden name=function value=add>

<TABLE>
<TR><TD>
[-- IF PRODUCT.SubProduct --]
[-- LOOP SUBPRODUCTS --]
[-- SUBPRODUCTS --]<br>
[-- END_LOOP SUBPRODUCTS --]
[-- ELSE --]
<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
[-- END_IF --]
</TD><TD>

<input type=hidden name=storeid value=[--Store.id--]>
<input type=hidden name=dbname value=products>
<input type=hidden name=function value=add>

<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
<input type=hidden name="[-- PRODUCT.RecordNumber --]:finoptnum" value=4>

<input name="[-- PRODUCT.RecordNumber --]:finopt:0" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:0" value="Name "><b>Name</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:0" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:0" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:1" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:1" value="Member Number "><b>Member Number</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:1" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:1" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:2" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:2" value="Chapter Affiliation "><b>Chapter Affiliation</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:2" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:2" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:3" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:3" value="Number of previous Ride-Ins attended "><b>Number of previous Ride-Ins attended</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:3" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:3" value="" size="5"><br>

########################
# ADD TO CART #
########################
<input type=image src="[-- OUTPUT_DIRECTORY_URL --]/media/add_to_cart.gif" width=83 height=20 alt="add_to_cart.gif" hspace=3 vspace=3 border=0 align="bottom" name="Add to Cart" alt="Add to Cart">
</TD></TR></TABLE>
</form>
[-- INCLUDE Product-GraphicRight PROCESS --]
[-- END_DEFINE PRODUCT --]

This no longer sends the selected subproduct or the product (RI-Full Member) to the cart and I get the following message:

"RI-Full Member" has no options and has not been added to the cart.

If I put those lines of code in a separate table, I get the following error:

Unable to find auth file for 1eca5a84855a184179e025c7739aa4a0c7,*1eca5a84855a184179e025c7739aa4a0c7:BAD INPUT.
I regenerated the entire store and all the other pages work, except the one using the product using this custom template.

Where do I go from here?
dafiwow
 
Posts: 17
Joined: Mon Jan 24, 2011 8:58 pm
Location: Wisconsin

Re: Template add'l info is not being captured

Postby Jim » Fri Dec 28, 2012 6:57 pm

There should only be one input statement of each type in the form. These lines are duplicated.
Code: Select all
<input type=hidden name=storeid value=[--Store.id--]>
<input type=hidden name=dbname value=products>
<input type=hidden name=function value=add>

Code: Select all
<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">


I'm not sure if there is anything else but try removing one copy of each of the above and see if it works. The reason it can't find the auth file is because you have the [-- STORE.ID --] in the form twice so they get combined into one store ID so instead of *1eca5a84855a184179e025c7739aa4a0c7 it becomes *1eca5a84855a184179e025c7739aa4a0c7*1eca5a84855a184179e025c7739aa4a0c7 which can't be decoded so it doesn't know what the authfile should be.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Template add'l info is not being captured

Postby dafiwow » Sat Dec 29, 2012 12:43 pm

Thanks, removing the duplicate lines got rid of the error messages. I still have my original issue that the data entered in the four additional fields is not being recorded. The lines of code is inside the <form> </form> and <table </table> commands. When I put them in a separate table, it changes the sequence of how the items are displayed on the screen, but still doesn't record the add'l info. Is the sequence of the code lines correct? Is there some command needed for each finopt number to make them be recorded?
This is the current template:
[-- DEFINE SUBPRODUCT --]
<input type="radio" checked="checked" name="itemnum" value="[-- PRODUCT.RecordNumber --]">[-- PRODUCT.Name --]
[-- IF PRODUCT.SaleAmount --][-- PRODUCT.SaleAmount --][-- ELSE --]
[-- PRODUCT.Price --][-- END_IF --]
[-- END_DEFINE SUBPRODUCT --]

[-- DEFINE PRODUCT --]
<CENTER>
[-- INCLUDE Product-Graphic PROCESS --]
[-- INCLUDE Product-Name PROCESS --]
[-- INCLUDE Product-Sku PROCESS --]
[-- INCLUDE Product-Description PROCESS --]

<br>

########################
# SUBPRODUCTS #
########################
<form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method=post>
<input type=hidden name=storeid value=[--Store.id--]>
<input type=hidden name=dbname value=products>
<input type=hidden name=function value=add>


<TABLE>
<input type=hidden name="[-- PRODUCT.RecordNumber --]:finoptnum" value=4>

<input name="[-- PRODUCT.RecordNumber --]:finopt:0" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:0" value="Name "><b>Name</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:0" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:0" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:1" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:1" value="Member Number "><b>Member Number</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:1" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:1" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:2" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:2" value="Chapter Affiliation "><b>Chapter Affiliation</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:2" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:2" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:3" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:3" value="Number of previous Ride-Ins attended "><b>Number of previous Ride-Ins attended</b><br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:3" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:3" value="" size="5"><br>

<TR><TD>
[-- IF PRODUCT.SubProduct --]
[-- LOOP SUBPRODUCTS --]
[-- SUBPRODUCTS --]<br>
[-- END_LOOP SUBPRODUCTS --]
[-- ELSE --]
<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
[-- END_IF --]
</TD><TD>


########################
# ADD TO CART #
########################
<input type=image src="[-- OUTPUT_DIRECTORY_URL --]/media/add_to_cart.gif" width=83 height=20 alt="add_to_cart.gif" hspace=3 vspace=3 border=0 align="bottom" name="Add to Cart" alt="Add to Cart">
</TD></TR></TABLE>
</form>
[-- INCLUDE Product-GraphicRight PROCESS --]
[-- END_DEFINE PRODUCT --]
dafiwow
 
Posts: 17
Joined: Mon Jan 24, 2011 8:58 pm
Location: Wisconsin

Re: Template add'l info is not being captured

Postby Jim » Sat Dec 29, 2012 4:47 pm

What are you expecting to happen?
1. should the fields only appear on the page once?
2. should the fields appear on the page for each subproduct?
3. are the fields suppose to be applied to the parent product?
4 are the fields suppose to be applied to the subproduct?

Nothing, that I can think of, changed from a previous version of ShopSite to ShopSite 11sp2 that affected the finopt functionality.

Do you have the exact template that you were using prior to the upgrade?
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Template add'l info is not being captured

Postby dafiwow » Sat Dec 29, 2012 10:13 pm

My expectations are:
1. The fields should appear on the page once. Which they do
2. No the fields are not to appear for each subproduct
3. The fields are to be applied to the parent product
4. The fields are to be applied to the subproduct which is selected by the radio button
I was told that both the parent product and the subproducts must be setup to use the same template in order for the info entered in the four fields to be recorded. So I do have parent and subproducts using the custom template.

Yes, I have the template that I used last year. It now generates the ""RI-Full Member" has no options and has not been added to the cart."
error message. (RI-Full Member is the parent product)

Here is the template from last year:
[-- DEFINE SUBPRODUCT --]
<input type="radio" checked="checked" name="itemnum" value="[-- PRODUCT.RecordNumber --]">[-- PRODUCT.Name --]
[-- IF PRODUCT.SaleAmount --][-- PRODUCT.SaleAmount --][-- ELSE --]
[-- PRODUCT.Price --][-- END_IF --]
[-- END_DEFINE SUBPRODUCT --]

[-- DEFINE PRODUCT --]
<CENTER>
[-- INCLUDE Product-Graphic PROCESS --]
[-- INCLUDE Product-Name PROCESS --]
[-- INCLUDE Product-Sku PROCESS --]
[-- INCLUDE Product-Description PROCESS --]

<br>

########################
# SUBPRODUCTS #
########################
<form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method=post>
<input type=hidden name=storeid value=[--Store.id--]>
<input type=hidden name=dbname value=products>
<input type=hidden name=function value=add>
<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
<input type=hidden name="[-- PRODUCT.RecordNumber --]:finoptnum" value=4>

<input name="[-- PRODUCT.RecordNumber --]:finopt:0" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:0" value="Name ">Name<br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:0" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:0" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:1" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:1" value="Member Number ">Member Number<br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:1" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:1" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:2" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:2" value="Chapter Affiliation ">Chapter Affiliation<br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:2" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:2" value="" size="15"><br>

<input name="[-- PRODUCT.RecordNumber --]:finopt:3" type=hidden id="[-- PRODUCT.RecordNumber --]:finopt:3" value="Number of previous Ride-Ins attended ">Number of previous Ride-Ins attended<br>
<input name="[-- PRODUCT.RecordNumber --]:finopt:3" type="text" id="[-- PRODUCT.RecordNumber --]:finopt:3" value="" size="5"><br>

<TABLE>
<TR><TD>
[-- IF PRODUCT.SubProduct --]
[-- LOOP SUBPRODUCTS --]
[-- SUBPRODUCTS --]<br>
[-- END_LOOP SUBPRODUCTS --]
[-- ELSE --]
<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
[-- END_IF --]
</TD><TD>

########################
# ADD TO CART #
########################
<input type=image src="[-- OUTPUT_DIRECTORY_URL --]/media/add_to_cart.gif" width=83 height=20 alt="add_to_cart.gif" hspace=3 vspace=3 border=0 align="bottom" name="Add to Cart" alt="Add to Cart">
</TD></TR></TABLE>
</form>
[-- INCLUDE Product-GraphicRight PROCESS --]
[-- END_DEFINE PRODUCT --]
dafiwow
 
Posts: 17
Joined: Mon Jan 24, 2011 8:58 pm
Location: Wisconsin

Re: Template add'l info is not being captured

Postby Jim » Sat Dec 29, 2012 10:47 pm

According to the help http://www.shopsite.com/help/11.0/en-US/templates/custom.template.cheatsheet.product.html the template tag [-- PRODUCT.Parent --] must be included with all subproducts.
[-- PRODUCT.Parent --]Returns the product ID of the parent product. All subproducts must include this tag as a hidden form field with the name "super", like this:
<input type=hidden name="super" value="[-- PRODUCT.Parent --]">

I don't see that tag in the template anywhere. The code <input type=hidden name="super" value="[-- PRODUCT.Parent --]"> probably needs to be added to the DEFINE SUBPRODUCT section.

I don't see how this code could have ever worked. If the fields are suppose to be added just once but the value needs to be for both the parent and the subproduct there is no way that the that could be accomplished unless both the parent and the subproduct are added to the shopping cart at the same time. The values for the tag [-- PRODUCT.RecordNumber --] will be placed in the html when the pages is published. So the value for the subproducts will each be set when from the code in the DEFINE SUBPRODUCT section is evaluated during the loop. All the other values will be set for the parent product. Say you have 4 products, 1 parent and 3 subproducts and their record numbers are 1, 2, 3,4. During the publish, all values for [-- PRODUCT.RecordNumber --] in the form will be set 1 with the exception of the 3 radio button inputs for the subproducts and they will be set to 2,3,4 respectively for the 3 subproducts.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Template add'l info is not being captured

Postby dafiwow » Mon Dec 31, 2012 9:46 pm

In looking at the receipts from last year, the product is sent to the cart at the same time as the selected subproduct - the add'l info fields are listed below the product and not below the subproducts in the cart. How do I have the product sent to the cart too?
dafiwow
 
Posts: 17
Joined: Mon Jan 24, 2011 8:58 pm
Location: Wisconsin

Re: Template add'l info is not being captured

Postby dafiwow » Fri Jan 04, 2013 3:24 pm

I have tried putting the product.parent tag in the subproduct definition with no change in results.
I have tried putting the 4 input name statements in the else statement with the result that the fields are not displayed on the screen.

Is there a manual or tutorial available explaining how to code in whatever language these templates are written in?
The help....template...cheatsheet link lists the tags, but does not give me any example code to learn how to setup commands.
Thank you for your help over the last weeks. I'm sorry to be such a pest, but I don't understand why the templates stopped working once I upgraded to ver. 11 of ShopSite.
dafiwow
 
Posts: 17
Joined: Mon Jan 24, 2011 8:58 pm
Location: Wisconsin

Re: Template add'l info is not being captured

Postby Jim » Fri Jan 04, 2013 9:56 pm

There are some tutorials on our main website http://www.shopsite.com/designer_tools.html is the main page and it links to the template "cookbook" that gives examples of using various template tags.

The basic language of the ShopSite templates is html, with template tags representing what would be hard code text on an html page. So when creating a template it is usually best to start with a functioning html page and then replace parts that can change on the page with the appropriate ShopSite template tags. For example on a very simple html page you could have
Code: Select all
<html>
    <head>
       <title>This is text that displays in the browser window title
       </title>
    </head>
    <body>
       <center>This is my page name></center>
      .... other content ...
    </body>
</html>

To make it more general so it could be used on multiple pages you add template tags that represent the text instead of the text itself.
Code: Select all
<html>
    <head>
       <title>[-- PAGE.Title --]
       </title>
    </head>
    <body>
       <center>[-- PAGE.name --]</center>
      .... other content ...
    </body>
</html>


What you are trying to do, adding 2 products to the cart at the same time, is described in a sample page and product template in the help. http://shopsite.com/help/11.2/en-US/install/custom.template.multi-add.html However since this will be for a single product and its subproduct you might need to include the code all in the product template and not have any in the page template. The basic idea is to make sure that you have multiple items being added (using sku, productID or GUID) in a single form instead of in multiple forms.

I sent you a PM with another suggestion.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Template add'l info is not being captured

Postby dafiwow » Mon Jan 07, 2013 3:15 pm

Hi,
Would you please resend the PM as I found I had not updated my email address -- thus did not receive the one you sent 1-4-13
Thanks,
dafiwow
 
Posts: 17
Joined: Mon Jan 24, 2011 8:58 pm
Location: Wisconsin

Re: Template add'l info is not being captured

Postby Jim » Mon Jan 07, 2013 3:50 pm

A PM doesn't go out as an email (although you would get an email saying your received a PM) when you log in to the forum a box should pop up saying your have a Private Message and there will be a link to it.

I'll send the same thing to your email address.
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 23 guests

cron