Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Price listed twice, option modifiers only changing one

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-20-2005, 02:54 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default 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
__________________
4.4.2

and

4.6.1
Reply With Quote
  #2  
Old 06-22-2005, 07:04 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

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
__________________
4.4.2

and

4.6.1
Reply With Quote

The following user thanks DanUK for this useful post:
mekon (10-16-2012)
  #3  
Old 10-16-2012, 12:15 AM
 
mekon mekon is offline
 

Senior Member
  
Join Date: Jan 2011
Posts: 180
 

Default 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
__________________
------------------------------------------------

Darren
Reply With Quote
  #4  
Old 01-28-2013, 05:45 PM
 
greggusp greggusp is offline
 

Member
  
Join Date: Nov 2012
Posts: 27
 

Default 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
__________________
Gregg
X-Cart GOLD Plus 4.5.4
Reply With Quote
  #5  
Old 01-29-2013, 01:25 AM
 
mekon mekon is offline
 

Senior Member
  
Join Date: Jan 2011
Posts: 180
 

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

Not at my desk, but in /modules/Product_Options/ ?
__________________
------------------------------------------------

Darren
Reply With Quote
  #6  
Old 01-29-2013, 05:32 AM
 
greggusp greggusp is offline
 

Member
  
Join Date: Nov 2012
Posts: 27
 

Default 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
__________________
Gregg
X-Cart GOLD Plus 4.5.4
Reply With Quote
  #7  
Old 01-29-2013, 06:19 AM
 
greggusp greggusp is offline
 

Member
  
Join Date: Nov 2012
Posts: 27
 

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

that code doesnt appear to exist in 4.5.x in func.js
__________________
Gregg
X-Cart GOLD Plus 4.5.4
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:46 PM.

   

 
X-Cart forums © 2001-2020