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

Changing variant does not update price

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-29-2008, 07:54 PM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default Changing variant does not update price

Hi All,

Variant A costs $59.99
Variant B costs $99.99

It is option A by default, and when a customer chooses option B the variant image and SKU# both update, but the price does not.

We have heavily modified our product.tpl page which I think might have been the problem, but I'm having a hard time locating the code which might control this. Can anyone give me a hint? thanks!
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
  #2  
Old 12-30-2008, 02:10 AM
  Vetrivel's Avatar 
Vetrivel Vetrivel is offline
 

eXpert
  
Join Date: Apr 2008
Posts: 398
 

Arrow Re: Changing variant does not update price

Since you said product variants you can give a look at the file snik1/modules/product_options/customer_options.tpl.This is the place where the changes due to variants takes place
Reply With Quote
  #3  
Old 12-30-2008, 11:13 AM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Changing variant does not update price

Here are a few more hints:

The sku, image, & price changes are done with javascript code - also partially controlled by several of the files in skin1/modules/Product_Options - so check for recent changes. check_options.tpl is building the array with the javascript variables which includes the prices, so this should be getting the prices of the variants from the database.

Make sure there are no javascript errors - easiest to verify with firefox + firebug, or, MSIE reports javascript errors in a pop up or a yellow warning at the bottom of the browser.

Also - You can view the source for the page for the javascript section that begins with: "variants array:"

If you look at the variants array the first position is the price. If you do not see the correct prices there for your variants, it means it is not picking it up from the database correctly. If you see the correct price there, but it does not display on the page, something probably has gone wrong with the javascript .

Last consideration - if you happen to update the prices outside of XCART administration or csv import - for example, by directly modifying the database, or using some other means - then maybe you need to force cache generation? go to Summary->Tools->Force cache generation
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #4  
Old 12-31-2008, 06:50 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: Changing variant does not update price

See this thread if you are using something like Lytebox or any fancy javascript library. There are incompatibilities with the X-Cart variant change javascript.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #5  
Old 01-22-2009, 08:55 AM
 
pgmvveld pgmvveld is offline
 

Newbie
  
Join Date: Oct 2005
Location: Netherlands
Posts: 4
 

Default Re: Changing variant does not update price

Solution found for this bug.
The error is in skin1/customer/main/product.tpl.

Replace:
<td class="ProductPriceConverting" valign="top">{$lng.lbl_price}:</td>
<td valign="top">
By:
<td class="ProductPriceConverting" valign="top">{$lng.lbl_price}:</td>
<td valign="top" id="product_price">

Quote:
Originally Posted by gb2world
Here are a few more hints:

The sku, image, & price changes are done with javascript code - also partially controlled by several of the files in skin1/modules/Product_Options - so check for recent changes. check_options.tpl is building the array with the javascript variables which includes the prices, so this should be getting the prices of the variants from the database.

Make sure there are no javascript errors - easiest to verify with firefox + firebug, or, MSIE reports javascript errors in a pop up or a yellow warning at the bottom of the browser.

Also - You can view the source for the page for the javascript section that begins with: "variants array:"

If you look at the variants array the first position is the price. If you do not see the correct prices there for your variants, it means it is not picking it up from the database correctly. If you see the correct price there, but it does not display on the page, something probably has gone wrong with the javascript .

Last consideration - if you happen to update the prices outside of XCART administration or csv import - for example, by directly modifying the database, or using some other means - then maybe you need to force cache generation? go to Summary->Tools->Force cache generation
__________________
---------------------------
X-cart v4.0.9 Unix
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 02:25 PM.

   

 
X-Cart forums © 2001-2020