Display custom fields last?

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
User avatar
triplw
Commander (CMDR)
Commander (CMDR)
Posts: 144
Joined: Sat Jan 12, 2008 5:34 pm
Contact:

Display custom fields last?

Post by triplw » Wed Jun 04, 2008 3:29 pm

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?

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Display custom fields last?

Post by jmestep » Wed Jun 04, 2008 7:31 pm

Check out the App_Code/producthelper.cs
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>"));
                }
            }
        }
    }

under the section of code that starts out:
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

User avatar
triplw
Commander (CMDR)
Commander (CMDR)
Posts: 144
Joined: Sat Jan 12, 2008 5:34 pm
Contact:

Re: Display custom fields last?

Post by triplw » Wed Jun 04, 2008 10:21 pm

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?

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Display custom fields last?

Post by jmestep » Thu Jun 05, 2008 7:35 am

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

User avatar
m_plugables
Commander (CMDR)
Commander (CMDR)
Posts: 149
Joined: Tue Mar 11, 2008 12:44 am
Contact:

Re: Display custom fields last?

Post by m_plugables » Sat Jun 07, 2008 1:31 am

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

Code: Select all

<asp:PlaceHolder ID="phCustomFields" runat="server" EnableViewState="false">
			</asp:PlaceHolder>
Now edit the ConLib/BuyProduct.ascx.cs file and locate the following line of code in Page_Init method.

Code: Select all

ProductHelper.BuildProductChoices(_Product, phOptions);
and replace it with the following line of code

Code: Select all

ProductHelper.BuildProductChoices(_Product, phCustomFields);
Image
Visit the links below to Download Plugins for your AC7 Store
http://www.plugables.com
http://blog.plugables.com

User avatar
triplw
Commander (CMDR)
Commander (CMDR)
Posts: 144
Joined: Sat Jan 12, 2008 5:34 pm
Contact:

Re: Display custom fields last?

Post by triplw » Fri Jun 27, 2008 3:56 pm

I tried mazhar's solution with no success. Instead of displaying the custom field last, it didn't display at all. ??

User avatar
mfreeze
Commodore (COMO)
Commodore (COMO)
Posts: 421
Joined: Mon Jan 24, 2005 2:07 pm
Location: Washington, NJ
Contact:

Re: Display custom fields last?

Post by mfreeze » Wed Jul 07, 2010 2:12 pm

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]]
Mary E Freeze

Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development

http://www.ffgraphics.com

User avatar
triplw
Commander (CMDR)
Commander (CMDR)
Posts: 144
Joined: Sat Jan 12, 2008 5:34 pm
Contact:

Re: Display custom fields last?

Post by triplw » Wed Sep 08, 2010 7:41 am

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?

plugables
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Sat Aug 15, 2009 4:04 am
Contact:

Re: Display custom fields last?

Post by plugables » Tue Sep 21, 2010 4:22 am

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

Code: Select all

if (!string.IsNullOrEmpty(tf.InputValue) && tf.InputField.IsMerchantField)
to

Code: Select all

if (!string.IsNullOrEmpty(tf.InputValue))

Post Reply