BUG? Confirmation Email shows Merchant Fields - ignores nVel

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

BUG? Confirmation Email shows Merchant Fields - ignores nVel

Post by ZLA » Mon Jun 01, 2009 8:03 pm

The Order Confirmation Email Template includes the following code:

Code: Select all

#foreach($orderItemInput in $orderItem.Inputs)
#if (!$orderItemInput.IsMerchantField)
<br /><b>$orderItemInput.Name:</b> $orderItemInput.InputValue 
#end
#end
It didn't seem to be working so I added the following to see IsMerchantField:

Code: Select all

#foreach($orderItemInput in $orderItem.Inputs)
#if (!$orderItemInput.IsMerchantField)
<br /><b>$orderItemInput.Name:</b> $orderItemInput.InputValue <i>$orderItemInput.IsMerchantField</i>
#end
#end
That was the only change. When the email is produced, it shows the following in the description column:
OrderConfirmation.jpg
I've confirmed that these fields are Merchant fields (still set to their original AC values).

Two questions:
1) Why are the merchant fields being displayed when the nVelocity code says not to?
2) Why didn't <i>$orderItemInput.IsMerchantField</i> display an italic one or zero?

Thanks in Advance. -- ZLA

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: BUG? Confirmation Email shows Merchant Fields - ignores nVel

Post by mazhar » Tue Jun 02, 2009 9:32 am

Confirmed, just logged the issue. You can track progress here
http://bugs.ablecommerce.com/show_bug.cgi?id=8123

Its because we haven't any property IsMerchantField defied at OrderItemInput class. You may try to workaround by using product information available with order item. Here is some code to float the idea

Code: Select all

#foreach($ptf in $orderItem.Product.TemplateFields)
#if(!$ptf.InputField.IsMerchantField && $ptf.InputField.Name == $orderItemInput.Name)
<br /><b>$orderItemInput.Name:</b> $orderItemInput.InputValue
#end
#end

User avatar
nickc
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Thu Nov 29, 2007 3:48 pm

Re: BUG? Confirmation Email shows Merchant Fields - ignores nVel

Post by nickc » Tue Jun 02, 2009 9:35 am

IsMerchantField is not a member of the OrderItemInput class. You'd have to dig it out of OrderItem.Product.TemplateFields[n].InputField somehow - looks like a Name comparison might be the only way. Challenging to do in the nVelocity world. I turned off Able's order confirmation triggers and inserted my own methods into OnePageCheckout to give me more flexibilty with confirmation and vendor emails. I still use the nVelocity engine and Able mail templates, but now can add my own classes to the hashtable that nVelocity uses to process text.

ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Re: BUG? Confirmation Email shows Merchant Fields - ignores nVel

Post by ZLA » Tue Jun 02, 2009 11:19 am

Thanks for the confirmation Mazhar. Any chance AC will republish the default email templates for a final workaround? In my case, normal merchant fields are okay but not the ones I use for required fields and for regular expression validation. So I'll probably just compare directly against $orderItemInput.Name for "Regex*" and "RequiredFieldsList".

Would your code still display customer fields? I know the table ac_ProductTemplateFields only contains merchant fields but the object could include all. I would think you would still want to loop through orderItem.Inputs and then use a second loop to find the matching product template field and then see if it was a merchant field or not. I'm not strong yet at nVelocity so I can't show any code yet.

By the way, examining the Product.TemplateFields collection may not be a good idea from a data consistency viewpoint. For example, the Order Confirmation should display the information at the time of the order, even if re-generated manually. orderItem.Inputs meets that requirements. But the Product.TemplateFields could change after an order is placed and could produce an inaccurate order confirmation email. It's unlikely but the correct solution would be to have the IsMerchantField value added to ac_OrderItemInputs and make it visible in the objectdatasource. Should I report that as a feature request or do you think it will be included as part of the bug fix?

-- ZLA

ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Re: BUG? Confirmation Email shows Merchant Fields - ignores nVel

Post by ZLA » Tue Jun 02, 2009 11:29 am

FYI, this bug affects the following default templates:
  • Customer Order Notification
  • Gift Certificate Validated
  • Order Shipped Partial
  • Order Shipped
  • ESD file is activated
  • License key is fulfilled

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: BUG? Confirmation Email shows Merchant Fields - ignores nVel

Post by Logan Rhodehamel » Tue Jun 02, 2009 12:25 pm

ZLA wrote:Should I report that as a feature request or do you think it will be included as part of the bug fix?
Whatever information we record will be static as part of the order. The class OrderItemInput should have a property IsMerchantField. A bug report was entered on this a long time ago and somehow got overlooked.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

Post Reply