Product options code

Questions and answers about ShopSite Custom Templates

Product options code

Postby Kapitol » Mon May 28, 2012 10:43 am

I feel like I should be paying someone at this point. I need to locate and edit a block of code which is displaying pricing options or cross sells. I am having a number of problems with this one issue.

If you goto this page: http://www.artandsoulbeads.com/store/buttons.html
The Swarovski 8mm Butterfly Mixes isn't displaying a price because of the options. Which is perfect. It has checkboxes and this product has 4 options.

My new templates page for the same page is here: http://www.artandsoulbeads.com/store/swarovski_butterfly_beads.html
The Swarovski 8mm Butterfly Mixes is using the same product template as the other page, but the one I am building will use div's instead of a table so I can style it the way I want it.

Problem 1
I dont know where the store is pulling information for the table below. In the back office for Swarovski 8mm Butterfly Mixes there are no pricing options which show that it is using options.
Image
Code: Select all
<table cellspacing="0" cellpadding="0" border="0">
  <tbody>
    <tr><!-- Start of ROW -->
      <td><input type="checkbox" value="2753" name="itemnum">
        &nbsp;
        Swarovski Butterflies: 8mm, Dusk Mix (Pkg of 20)&nbsp; <b>$12.00</b></td>
    </tr>
    <!-- END OF ROW -->
    <tr> <!-- Start OF Next ROW -->
      <td><input type="checkbox" value="1068" name="itemnum">
        &nbsp;
        Swarovski Butterflies: 8mm, Pastel Mix (Pkg of 12)&nbsp; <b>$8.50</b></td>
    </tr>
    <!-- END OF ROW -->
    <tr> <!-- Start OF Next ROW -->
      <td><input type="checkbox" value="2752" name="itemnum">
        &nbsp;
        Swarovski Butterflies: 8mm, Springtime Mix (Pkg of 12)&nbsp; <b>$8.50</b></td>
    </tr>
    <!-- END OF ROW -->
    <tr> <!-- Start OF Next ROW -->
      <td><input type="checkbox" value="2751" name="itemnum">
        &nbsp;
        Swarovski Butterflies: 8mm, Sweet Girl Mix (Pkg of 12) &nbsp; <b>$8.50</b></td>
    </tr>
    <!-- Last One -->
  </tbody>
</table>


Problem 2
There doesnt seem to be any code examples for checkboxes anywhere on this forum or in the cookbook so I don't know how to build a successful
Code: Select all
[-- IF PRODUCT.DisplayOrderQuantity checked --]
area if that is indeed the correct piece of code which display the
Code: Select all
<table>
above.
Kapitol
 
Posts: 52
Joined: Mon May 14, 2012 10:26 pm

Re: Product options code

Postby Jim » Mon May 28, 2012 9:42 pm

The first problem is that you are looking in the wrong place if you are looking for product options. You need to look farther down on the page in the Ordering Options section. My guess is that you have defined prices for the product's options in that section.


Second problem dealing with how to create a check box. I'm not exactly sure what you are asking. Are you wanting to determine if the checkbox for the product display quantity field is checked? or do you want to put a checkbox in your form?

There is an example template in the help for adding multiple products to the cart at one time. It includes a checkbox for the shopper to indicate which products to buy. The example is at http://shopsite.com/help/11.2/en-US/install/custom.template.multi-add.html and it gives the code needed for a checkbox for a specific product.
Code: Select all
<input type=checkbox name=itemnum value=[-- PRODUCT.RECORDNUMBER --]>

So add that code within your form and a checkbox will appear and be assigned to the product that is currently active.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Product options code

Postby Kapitol » Tue May 29, 2012 10:09 am

Thank Jim. After some looking around I after reading your post I found the area where to edit.
Although I would prefer to drop the table and assign each item listed to an unordered list since it gives me more control over the layout, I can live with what we have now.

Unless you know of an easy way to build a product page which gives you access to every single loop. Meaning every PROCESSS template I can change to drop it's table based layout to a more friendly DIV structure CSS based layout.
Kapitol
 
Posts: 52
Joined: Mon May 14, 2012 10:26 pm

Re: Product options code

Postby Jim » Tue May 29, 2012 1:30 pm

For the order options there are two tags that output without a table
Code: Select all
[-- Order_Option_Menu NoFormat --]    Create the order option menu(s) without any table formatting
[-- Order_Option_Menu NoFormat SKU --]    Create the order option menu(s) without any table formatting, use SKU instead of record number


I'm not sure if that is what you are referring to or not. I also haven't used those tags so I didn't know exactly what they output. I created a product template that had just
Code: Select all
[-- DEFINE PRODUCT --]
[-- Product.name --]<p>1<br>
[-- Order_Option_Menu NoFormat --] <br>   Create the order option menu(s) without any table formatting
<p>2<br>[-- Order_Option_Menu NoFormat SKU --] <br>   Create the order option menu(s) without any table formatting, use SKU instead of record number
<P>
[-- END_DEFINE PRODUCT --]


The product had options of
Code: Select all
red
blue
green

large
med
small

and this is the out put on the html page.
Code: Select all
this is my test product<p>1<br>
<select name="1:finopt:0" size=1 >
<option value="red" selected>red</option>
<option value="blue" >blue</option>
<option value="green" >green</option>
</select>
<select name="1:finopt:1" size=1 >
<option value="large" selected>large</option>
<option value="med" >med</option>
<option value="small" >small</option>
</select>
<input type=hidden name="1:finoptnum" value=2>


 <br>   Create the order option menu(s) without any table formatting
<p>2<br><select name="sku12345:finopt:0" size=1 >
<option value="red" selected>red</option>
<option value="blue" >blue</option>
<option value="green" >green</option>
</select>
<select name="sku12345:finopt:1" size=1 >
<option value="large" selected>large</option>
<option value="med" >med</option>
<option value="small" >small</option>
</select>
<input type=hidden name="sku12345:finoptnum" value=2>

As you can see there are no table tags in this output, so you might be able to use css to display it as you need.
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 107 guests