Greetings all,
Does anyone know if there is an easy code adjustment on 7.0.3 to get the Customer Input Fields defined in a Product Template to show up when the "Product with Options Grid" display page is chosen for an item?
I'm selling Dyes in bottles whose sizes are showing in the grid (4 bottle sizes with different prices, set up as variants) and then requiring the customer to enter the dye color # that they would like to order. There are 150 color choices, so using a full variants selection method isn't practical.
The Product Template customer input fields show up when using the "Basic Product" display page (the variants show as drop down list), but not when switched over to the "Product with Options Grid" display page.
Thanks!
-JeffR
Product Template and Product With Options Grid
Re: Product Template and Product With Options Grid
You might be able to put [[ConLib:ProductCustomFieldsDialog]] in the scriptlet.
- Jeffr_ca
- Lieutenant, Jr. Grade (LT JG)
- Posts: 35
- Joined: Mon Oct 12, 2009 6:28 pm
- Location: Canada
- Contact:
Re: Product Template and Product With Options Grid
Thanks Triplw,
No, that didn't work as I think that control has to do with Custom Fields from the database.
I believe the issue is related to calling the product helper code, in particular:
This is treated differently in the BuyProductDialogOptionsList.ascx.cs as compared to the BuyProductDialog.ascx.cs
Unfortunately, I'm not bright enough to figure out exactly how to duplicate this ability from the BuyProductDialog into the BuyProductDialogOptionsList. If anyone is able to offer assistance, it would be very much much appreciated.
-Jeff
No, that didn't work as I think that control has to do with Custom Fields from the database.
I believe the issue is related to calling the product helper code, in particular:
Code: Select all
ProductHelper.CollectProductTemplateInput(basketItem, this);
Unfortunately, I'm not bright enough to figure out exactly how to duplicate this ability from the BuyProductDialog into the BuyProductDialogOptionsList. If anyone is able to offer assistance, it would be very much much appreciated.
-Jeff
Re: Product Template and Product With Options Grid
You just need to call the method to display the template and add a placeholder for it.
In the file ~/ConLib/BuyProductDialogOptionsList.ascx.cs
Change the Page_load method to look like this to call the method to display the template:
Make the ~/ConLib/BuyProductDialogOptionsList/ascx page look like this to add the placeholder ( <asp:PlaceHolder runat="server" id="phOptions" EnableViewState="false"></asp:PlaceHolder> )
In the file ~/ConLib/BuyProductDialogOptionsList.ascx.cs
Change the Page_load method to look like this to call the method to display the template:
Code: Select all
protected void Page_Load(object sender, System.EventArgs e)
{
_ProductId = AlwaysConvert.ToInt(Request.QueryString["ProductId"]);
_Product = ProductDataSource.Load(_ProductId);
if (_Product != null)
{
_VariantManager = new ProductVariantManager(_ProductId);
_AvailableVariants = _VariantManager.LoadAvailableVariantGrid();
CreateDynamicGrid();
// Triple W - call method to display templates
ProductHelper.BuildProductChoices(_Product, phOptions);
// End
}
else
{
this.Controls.Clear();
}
}
Code: Select all
<param name="ShowSubscription" default="true">Possible values are true or false. Indicates whether the subscription details will be shown or not.</param>
<param name="ShowMSRP" default="true">Possible values are true or false. Indicates whether the MSPR will be shown or not.</param>
<param name="ShowPartNumber" default="false">Possible values are true or false. Indicates whether the Part/Model Number will be shown or not.</param>
</conlib>
--%>
<%@ Register Assembly="CommerceBuilder.Web" Namespace="CommerceBuilder.Web.UI.WebControls" TagPrefix="cb" %>
<%@ Register Src="~/ConLib/Utility/ProductPrice.ascx" TagName="ProductPrice" TagPrefix="uc" %>
<ajax:UpdatePanel ID="BuyProductPanel" runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:PlaceHolder runat="server" id="phOptions" EnableViewState="false"></asp:PlaceHolder>
<asp:Button ID="DummyButtonForEnterSupress" runat="server" Text="" OnClientClick="return false;" style="display:none;" />
<asp:Panel ID="ContentPanel" runat="server" DefaultButton="DummyButtonForEnterSupress">
<asp:Label ID="SavedMessage" runat="server" Text="Data saved at {0:g}" EnableViewState="false" Visible="false" SkinID="GoodCondition"></asp:Label>
<cb:SortedGridView ID="VariantGrid" runat="server" AutoGenerateColumns="False" Width="100%" SkinID="PagedList" DataKeyNames="OptionList" OnRowCommand="VariantGrid_RowCommand">
<Columns>
</Columns>
</cb:SortedGridView>
</asp:Panel>
</ContentTemplate>
</ajax:UpdatePanel>