我正在尝试使用jquery加载可配置产品的选项以使模板更快。这个想法是显示默认选项并让客户选择他们想要更改的项目。但是,我找不到有关magento模块如何将某些内容返回给jQuery函数的任何指示。有任何想法吗?如何使用jQuery获取magento可配置属性项目
<?php foreach($_attributes as $_attribute): ?>
<dt><label class="required"><em>*</em><?php echo $_attribute->getLabel() ?></label></dt>
<dd<?php if ($_attribute->decoratedIsLast){?> class="last"<?php }?>>
<div class="input-box">
<select name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" class="required-entry super-attribute-select">
<option><?php echo $this->__('Choose an Option...') ?></option>
</select>
</div>
</dd>
<?php endforeach; ?>
事实上,这是我想改变的文件。如果客户想要选择其他选项,我只想加载这些行(在javascript之前)。但是,我不知道我需要创建一个php文件来获取这些行并加载选项,而无需刷新整个页面。 – FelixR
请检查编辑答案 – changeling