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

Product Variants - Show Price in Drop-Down

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-16-2009, 01:17 PM
 
lizlee00 lizlee00 is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 56
 

Default Product Variants - Show Price in Drop-Down

Hello,
Does anyone know how I can display a variants price in the drop-down box? I think this would make it easier for customers so that they don't have to choose an option and then see what the price changes to. Instead they see a ($price) next to the description in the drop-down.

I use product variants extensively in my store, and prefer them over product options because I can assign sku's, images, weights, and price individually. I don't think it would be effective to manually enter the price in the description because that would make price updates a major hassle, and would not work for wholesale pricing.

Anyone know how this can be done?
__________________
-Liz
Version 4.1.8
www.partssystems.com
Reply With Quote
  #2  
Old 09-16-2009, 02:10 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Product Variants - Show Price in Drop-Down

Product variants and their attributes are populated on page load. You can edit variants.tpl (look in skin1/modules/Product_Options for correct file name) to include price. There is probably foreach or loop that reads all variants. At least that would be the place I would start with
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 09-16-2009, 02:24 PM
 
BritSteve BritSteve is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 339
 

Default Re: Product Variants - Show Price in Drop-Down

Hi,

I had the same issue and added the prices to the end of the variant.

Try adding the code below in modules/Product_Options/customer_options.php

Find $variants = func_get_product_variants($productid, $user_account['membershipid']); around line 44 and add the following after it.

################################################## ##########################################
# Loop through product variants, get the price and add to the end of the drop down name
################################################## ##########################################
if ($variants)
{
foreach ($variants as $k => $v)
{
foreach($v['options'] as $k1 => $v1)
{
$product_options[0]['options'][$v1['optionid']]['option_name'] = $product_options[0]['options'][$v1['optionid']]['option_name'] . " $" . $v['price'];
}
}
}
################################################## ##########################################
# END price add to variants

Steve
__________________
Version 4.1.8 & 4.1.9
ezcheckout4.1.x
cdseolinks2
product_metatags41x
shipping_per_product41x

http://www.earthsmagic.com
Reply With Quote
  #4  
Old 09-16-2009, 02:29 PM
 
lizlee00 lizlee00 is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 56
 

Default Re: Product Variants - Show Price in Drop-Down

Perfect, Thank you!!
__________________
-Liz
Version 4.1.8
www.partssystems.com
Reply With Quote
  #5  
Old 09-18-2009, 03:06 PM
 
lizlee00 lizlee00 is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 56
 

Default Re: Product Variants - Show Price in Drop-Down

Darn, I noticed a problem today. If you have multiple product variants this isn't going to work. It adds three prices to the end of a line, and then an additional few lines of just prices. I'm not sure how you would make this work with multiple variants, would probably get a bit complicated.
__________________
-Liz
Version 4.1.8
www.partssystems.com
Reply With Quote
  #6  
Old 09-18-2009, 08:35 PM
 
BritSteve BritSteve is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 339
 

Default Re: Product Variants - Show Price in Drop-Down

Sorry Liz, in that case it isn't going to work for you.

Steve
__________________
Version 4.1.8 & 4.1.9
ezcheckout4.1.x
cdseolinks2
product_metatags41x
shipping_per_product41x

http://www.earthsmagic.com
Reply With Quote
  #7  
Old 07-18-2010, 05:32 AM
 
dmpinder dmpinder is offline
 

Advanced Member
  
Join Date: Jun 2009
Posts: 86
 

Default Re: Product Variants - Show Price in Drop-Down

Has anyone worked out how to achieve this for more than one Product Variant? It's been very useful to get just one, but I would love you long time if you could do this for every Variant available.

Darren
__________________
Darren

X-Cart Gold 4.3.1
Reply With Quote
  #8  
Old 07-14-2014, 07:08 AM
  mcanitano's Avatar 
mcanitano mcanitano is offline
 

eXpert
  
Join Date: Feb 2006
Location: Melbourne, FL
Posts: 216
 

Default Re: Product Variants - Show Price in Drop-Down

(Sorry to revive an old thread)

We are curious to see if anyone has mastered this as well, we're using x-cart v4.5.5. Customer's get confused when they select a product variant and it changes the price without truly notifying them unless they are watching the price change.

Having (like product modifier) the price listed next to the variant in the dropdown is a must for us. Tried to figure it out today but could not call the correct smarty variable.
__________________
Marcello Canitano
New Site: X-Cart v4.5.5 GOLD
X-Cart Mobile v1.4.3
X-Payments v1.0.6
CDSEO Pro v2
Total Server Solutions xCDN

www.silverhorseracing.com
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 01:24 PM.

   

 
X-Cart forums © 2001-2020