Custom Template - 2 Options - 1 Personalization

Questions and answers about ShopSite Custom Templates

Custom Template - 2 Options - 1 Personalization

Postby accrete » Sat Nov 10, 2012 11:33 pm

Been working on custom templates for a new store. I'm new to ShopSite but not new to developing sites.

The site is using Manager.

I have a template developed that has a product with 2 options:
    No extras thanks
    with the extra pc which will be personalized

I have it set up and working. It adjusts the cart price accordingly when the extra pc option is selected. There is a text box visible on the product page at all times for the personalization.

What I want:

If default title or no extras selected
the text box is not shown

If the with the extra pc w/ personalization is selected
show the text box

Code: Select all
               
<form action="[-- SHOPPING_CART_URL Base --]/order.cgi" method="post">
<p>
<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 --]" /></p>
 [-- IF PRODUCT.DisplayOrderingOptions --]
   [-- PRODUCT.OptionText --]
   [-- Order_Option_Menu NoFormat --]
[-- END_IF --]
[-- IF PRODUCT.OptionsBox --]
  <p>Please enter text below:</p>
  <textarea name="[-- PRODUCT.Recordnumber --]:freeopt" cols="[-- PRODUCT.OptionsBoxColumns --]" rows="[-- PRODUCT.OptionsBoxRows --]"></textarea>
[-- END_IF --]
<p><strong>Quantity:</strong>
<input type="text" size="3" value="1" name="[-- PRODUCT.RecordNumber --]:qnty" /></p>
<p class="center"><input class="add" type="submit" value="Add to Cart" /></p>
</form>


I already tried something like:
If finopt:2 and End if around the text box but that didn't work.

What I need is an onchange for the selection.
Onchange,
If they select w/ personalization
Show textbox

Any ideas on how to get this to work as I want?
accrete
 
Posts: 11
Joined: Sat Nov 10, 2012 11:05 pm

Re: Custom Template - 2 Options - 1 Personalization

Postby Jim » Sat Nov 24, 2012 3:01 pm

It has been a while and no one has replied so I guess there isn't a direct answer.
I don't know how it could be done either but if there is a style associated with the field perhaps you could change the style to hidden if the option is selected that doesn't require the text box and if the option is selected which requires the text box you could change the style so the box displays.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Custom Template - 2 Options - 1 Personalization

Postby accrete » Sat Nov 24, 2012 8:55 pm

I have done this with a shopping cart where you get to put the form and button coding in yourself instead of your way of calling a function.

Where is the coding of this function being fetched from? You can answer in private if you don't want it public knowledge. It needs cleaning up anyways because it is not standards compliant.
accrete
 
Posts: 11
Joined: Sat Nov 10, 2012 11:05 pm

Re: Custom Template - 2 Options - 1 Personalization

Postby Jim » Sun Nov 25, 2012 2:07 am

The code is generated by compiled C code, so there is no way that you can modify what is output by the template tag.

The format that you are using [-- Order_Option_Menu NoFormat --] just returns a list of the options with very little, if any, formatting. Have you tried it without the "NoFormat" in the template tag? You might also try using that and pass the values to a CALL script that does some formatting on the data.

The tag [-- IF PRODUCT.OptionsBox --] will just return if the product has that option checked. It will not be specific as to which option the box applies to, so if the product has the box checked the same value will be returned for each option.
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 22 guests

cron