Display custom fields last?
Display custom fields last?
I am using a product template for a custom field on products that also are kits. Product options are being displayed to the customer in this order: Variants, Custom Fields, then Kit Component Options. I would like the Custom Fields to be displayed last.
On my site it is the field that says: Enter any Special Instructions.
http://72.167.108.225/ac7_b8272/Product ... egoryId=86
Can anyone tell me what file controls the order that the product fields are displayed and how to modify it?
On my site it is the field that says: Enter any Special Instructions.
http://72.167.108.225/ac7_b8272/Product ... egoryId=86
Can anyone tell me what file controls the order that the product fields are displayed and how to modify it?
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Display custom fields last?
Check out the App_Code/producthelper.cs
You could probably move this section
under the section of code that starts out:
public static List<int> BuildKitOptions(Product product, PlaceHolder phOptions)
You could probably move this section
Code: Select all
public static void BuildProductChoices(Product product, PlaceHolder phChoices)
{
// ADD IN THE PRODUCT TEMPLATE CHOICES
ProductTemplate template = product.ProductTemplate;
if (template != null)
{
foreach (InputField input in template.InputFields)
{
if (!input.IsMerchantField)
{
// ADD THE CONTROL TO THE PLACEHOLDER
phChoices.Controls.Add(new LiteralControl("<tr><td colspan=\"2\">"));
phChoices.Controls.Add(new LiteralControl((input.UserPrompt + "<br />")));
WebControl o = input.GetControl();
if (o != null)
{
phChoices.Controls.Add(o);
}
phChoices.Controls.Add(new LiteralControl("</td></tr>"));
}
}
}
}
public static List<int> BuildKitOptions(Product product, PlaceHolder phOptions)
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: Display custom fields last?
Thanks for your reply Judy. I had already tried moving that section of code. I moved it to right above where it starts: public static string GetSKU(object dataItem)...
The options are displaying exactly the same. Any other ideas?
The options are displaying exactly the same. Any other ideas?
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Display custom fields last?
I was just guessing- hadn't tried it. I just tried moving some things around in other places and still had no success.
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
- m_plugables
- Commander (CMDR)
- Posts: 149
- Joined: Tue Mar 11, 2008 12:44 am
- Contact:
Re: Display custom fields last?
Locate the PlaceHolder control with ID="phAddToBasketWarningKit" in ConLib/BuyProduct.ascx file and place the following code just after the closing tag of the control found in first step
Now edit the ConLib/BuyProduct.ascx.cs file and locate the following line of code in Page_Init method.
and replace it with the following line of code
Code: Select all
<asp:PlaceHolder ID="phCustomFields" runat="server" EnableViewState="false">
</asp:PlaceHolder>
Code: Select all
ProductHelper.BuildProductChoices(_Product, phOptions);
Code: Select all
ProductHelper.BuildProductChoices(_Product, phCustomFields);

Visit the links below to Download Plugins for your AC7 Store
http://www.plugables.com
http://blog.plugables.com
Re: Display custom fields last?
I tried mazhar's solution with no success. Instead of displaying the custom field last, it didn't display at all. ??
- mfreeze
- Commodore (COMO)
- Posts: 421
- Joined: Mon Jan 24, 2005 2:07 pm
- Location: Washington, NJ
- Contact:
Re: Display custom fields last?
If anybody is still interested in doing this, there is an easy way in 7.0.3 and above.
1. Set your product description in showproduct1 to [[ConLib:ProductDescription ShowCustomFields="False"]]
2. Where you want your custom fields to display use [[ConLib:ProductCustomFieldsDialog]]
1. Set your product description in showproduct1 to [[ConLib:ProductDescription ShowCustomFields="False"]]
2. Where you want your custom fields to display use [[ConLib:ProductCustomFieldsDialog]]
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
Re: Display custom fields last?
Mary,
I can only get your method to work for the custom fields that the Merchant enters and not Customer input fields.
Am I missing something?
I can only get your method to work for the custom fields that the Merchant enters and not Customer input fields.
Am I missing something?
Re: Display custom fields last?
Customer input fields are supposed to be input by customer so I don't think it makes much sense to have the displayed ... but you can get them displayed by changing the following line in ProductCustomFieldsDialog.ascx.cs
to
Code: Select all
if (!string.IsNullOrEmpty(tf.InputValue) && tf.InputField.IsMerchantField)
Code: Select all
if (!string.IsNullOrEmpty(tf.InputValue))