Change Shopping cart warning message
Change Shopping cart warning message
How do I access/modify the shopping cart message: "The quantity of item (item) exceeds the available stock (quantity). The quantity has been reduced to quantity available."
Re: Change Shopping cart warning message
Locate this code in 'basket.ascx.cs'
Replace with this code
Code: Select all
protected void UpdateButton_Click(object sender, EventArgs e)
{
BasketHelper.SaveBasket(BasketGrid);
BindBasketGrid();
}
protected void CheckoutButton_Click(object sender, EventArgs e)
{
BasketHelper.SaveBasket(BasketGrid);
List<string> basketMessages;
bool basketValid = Token.Instance.User.Basket.Validate(out basketMessages);
if (basketValid) Response.Redirect(NavigationHelper.GetCheckoutUrl());
else Session["BasketMessage"] = basketMessages;
}
Code: Select all
protected void UpdateButton_Click(object sender, EventArgs e)
{
BasketHelper.SaveBasket(BasketGrid);
BindBasketGrid();
List<string> basketMessages=new List<string>();
UpdateMessage(basketMessages);
}
protected void CheckoutButton_Click(object sender, EventArgs e)
{
BasketHelper.SaveBasket(BasketGrid);
List<string> basketMessages;
bool basketValid = Token.Instance.User.Basket.Validate(out basketMessages);
if (basketValid) Response.Redirect(NavigationHelper.GetCheckoutUrl());
else Session["BasketMessage"] = basketMessages;
UpdateMessage(basketMessages);
}
protected void UpdateMessage(List<string> basketMessages)
{
if (basketMessages.Count <= 0)
Token.Instance.User.Basket.Validate(out basketMessages);
foreach (string mesg in basketMessages)
{
if (mesg.Contains("The quantity has been reduced to quantity available"))
{
basketMessages.Remove(mesg);
string CustomMessage ="Your quantity exceeds from available inventory.";
basketMessages.Add(CustomMessage);
Session["BasketMessage"] = basketMessages;
break;
}
}
}
hope this helps!
__________________
s_ismail

AbleCommerce Customization
Free Plugins and Add-Ons
AbleCommerce Plugins and Add-Ons
Plugables Blog
__________________
s_ismail


AbleCommerce Customization
Free Plugins and Add-Ons
AbleCommerce Plugins and Add-Ons
Plugables Blog
Re: Change Shopping cart warning message
Thanks! I appreciate the time you've taken to come up with a solution for a hack like me. You've got the skills I don't, But I'm learning
. I did notice a bug though, if you could point me in the right direction, when I've got more than 1 items in my cart that have a quantity higher then I have in stock, the new message only replaces one of those - the old message that is generated remains.

Re: Change Shopping cart warning message
Sorry i don't understand about what you are talking , i need more detail to clarify what you want to modify.

hope this helps!
__________________
s_ismail

AbleCommerce Customization
Free Plugins and Add-Ons
AbleCommerce Plugins and Add-Ons
Plugables Blog
__________________
s_ismail


AbleCommerce Customization
Free Plugins and Add-Ons
AbleCommerce Plugins and Add-Ons
Plugables Blog
- mfreeze
- Commodore (COMO)
- Posts: 421
- Joined: Mon Jan 24, 2005 2:07 pm
- Location: Washington, NJ
- Contact:
Re: Change Shopping cart warning message
I put the following code in basket.aspx.cs on release 7.0.3 and it isn't working. The message stays the same as the original. Any idea what might be wrong?
Code: Select all
protected void KeepShoppingButton_Click(object sender, EventArgs e)
{
Response.Redirect(NavigationHelper.GetLastShoppingUrl());
}
protected void UpdateMessage(List<string> basketMessages)
{
if (basketMessages.Count <= 0)
Token.Instance.User.Basket.Validate(out basketMessages);
foreach (string mesg in basketMessages)
{
if (mesg.Contains("The quantity has been reduced to quantity available."))
{
basketMessages.Remove(mesg);
string CustomMessage ="The quantity has been reduced to quantity available. We may still be able to fill you entire order....please call us at 1-800-458-1948 or e-mail service@officeplayground.com..";
basketMessages.Add(CustomMessage);
Session["BasketMessage"] = basketMessages;
break;
}
}
}
Mary E Freeze
Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development
http://www.ffgraphics.com
Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development
http://www.ffgraphics.com