I'm creating a product template to display Books and CDs with additional pricing information that doesn't appear in the standard template. I've named the template "Alumni Books", and have added 3 new merchant fields:
* Gold Seal Price
* Retail Price
* Alumni Price
When viewing the product from the store's product description page, information that I entered in those merchant fields shows up, but it appears at the bottom of the page below the product description. My client would like those values to appear beside the product image, above the Quantity control and the "Add To Cart" and "Add to Wishlist" buttons.
Also, I need to change the "Our Price" label appearing on that page to read "Alumni Price". So I may be able to delete that last merchant field. But do need it to have the label "Alumni Price" when the "Alumni Books" template is selected.
I found the product template instructions at this link, but didn't see anything describing how I can move the displayed merchant fields around in the displayed product page.
http://help.ablecommerce.com/mergedProj ... mplate.htm
The client previously had this done in Able Commerce 5.5, so I imagine it can be done with Able Commerce Gold as well. I just need some guidance on how to achieve that. Thanks for your help.
Need product template assistance.
Re: Need product template assistance.
Ken,
Take a look at the Conlib\ProductDescription.ascx control. At the bottom of that control it displays another user control which displays the product template fields and product custom fields.
It is using the Conlib\ProductCustomerFieldsDialog.ascx control. You should be able to move that around or put it inside another control.
Take a look at the Conlib\ProductDescription.ascx control. At the bottom of that control it displays another user control which displays the product template fields and product custom fields.
Code: Select all
<div class="customFieldsWrapper">
<uc:CustomFields ID="CustomFields" runat="server" />
</div>
Re: Need product template assistance.
Thanks for your guidance David. I was able to take code from ProductCustomerFieldsDialog.ascx, and put that in BuyProductDialog.ascx. Here is part of what I did.
Put this in BuyProductDialog.ascx.
Put this in the code behind of BuyProductDialog.ascx.
That was pretty straightforward. The web code in this solution is clean and easy to read. A couple of using statements were required for the above as well. I also created a ProductDescription2.ascx control, similar to its original namesake, but lacking the CustomFields control. Then replaced references to ProductDescription.ascx with the new version 2 of this control.
Put this in BuyProductDialog.ascx.
Code: Select all
<table class="buyProductForm">
<asp:ListView ID="ProductTemplateFieldRows" runat="server" enableviewstate="false">
<ItemTemplate>
<tr>
<th class="rowHeader"><%#Eval("InputField.Name")%></th>
<td><%#Eval("InputValue")%></td>
</tr>
</ItemTemplate>
</asp:ListView>
<asp:ListView ID="ProductCustomFieldRows" runat="server" enableviewstate="false">
<ItemTemplate>
<tr>
<th class="rowHeader"><%#Eval("InputField.Name")%></th>
<td><%#Eval("InputValue")%></td>
</tr>
</ItemTemplate>
</asp:ListView>
Code: Select all
private void fillProductCustomRows(Product product)
{
// Called from Page_Init() within "if (_Product != null)" clause.
if (product != null)
{
List<ProductCustomField> customFields = (from cf in _Product.CustomFields
where !string.IsNullOrEmpty(cf.FieldValue)
select cf).ToList();
ProductCustomFieldRows.DataSource = customFields;
ProductCustomFieldRows.DataBind();
}
}
private void fillProductTemplateRows(Product product)
{
// Called from Page_Init() within "if (_Product != null)" clause.
if (product != null)
{
List<ProductTemplateField> templateFields = (from tf in _Product.TemplateFields
where !string.IsNullOrEmpty(tf.InputValue) && tf.InputField.IsMerchantField
select tf).ToList();
ProductTemplateFieldRows.DataSource = templateFields;
ProductTemplateFieldRows.DataBind();
}
}
Re: Need product template assistance.
Looks good Ken!
Thanks for posting your solution.
Thanks for posting your solution.