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

Make varients update both price and extra field price

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-07-2009, 07:19 PM
 
nick2021 nick2021 is offline
 

Member
  
Join Date: Jul 2009
Posts: 27
 

Default Make varients update both price and extra field price

I have a product with many variants, some cost more than others. When a customer chooses the variant it properly adds the extra amount to the price. I have an extra field which happens to be a member price and is initially set lower than the regular price. How can I have my variant list dynamically change the extra field also? This seems like its pretty easy but after digging through the few files that I think are responsible for it, I don't see where the code is telling the variant list to even add to the regular price.

Secondly, if anyone cares to share, how could you make it so both prices are hidden initially until someone chooses a variant? Possibly having a line of text in the price.
__________________
Version 4.2.2
Reply With Quote
  #2  
Old 08-08-2009, 04:41 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Make varients update both price and extra field price

Quote:
Originally Posted by nick2021
Secondly, if anyone cares to share, how could you make it so both prices are hidden initially until someone chooses a variant? Possibly having a line of text in the price.

Not sure this is what you are after, but this will require the customer to select a variant...

http://forum.x-cart.com/showthread.php?t=34831
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #3  
Old 08-08-2009, 04:46 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default Re: Make varients update both price and extra field price

would it be easier to set up the member price as a user group price, rather than have it in an extra field.

You can do this with the wholesale pricing module (go to modules and activate wholesale pricing) then you can set different prices for different user groups.

Xcart doesn't know that the data in an extra field is a price,
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
  #4  
Old 08-08-2009, 03:27 PM
 
nick2021 nick2021 is offline
 

Member
  
Join Date: Jul 2009
Posts: 27
 

Default Re: Make varients update both price and extra field price

When you have a product with varients, xcart wholesaling doesn't work, which is what it says in the appropriate section of the admin backend.

Even if the price would be changed depending on what user type is logged in, I want non members to see how much they would save on a particular product varient if they were a member. This is no problem if you don't have a variant list.

This should be really simple-- As of right now, the xcart price changes when you select a variant but rather than updating just one field, i want it to update a number I have set as an extra field.

So say my price is $1000 and a variant adds $200 to it. When selected the price displays $1200. And then lets say my extra field is $800, when the variant is selected I want it to update and say $1000.

I'm selling car parts, so one pair of shocks is a different price depending on what car it is for.

Whatever line of code tells the cart to change the price, I need it to change the number in my extra field.

Even if xcart doesn't recognize the extra field, it should be as easy as going into the extra field tpl and assigning a variable to it and then going into the file responsible for the variants list and telling it to also change the variable assigned to the extra field.
__________________
Version 4.2.2
Reply With Quote
  #5  
Old 08-08-2009, 05:10 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Make varients update both price and extra field price

Quote:
Originally Posted by nick2021
When you have a product with varients, xcart wholesaling doesn't work

Are you really using 4.1.1 ??

OF COURSE it won't work.. as this version is about 7 releases pre-"stable" (4.1.8 was the first "stable release i the 4.1.x branch).

Load a 4.1.8 or later version and see if this works (i promise, it will -- we use wholesale pricing with variants -- we're using 4.1.9).

If you are trying to force 4.1.1 to work, I beg you to upgrade to at least 4.1.9
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #6  
Old 08-09-2009, 10:58 AM
 
nick2021 nick2021 is offline
 

Member
  
Join Date: Jul 2009
Posts: 27
 

Default Re: Make varients update both price and extra field price

Look, I don't think your fully reading my post. I'm not having problems with the cart adjusting price based on who is logged in or wholesaling.

When you choose your variant, the page updates the price that is initially displayed. I need it to do that to an extra field also.

My extra field is a members price, I want customers who are NOT logged in to be able to see the MSRP AND what members would pay. My variants all have different prices so obviously my extra field (members price) would need to change based on what variant is selected.
__________________
Version 4.2.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 06:11 AM.

   

 
X-Cart forums © 2001-2020