Going even further, here is how to modify the javascript to get the product price to update when the product option is changed. //This will not work with product variants, or with wholesale prices
We begin by submitting the product id with the onchange event:
In
/my_skin/modules/Product_Options/customer_options.tpl near line 48:
Replace:
PHP Code:
<select id="po{$v.classid}" name="{$poname}"{if $disable} disabled="disabled"{/if}{if $nojs ne 'Y'} onchange="javascript: check_options();"{/if}>
With:
PHP Code:
<select id="po{$v.classid}" name="{$poname}"{if $disable} disabled="disabled"{/if}{if $nojs ne 'Y'} onchange="javascript: check_options({$product.productid});"{/if}>
Note: we are simply passing the productid to the check_options() function.
Next before we dive into the JS, lets set the span ID to include the productid on the product page:
In
/customer/main/product_details.tpl near line 80:
After:
PHP Code:
{if $product.taxed_price ne 0 or $variant_price_no_empty}
Insert:
PHP Code:
{capture name="product_price_id"}product_price{$product.productid}{/capture}
And
Replace:
PHP Code:
<span class="product-price-value">{currency value=$product.taxed_price tag_id="product_price"}</span>
With:
PHP Code:
<span class="product-price-value">{currency value=$product.taxed_price tag_id=$smarty.capture.product_price_id}</span>
Note: the below code references the product price in the template products_list.tpl, you may be using products_t.tpl instead, if your products are arranged in multiple columns. This depends on the settings under General Settings/Appearance - Displaying products. In this case, look near line 116 and make the edit to the span as described below, and include the capture above it.
And on the category page:
In
/customer/main/products_list.tpl near line 70:
After:
PHP Code:
<div class="price-row{if $active_modules.Special_Offers ne "" and $product.use_special_price ne ""} special-price-row{/if}">
Insert:
PHP Code:
{capture name="product_price_id"}product_price{$product.productid}{/capture}
And
Replace:
PHP Code:
<span class="price">{$lng.lbl_our_price}:</span> <span class="price-value">{currency value=$product.taxed_price}</span>
With:
PHP Code:
<span class="price">{$lng.lbl_our_price}:</span> <span class="price-value">{currency value=$product.taxed_price tag_id=$smarty.capture.product_price_id}</span>
Next we will edit the JS to reference our newly passed productid, and subsequently change the corresponding span where we appended the productid above.