Необходимо внести следующие изменения в код XSL-шаблона товара:
вместо:
function GetRadioValueModif(radioName)
{
var value = false;
var radioObject = document.getElementsByName(radioName);
if (radioObject!= undefined)
{
for (var i = 0; i < radioObject.length; i++)
{
if (radioObject[i].checked)
{
value = radioObject[i].value;
break;
}
}
}
return value;
}
следует использовать:
function GetSelectValue(selectName)
{
value=document.getElementById(selectName).value;
return value;
}
вместо:
<xsl:apply-templates select="modifications/item/property[@xml_name='razm_odez' and generate-id(.)=generate-id(key('property145', value))]"/>
следует использовать:
<select name="property145" id="property145">
<xsl:apply-templates select="modifications/item/property[@xml_name='razm_odez' and generate-id(.)=generate-id(key('property145', value))]"/>
</select>
вместо:
<xsl:apply-templates select="modifications/item/property[@xml_name='rost' and generate-id(.)=generate-id(key('property146', value))]"/>
использовать:
<select name="property146" id="property146">
<xsl:apply-templates select="modifications/item/property[@xml_name='rost' and generate-id(.)=generate-id(key('property146', value))]"/>
</select>
вместо:
<!-- для размеров -->
<xsl:template match="modifications/item/property[@xml_name='razm_odez']">
<xsl:variable name="value" select="value" />
<xsl:choose>
<xsl:when test="position() = 1">
<input name="property145" size="20" type="radio" value="{/shop/properties_for_group/property[@xml_name='razm_odez']/list_items/list_item[list_item_value=$value]/@id}" checked=""/><xsl:value-of select="value"/><br />
</xsl:when>
<xsl:otherwise>
<input name="property145" size="20" type="radio" value="{/shop/properties_for_group/property[@xml_name='razm_odez']/list_items/list_item[list_item_value=$value]/@id}" /><xsl:value-of select="value"/><br />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- для ростов -->
<xsl:template match="modifications/item/property[@xml_name='rost']">
<xsl:variable name="value" select="value" />
<xsl:choose>
<xsl:when test="position() = 1">
<input name="property146" size="20" type="radio" value="{/shop/properties_for_group/property[@xml_name='rost']/list_items/list_item[list_item_value=$value]/@id}" checked="checked"/><xsl:value-of select="value"/><br />
</xsl:when>
<xsl:otherwise>
<input name="property146" size="20" type="radio" value="{/shop/properties_for_group/property[@xml_name='rost']/list_items/list_item[list_item_value=$value]/@id}" /><xsl:value-of select="value"/><br />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
следует использовать:
<!-- для размеров -->
<xsl:template match="modifications/item/property[@xml_name='razm_odez']">
<xsl:variable name="value" select="value" />
<option value="{/shop/properties_for_group/property[@xml_name='razm_odez']/list_items/list_item[list_item_value=$value]/@id}" ><xsl:value-of select="value"/></option>
</xsl:template>
<!-- для ростов -->
<xsl:template match="modifications/item/property[@xml_name='rost']">
<xsl:variable name="value" select="value" />
<option value="{/shop/properties_for_group/property[@xml_name='rost']/list_items/list_item[list_item_value=$value]/@id}" ><xsl:value-of select="value"/></option>
</xsl:template>
вместо:
<a href="{/shop/path}cart/?action=add&item_id={@id}" onclick="return AddIntoCart('{/shop/path}', {@id}, document.getElementById('count_{@id}'

.value + '&property145=' + GetRadioValueModif('property145'

+ '&property146=' + GetRadioValueModif('property146'

)" style="text-decoration: none;"><img alt="В корзину" title="В корзину" src="/hostcmsfiles/images/cart.gif" style="margin: 0px 0px -4px 10px" />В корзину
</a>
следует использовать:
<a href="{/shop/path}cart/?action=add&item_id={@id}" onclick="return AddIntoCart('{/shop/path}', {@id}, document.getElementById('count_{@id}'

.value + '&property145=' + GetSelectValue('property145'

+ '&property146=' + GetSelectValue('property146'

)" style="text-decoration: none;"><img alt="В корзину" title="В корзину" src="/hostcmsfiles/images/
cart.gif" style="margin: 0px 0px -4px 10px" />В корзину
</a>