仅在PrestaShop中选中属性时,如何显示product-customization.tpl? 我的意思是,我有2个产品属性:
如果选中第一个,则显示product-customization.tpl 我用jquery尝试了一下,但是不起作用:
$(document).ready(function () {
$('.product-customization').each(function () {
if ($(this).val() == ('34') && $(this).is(':checked')) {
$('#show').show();
} else {
$('#show').hide();
}
});
});
这是product-variants.tpl
{elseif $group.group_type == 'radio'}
<ul id="group_{$id_attribute_group}">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<li>
<label>
<input class="input-radio" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if} >
<span class="radio-label">{$group_attribute.name}</span>
</label>
</li>
{/foreach}
</ul>
<div id="show" style="display: none;">
{if $product.is_customizable && count($product.customizations.fields)}
{block name='product_customization'}
{include file="catalog/_partials/product-customization.tpl" customizations=$product.customizations}
{/block}
{/if}