当我选择其他修改器选项时,似乎无法让Store动态更新产品价格。
我已经将商店放置在沙箱环境中,而只有一种产品具有1修饰符:大小。有2种尺寸,大小不一。大的价格相差10美元。
当我将产品添加到购物车时,价格差异得到了尊重,但是当选择实际选项后,我需要该价格差异来动态更改,然后再添加到购物车中。
我仅使用提供的示例一个就没有自己的自定义模板,并且问题仍然在发生。
码:
<div class="control-group">
<label class="control-label">Price</label>
<div class="controls">
{if on_sale}
<del>{regular_price}</del><br />
{price}
<span class="label label-success">Save {you_save} ({you_save_percent}%)</span>
{if:else}
{regular_price}
{/if}
</div>
</div>
{modifiers}
<div class="control-group">
<label class="control-label" for="{modifier_input_name}">{modifier_name}</label>
<div class="controls">
{if modifier_type == 'var' OR modifier_type == 'var_single_sku'}
<select id="{modifier_input_name}" name="{modifier_input_name}">
{modifier_options}
<option value="{option_id}">
{option_name} {if price_mod_val} ({price_mod}) {/if}
</option>
{/modifier_options}
</select>
{if:else}
<input type="text" id="{modifier_input_name}" name="{modifier_input_name}" value="" />
{/if}
<p class="help-block">{modifier_instructions}</p>
</div>
</div>
{/modifiers}
EECMS版本:1.5.2
商店:1.6.1
的PHP:5.3.6
环境:OSX上的MAMP
非常感谢任何帮助,因为这非常紧急。
干杯
担
最佳答案
动态产品变量基于css类,该类告诉内置javascript在何处更新价格。
https://exp-resso.com/docs/store/tags/product.html#dynamic-product-variables
要使其正常工作,只需将价格包装在<span>
元素中,如下所示:
<span class="store_product_price">{price}</span>
另请注意,1.6.0中存在一个错误,该错误在某些情况下导致该错误(尽管您提到您正在运行1.6.1,所以这不应该成为问题)。
关于expressionengine - 更改修饰符似乎并不能更新价格,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13317088/