X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Price listed twice, option modifiers only changing one (https://forum.x-cart.com/showthread.php?t=14666)

DanUK 06-20-2005 02:54 AM

Price listed twice, option modifiers only changing one
 
I have the price displayed at the very top of the product page, and also at the bottom. When I have a product with a modifier e.g. Red +бё10.00 and I select it, it only changes one instance of the price (the topmost/first price) to reflect the modifer.

I know the product_price span tags:
Code:


<SPAN id="product_price">{include file="currency.tpl" value=$product.price}</SPAN>


are responsible for updating the price based on the options, but is there a reason why it only updates one? How do I get both to update?

thanks

Dan

DanUK 06-22-2005 07:04 AM

OK, got X-cart to help me with this.

in customer/main/product.tpl change the second instance of the price to use a separate span tag, in this case product_price2:

Code:

{$lng.lbl_price}: <font class=ProductDetailsTitle><SPAN id="product_price2">{include file="currency.tpl" value=$product.price}</span>


and in /modules/Product_Options/check_options.tpl add this:

Code:

// Update price2
        if(document.getElementById('product_price2'))
                document.getElementById('product_price2').innerHTML = currency_symbol+price_format(price, 2);


underneath // Update price so it looks like this:

Code:

// Update form elements
        // Update price
        if(document.getElementById('product_price'))
                document.getElementById('product_price').innerHTML = currency_symbol+price_format(price, 2);
// Update price2
        if(document.getElementById('product_price2'))
                document.getElementById('product_price2').innerHTML = currency_symbol+price_format(price, 2);


Works for me!

Dan

mekon 10-16-2012 12:15 AM

Re: Price listed twice, option modifiers only changing one
 
Just to let anyone on 4.5.x know, this is now in func.js not check_options.tpl

greggusp 01-28-2013 05:45 PM

Re: Price listed twice, option modifiers only changing one
 
Quote:

Originally Posted by mekon
Just to let anyone on 4.5.x know, this is now in func.js not check_options.tpl



where is func.js located? i am trying to do the same thing, i have named my template at the bottom of the page product_details_bottom.tpl

mekon 01-29-2013 01:25 AM

Re: Price listed twice, option modifiers only changing one
 
Not at my desk, but in /modules/Product_Options/ ?

greggusp 01-29-2013 05:32 AM

Re: Price listed twice, option modifiers only changing one
 
Quote:

Originally Posted by mekon
Not at my desk, but in /modules/Product_Options/ ?


i found it, will changing the code in the above post also make the price, product sku, and thumbnail image update just as it does with the top one on my page

greggusp 01-29-2013 06:19 AM

Re: Price listed twice, option modifiers only changing one
 
that code doesnt appear to exist in 4.5.x in func.js


All times are GMT -8. The time now is 05:28 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.