I am in the process of updating to 2.1.2 (latest I am allowed with my license)
I have one problem still. My product options template is where I have done most of my customizing. I needed to show thumbnails of color swatches along with my color options. My update is looking correct and the color swatches work as expected, but the related Size options do not. What is happening is that the javascript that is supposed to run ‘onchange’ of the select box doesn’t seem to work.
see: [url]http://www.plastikarmy.com/gear/d3l3t3.html[/url]
-try selecting a black small, it should show as instock (if not click the radio button next to the color black)
-try Red Small, by changing only the color option, you should see ‘out of stock’
-try Red XSmall, by only changing the Size, it will still show ‘out of stock’, … now click the radio button beside Red, that forces the JScript to run and update the display (would like this to run on Size change) and you now see the correct ‘In stock’ message.
Can anyone please look at my template below and help me get this to work???
```php
{* $Id: product_options.tpl 10833 2010-10-08 08:18:19Z alexions $ *}
{script src=“js/jquery.simpletip-1.3.1.js”}
{if ($settings.General.display_options_modifiers == “Y” && ($auth.user_id || ($settings.General.allow_anonymous_shopping != “P” && !$auth.user_id)))}
{assign var=“show_modifiers” value=true}
{/if}
{foreach from=$product.detailed_params key=“param” item=“value”}
{/foreach}
{if $product_options}
{if $obj_prefix}
{/if}
{if $location == “cart” || $product.object_id}
{/if}
{foreach name="product_options" from=$product_options item="po"}
{assign var="selected_variant" value=""}
{if !("SRC"|strpos:$po.option_type !== false && !$po.variants && $po.missing_variants_handling == "H")}
{$po.option_name}{if $po.description} {capture name="tooltip"}{$po.description}{/capture}{include file="common_templates/tooltip.tpl" tooltip=$smarty.capture.tooltip}{/if}:
{if $po.option_type == "S"} {*Selectbox*}
{foreach from=$po.variants item="vr" name=vars}
{$vr.variant_name} {if $show_modifiers}{hook name="products:options_modifiers"}{if $vr.modifier|floatval}({include file="common_templates/modifier.tpl" mod_type=$vr.modifier_type mod_value=$vr.modifier display_sign=true}){/if}{/hook}{/if}
{/foreach}
{* START edit by DUSX *}
{elseif $po.option_type == "R"} {*Radiobutton*}
{if $po.variants}
-
onclick="{if $product.options_update}fn_change_options('{$obj_prefix}{$id}', '{$id}', '{$po.option_id}');{/if} fn_change_varian_image('{$obj_prefix}{$id}', '{$po.option_id}', '{$vr.variant_id}');"
{if $product.exclude_from_calculate && !$product.aoc || $po.disabled}
disabled="disabled"
{/if}
/>{$vr.variant_name}
{if $settings.General.display_options_modifiers == "Y"}
{hook name="products:options_modifiers"}
{if $vr.modifier|floatval}(
{include file="common_templates/modifier.tpl" mod_type=$vr.modifier_type mod_value=$vr.modifier display_sign=true}
)
{/if}
{/hook}
{/if}
{if $vr.image_pair.image_id}
{if $vr.variant_id == $selected_variant}
{assign var="_class" value="product-variant-image-selected"}
{else}
{assign var="_class" value="product-variant-image-unselected"}
{/if}
{include file="common_templates/image.tpl"
class="$_class"
show_thumbnail="Y"
images=$vr.image_pair object_type="product_option"
obj_id="variant_image_`$id`_`$vr.variant_id`"
}
{/if}
{foreach from=$po.variants item="vr" name="vars"}
{/foreach}
{if !$po.value && $product.options_type == "S" && !$po.disabled}
{$lang.please_select_one}
{elseif !$po.value && $product.options_type == "S" && $po.disabled}{$lang.select_option_above}
{/if}{else}
{$lang.na}
{/if}
{* END edit by DUSX note: took out 'image_width="129"' from after 'object_type="product_option"' *}
{elseif $po.option_type == "C"} {*Checkbox*}
{foreach from=$po.variants item="vr"}
{if $vr.position == 0}
{else}
{if $show_modifiers}{hook name="products:options_modifiers"}{if $vr.modifier|floatval}({include file="common_templates/modifier.tpl" mod_type=$vr.modifier_type mod_value=$vr.modifier display_sign=true}){/if}{/hook}{/if}
{/if}
{/foreach}
{elseif $po.option_type == "I"} {*Input*}
{elseif $po.option_type == "T"} {*Textarea*}
{$po.value|default:$po.inner_hint}
{elseif $po.option_type == "F"} {*File*}
{include file="common_templates/fileuploader.tpl" images=$product.extra.custom_files[$po.option_id] var_name="`$name`[`$po.option_id``$id`]" multiupload=$po.multiupload hidden_name="`$name`[custom_files][`$po.option_id``$id`]" hidden_value="`$id`_`$po.option_id`" label_id="option_`$obj_prefix``$id`_`$po.option_id`" prefix=$obj_prefix}
{/if}
{/if}
{if $po.comment}
{$po.comment}
{/if}
{if $po.regexp && !$no_script}
{/if}
{capture name="variant_images"}
{if !$po.disabled}
{foreach from=$po.variants item="var"}
{if $var.image_pair.image_id}
{if $var.variant_id == $selected_variant}{assign var="_class" value="product-variant-image-selected"}{else}{assign var="_class" value="product-variant-image-unselected"}{/if}
{include file="common_templates/image.tpl" class="hand $_class object-image" show_thumbnail="Y" images=$var.image_pair object_type="product_option" image_width="50" image_height="50" obj_id="variant_image_`$obj_prefix``$id`_`$po.option_id`_`$var.variant_id`" image_onclick="fn_set_option_value('`$obj_prefix``$id`', '`$po.option_id`', '`$var.variant_id`'); void(0);"}
{/if}
{/foreach}
{/if}
{/capture}
{* {if $smarty.capture.variant_images|trim}
{$smarty.capture.variant_images}
{/if} *}
{/foreach}
{if $product.show_exception_warning == "Y"}
{$lang.nocombination}
{/if}
{/if}
{if !$no_script}
{/if}
```