Page 1 of 1
Variant Prices not Showing up
Posted: Sat Nov 15, 2008 1:26 am
by Jaz
I am having a problem with my Variants on all my products. Some of my variants have price mods. When I select a variant, the price is changed appropriately, however the price mod is not shown next to the option. There is no way for a customer to know how much the option is costing them. I have seen this working on other sites, so I am trying to figure out what I need to do to get it to work. I have searched the forum extensively and have not found anything.
The problem can be seen here:
http://216.139.236.188/Tibetan-Palm-Torches-P36C5.aspx
Check the Quantity Option
If I need to manually add the price difference to the description, I can, but I figured there is another way.
Thanks,
~Jaz
Re: Variant Prices not Showing up
Posted: Sat Nov 15, 2008 6:27 am
by mazhar
Are you talking about the override option for variant price on variant manager.
Re: Variant Prices not Showing up
Posted: Sat Nov 15, 2008 8:07 am
by jmestep
He might be talking about either. Right now, the override or the modify price doesn't show up win the dropdown list for options so customer doesn't know it is extra price until they select it and the price display changes. It would be nice to have the dropdown something like
black
red (+10.00)
blue (+12.00)
If you have a code snippet change for that in the current version you could post here, that would be great. I've got one client who has been putting that into the name of the option choice, but if the price changes he needs to remember to update that.
Re: Variant Prices not Showing up
Posted: Sat Nov 15, 2008 9:05 am
by mazhar
Well this could be done. For this first edit the App_Code/ProductHelper.cs file and locate the following line of code in
BuildProductOptions(Product product, PlaceHolder phOptions) method
Code: Select all
aspOptions.Items.Add(new ListItem(optionOption.Name, optionOption.OptionChoiceId.ToString()));
and make it look like
Code: Select all
aspOptions.Items.Add(new ListItem(optionOption.Name+" ("+optionOption.PriceModifier.ToString("ulc")+")", optionOption.OptionChoiceId.ToString()));
Now specify the price modifier for each choice, have a look at the screen shot below
Re: Variant Prices not Showing up
Posted: Sat Nov 15, 2008 2:44 pm
by jmestep
That's great. I had experimented some, but that should do it.
Re: Variant Prices not Showing up
Posted: Wed Nov 19, 2008 3:55 am
by Jaz
I took that code and modified it a little so that no price change is shown if the varian is $0.00 and to better display negative numbers.
I am not a programer, but it seems to be working
Code: Select all
if (optionOption.PriceModifier > 0)
{
aspOptions.Items.Add(new ListItem(optionOption.Name+" ( +"+optionOption.PriceModifier.ToString("ulc")+")", optionOption.OptionChoiceId.ToString()));
}
else if (optionOption.PriceModifier < 0)
{
aspOptions.Items.Add(new ListItem(optionOption.Name+" ( "+optionOption.PriceModifier.ToString("ulc")+")", optionOption.OptionChoiceId.ToString()));
}
else
{
aspOptions.Items.Add(new ListItem(optionOption.Name, optionOption.OptionChoiceId.ToString()));
}
Re: Variant Prices not Showing up
Posted: Thu Dec 04, 2008 8:49 pm
by wave_werks
Is there a way to do the same thing but instead to remove the " - ($10.00)" from a $10 product in a kit? I'm using a combination of variants and kits but don't like that the kits show the price while the variants hide the price. My preference is to use the option drop-down menus as a calculator that only shows the price change at the top and not on the menu itself.
Thanks in advance!
Re: Variant Prices not Showing up
Posted: Mon Dec 29, 2008 9:58 pm
by wave_werks
Thought I'd ask again...
Is there a way to do the same thing that is being asked above but instead remove the " - ($10.00)" from a $10 product in a kit? I'm using a combination of variants and kits but don't like that the kits show the price while the variants hide the price. My preference is to use the option drop-down menus as a calculator that only shows the price change at the top and not on the menu itself.
Thanks in advance!
Re: Variant Prices not Showing up
Posted: Fri Jan 09, 2009 6:34 am
by mazhar
Please read the following post
viewtopic.php?f=44&t=9451
Re: Variant Prices not Showing up
Posted: Thu Jan 24, 2013 10:53 am
by jdarby
mazhar wrote:Well this could be done. For this first edit the App_Code/ProductHelper.cs file and locate the following line of code in
BuildProductOptions(Product product, PlaceHolder phOptions) method
Code: Select all
aspOptions.Items.Add(new ListItem(optionOption.Name, optionOption.OptionChoiceId.ToString()));
and make it look like
Code: Select all
aspOptions.Items.Add(new ListItem(optionOption.Name+" ("+optionOption.PriceModifier.ToString("ulc")+")", optionOption.OptionChoiceId.ToString()));
Now specify the price modifier for each choice, have a look at the screen shot below
Is there an updated version of this for v7.0.7? I looked at the original code you posted in there and it is different in 7.0.7.
thanks.