When disabling purchase on a product it removes the add to cart button - how can i replace the now missing button with some text like "Call to Order"
I found this code but i'm not sure how to tell it to out put text.
private void HideAddToBasket()
{
AddToBasketButton.Visible = false;
AddToWishlistButton.Visible = false;
rowQuantity.Visible = false;
}
private void ShowAddToBasket()
{
AddToBasketButton.Visible = true;
AddToWishlistButton.Visible = true;
rowQuantity.Visible = true;
Replace add to cart button with "call to order" text
Re: Replace add to cart button with "call to order" text
Very easy. Edit the ConLib/BuyProductDialog.ascx file and locate the following line of code
and make it look like
Now edit the ConLib/BuyProductDialog.ascx.cs file and in the HideAddToBasket function add the following line of code so it should look like as below
Code: Select all
<asp:LinkButton ID="AddToBasketButton" runat="server" SkinID="Button" Visible="true" OnClick="AddToBasketButton_Click" Text="Add to Basket" EnableViewState="false" ValidationGroup="AddToBasket"></asp:LinkButton>
Code: Select all
<asp:LinkButton ID="AddToBasketButton" runat="server" SkinID="Button" Visible="true" OnClick="AddToBasketButton_Click" Text="Add to Basket" EnableViewState="false" ValidationGroup="AddToBasket"></asp:LinkButton>
<asp:Label ID="CallToOrderLabel" runat="server" Text="Call to order" Visible="false"></asp:Label>
Code: Select all
private void HideAddToBasket()
{
AddToBasketButton.Visible = false;
AddToWishlistButton.Visible = false;
rowQuantity.Visible = false;
CallToOrderLabel.Visible = true;
}
Re: Replace add to cart button with "call to order" text
Thanks for the quick response.
However, the new text shows up all the time and we only want it to appear when there is no button. Am I missing something??
Here is what I have so far:
and on the .cs page:
However, the new text shows up all the time and we only want it to appear when there is no button. Am I missing something??
Here is what I have so far:
Code: Select all
<asp:LinkButton ID="AddToBasketButton" runat="server" SkinID="Button" Visible="true" OnClick="AddToBasketButton_Click" Text="Add to Basket" EnableViewState="false" ValidationGroup="AddToBasket"></asp:LinkButton>
<br />
<span style="color:red; font-weight:bold"> <asp:Label ID="CallToOrderLabel" runat="server" Text="Call To Place Order" Visible="false"></asp:Label></span>
Code: Select all
private void HideAddToBasket()
{
AddToBasketButton.Visible = false;
AddToWishlistButton.Visible = false;
rowQuantity.Visible = false;
CallToOrderLabel.Visible = true;
}
private void ShowAddToBasket()
{
AddToBasketButton.Visible = true;
AddToWishlistButton.Visible = true;
rowQuantity.Visible = true;
}
Re: Replace add to cart button with "call to order" text
I found elsewhere in the code the function hideaddtobasket is called again. Which means we have set the visibility of my new CallToOrderLabel in both functions to reinforce it. Here is what I came up with.
On the buyproductdialog.ascx.cs page:
Thanks Again Mazhar for your help!!!
Thanks also go to Misty (AppX/FFG) for setting me straight.
On the buyproductdialog.ascx.cs page:
Code: Select all
private void HideAddToBasket()
{
if (_Product.DisablePurchase) {
CallToOrderLabel.Visible = true;
}
AddToBasketButton.Visible = false;
AddToWishlistButton.Visible = false;
rowQuantity.Visible = false;
}
private void ShowAddToBasket()
{
CallToOrderLabel.Visible = false;
AddToBasketButton.Visible = true;
AddToWishlistButton.Visible = true;
rowQuantity.Visible = true;
}
Thanks also go to Misty (AppX/FFG) for setting me straight.