Text instead of price on product page when using variants
Text instead of price on product page when using variants
Hi
I couldn't find this anywhere-not sure what to search for - please correct me if I'm wrong.
I have many products, mostly with two variants on the same product. All my products start at $0.00, because most products have a variant of either $39 or $45 or something like that (some $10, and $15, etc...)
So I set the initial product price to $0.00 and use the Variant functions to Modify the price by the full amount. Problem is, when you go to the actual product page, the price is $0.00 to start with - which is rather misleading. I have set the header in the drop down to say "Choose Format", but if the price could begin as something like that, and then once a format is chosen, show me the actual price, that would be perfect.
I am using a Show Product 1 page.
Any help would be greatly appreciated!
I couldn't find this anywhere-not sure what to search for - please correct me if I'm wrong.
I have many products, mostly with two variants on the same product. All my products start at $0.00, because most products have a variant of either $39 or $45 or something like that (some $10, and $15, etc...)
So I set the initial product price to $0.00 and use the Variant functions to Modify the price by the full amount. Problem is, when you go to the actual product page, the price is $0.00 to start with - which is rather misleading. I have set the header in the drop down to say "Choose Format", but if the price could begin as something like that, and then once a format is chosen, show me the actual price, that would be perfect.
I am using a Show Product 1 page.
Any help would be greatly appreciated!
Re: Text instead of price on product page when using variants
I don't like to start at 0.00. For one thing, it looks kind of silly as you said.
If I know the small size is going to be $20.00, I start the product at $20.00 and the small choice is $0.00, the medium choice is $10.00 more, and the large choice is $20.00 more. Bumping or dropping the price a few dollars later is simpler this way too, only one price to change.
Starting at a positive number allows you to run a sale without the product showing a negative until a choice is made. -$5.00. Now, that looks REALLY dumb - and it looks like bad math when the base still shows $0.00 (instead of -$5.00) but the choice that should add $10.00 only adds $5.00. Much better when a $10.00 item shows the $5.00 sale as $5.00.
If I know the small size is going to be $20.00, I start the product at $20.00 and the small choice is $0.00, the medium choice is $10.00 more, and the large choice is $20.00 more. Bumping or dropping the price a few dollars later is simpler this way too, only one price to change.
Starting at a positive number allows you to run a sale without the product showing a negative until a choice is made. -$5.00. Now, that looks REALLY dumb - and it looks like bad math when the base still shows $0.00 (instead of -$5.00) but the choice that should add $10.00 only adds $5.00. Much better when a $10.00 item shows the $5.00 sale as $5.00.
Re: Text instead of price on product page when using variants
Edit ConLib/Utility/ProductPrice.ascx.cs file and locate following code line in Page_PreRender method
and replace it with
Code: Select all
Price.Text = string.Format(_PriceFormat, priceWithVAT);
Code: Select all
if (priceWithVAT != 0)
Price.Text = string.Format(_PriceFormat, priceWithVAT);
else
{
if (_Product.Variants.Count > 0 && _Product.Price == 0)
Price.Text = "Choose Format...";
}
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Text instead of price on product page when using variants
When you have your products at a 0 price, they get rejected by GoogleBase feed, so you need to consider that also.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: Text instead of price on product page when using variants
Thanks for the code script...this is what some of us were looking for. I added a few additional parameters and ran across a new issue that I'm having trouble with...
The code I'm using to control the price appearance is:
For variants, the code is doing what I need it do; however, on the "Buy Product Page", the text is carrying over and displaying as "Our Price: As Low As:" <price>.
In short, I need some assistance removing the phrase "As Low As" from this page only:"
Thanks in advance for your assistance.
Ben K
http://www.animalloft.com
The code I'm using to control the price appearance is:
Code: Select all
if (_Product.Variants.Count > 0)
Price.Text = "As Low As:" + string.Format(_PriceFormat, priceWithVAT);
else
{
if (_Product.Variants.Count == 0)
Price.Text = string.Format(_PriceFormat, priceWithVAT);
}
In short, I need some assistance removing the phrase "As Low As" from this page only:"
Thanks in advance for your assistance.
Ben K
http://www.animalloft.com
Re: Text instead of price on product page when using variants
Our Price label is inside BuyProductDialog control so you need to put something in that control to hide it when no variant is selected.
Re: Text instead of price on product page when using variants
Thanks for posting back...I don't want to hide the "Our Price" label...I want to have the space show only the numeric price, not the text that I added in my code. In other words, I don't want the custom code to be applied to this page, but I do want it to be applied to the Featured Products conlib and the Category Grid pages.
Any suggestions? I'm still learning the AbleCommerce files.
Thanks,
Ben K
http://www.animalloft.com
Any suggestions? I'm still learning the AbleCommerce files.
Thanks,
Ben K
http://www.animalloft.com
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Text instead of price on product page when using variants
You could make a customized copy of the Utility/ProductPrice and use it instead
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: Text instead of price on product page when using variants
Thanks...That makes complete sense...Worked perfectly!
In addition, I constructed a conditional statement that shows the price label text as "As Low As" at page load but changes to "Our Price" when a variant is selected.
Exactly what I wanted!
Thanks again,
Ben K
http://www.animalloft.com
In addition, I constructed a conditional statement that shows the price label text as "As Low As" at page load but changes to "Our Price" when a variant is selected.
Exactly what I wanted!
Thanks again,
Ben K
http://www.animalloft.com
Re: Text instead of price on product page when using variants
I tried this, and it seems simple enough - but it generates this error on my category listing pages and search pages:and replace it withCode: Select all
Price.Text = string.Format(_PriceFormat, priceWithVAT);
Code: Select all
if (priceWithVAT != 0) Price.Text = string.Format(_PriceFormat, priceWithVAT); else { if (_Product.Variants.Count > 0 && _Product.Price == 0) Price.Text = "Choose Format..."; }
[[ConLib:Custom/CategoryGridPage4]] c:\websites\Able70_new2\ConLib\Utility\ProductPrice.ascx.cs(244): error CS1502: The best overloaded method match for 'CommerceBuilder.Orders.BasketItemDataSource.CreateForProduct(int, short, string, string)' has some invalid arguments
I can't even get past that to view a product
Here's what the code looks like:
Code: Select all
protected void Page_PreRender(object sender, EventArgs e)
{
if (_Product != null)
{
if (!_Product.UseVariablePrice)
{
// UPDATE THE INCLUDED KITPRODUCTS (Included-Hidden and Included-Shown)
if (_SelectedKitProducts == null || _SelectedKitProducts.Count == 0) UpdateIncludedKitOptions();
ProductCalculator pcalc = ProductCalculator.LoadForProduct(_Product.ProductId, 1, _OptionList, _SelectedKitProducts);
//IF REQUIRED MAKE ADJUSTMENTS TO DISPLAYED PRICE TO INCLUDE VAT
LSDecimal basePriceWithVAT = TaxHelper.GetShopPrice(_Product.Price, _Product.TaxCodeId);
LSDecimal priceWithVAT = TaxHelper.GetShopPrice(pcalc.Price, _Product.TaxCodeId);
LSDecimal msrpWithVAT = TaxHelper.GetShopPrice(_Product.MSRP, _Product.TaxCodeId);
if (!_Product.HidePrice)
{
//PRICE IS VISIBLE, NO POPUP
phPricePopup.Visible = false;
//SHOW RETAIL PRICE IF INDICATED
if (_ShowRetailPrice && _Product.MSRP > 0 && !_Product.UseVariablePrice)
{
RetailPrice1.Text = string.Format(_RetailPriceFormat, _Product.MSRP);
}
else RetailPrice1.Text = string.Empty;
//SHOW THE PRICE
if (pcalc.AppliedSpecial != null && pcalc.AppliedSpecial.EndDate != DateTime.MinValue)
{
// SHOW THE BASE PRICE AND SPECIAL PRICE
RetailPrice1.Text = string.Format(_BasePriceFormat, basePriceWithVAT);
Price.Text = string.Format(_SpecialPriceFormat, priceWithVAT, pcalc.AppliedSpecial.EndDate);
}
else
{
if (priceWithVAT != 0)
Price.Text = string.Format(_PriceFormat, priceWithVAT);
else
{
if (_Product.Variants.Count > 0 && _Product.Price == 0)
Price.Text = "Choose Format...";
}
}
}
else
Thanks!
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Text instead of price on product page when using variants
You might be using code from a different build. Some of those things changed.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: Text instead of price on product page when using variants
My build info is:
PLATFORM: ASP.NET
VERSION: 7.0.3
BUILD: 12458
Any ideas there?
PLATFORM: ASP.NET
VERSION: 7.0.3
BUILD: 12458
Any ideas there?
Re: Text instead of price on product page when using variants
To make things even worse, when I upload my backup file with the original code, the error is still there!
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Text instead of price on product page when using variants
I tested the code and it worked fine on product, category and search pages.
Is this what your code in the ProductPrice.ascx.cs is showing? That code did change in 7.0.3
Is this what your code in the ProductPrice.ascx.cs is showing? That code did change in 7.0.3
Code: Select all
//USE VALUES FROM VS, CURRENT PROPERTIES MAY NOT BE CORRECT
BasketItem basketItem = BasketItemDataSource.CreateForProduct(_AddProductId, 1, _AddOptionList, AlwaysConvert.ToList(",", _AddKitProducts));
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: Text instead of price on product page when using variants
Nope, it shows this:
Code: Select all
//USE VALUES FROM VS, CURRENT PROPERTIES MAY NOT BE CORRECT
BasketItem basketItem = BasketItemDataSource.CreateForProduct(_AddProductId, 1, _AddOptionList, _AddKitProducts);
if (basketItem != null)
Re: Text instead of price on product page when using variants
It also returns this in a product page where the price should be:
What is baffling me, is all I did was change that line of code from above - got the error - uploaded my backup file that I had just duplicated, and I still get this error - it's the same file that was there before. We even compared it to several backup files and line for line it's identical!
Code: Select all
[[ConLib:BuyProductDialog]] c:\websites\Able70_new2\ConLib\Utility\ProductPrice.ascx.cs(244): error CS1502: The best overloaded method match for 'CommerceBuilder.Orders.BasketItemDataSource.CreateForProduct(int, short, string, string)' has some invalid arguments
Re: Text instead of price on product page when using variants
We got it fixed - installed the file from the latest build and it corrected the problem, and the code for the text instead of price worked.
Thanks for all the input and help!
Thanks for all the input and help!