I am in the process of upgrading from 7.0.0 to 7.0.4. I have some custom code that uses item.Product.ProductTemplate and my understanding is that I should be using CustomFields instead of ProductTemplate. I'm wondering how to update the following code:
//Used to clear template information entered by the user after submission.
private static void ClearProductTemplateInput(BasketItem item, Control container)
{
// COLLECT ANY ADDITIONAL INPUTS
Product product = item.Product;
if (product != null)
{
ProductTemplate template = item.Product.ProductTemplate;
if (template != null)
{
foreach (InputField input in template.InputFields)
{
//ONLY LOOK FOR CUSTOMER INPUT FIELDS
if (!input.IsMerchantField)
{
//SEE IF WE CAN LOCATE THE CONTROL
Control findControl = PageHelper.RecursiveFindControl(container, input.UniqueId);
if (findControl != null)
{
TextBox tb = findControl as TextBox;
if (tb != null)
{
tb.Text = "";
}
}
}
}
}
}
}
Thanks in advance,
David Noell
Problem with item.Product.ProductTemplate
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Problem with item.Product.ProductTemplate
It it's using product templates in 7.0.0, it would still be using product templates in 7.0.4 and you don't need to switch to putting everything in product custom fields.
Where is your code located?
Where is your code located?
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