Page 1 of 1

Add Merchant/Custom Fields to Digital Fulfilment Email

Posted: Wed Sep 14, 2011 2:17 am
by Witchdoctor
Hi all,

I have digital goods being able to be purchased from our shop.

The digital goods represent a unique code used to access an online course, and can be purchased for multiple students. In the product page, merchant/custom fields are completed as a product template to identify each student (eg name, contact details etc). Each student/product is entered as a separate item to the shopping cart, and a unique digital good serial key is issued per student. There are then unique emails sent out as fulfillment emails, for each student. This section of the procedure is all good - all works as required.

What I would like to do is to edit the Fulfillment Email Template so that it will put the merchant/custom fields from each student on the email, and the quantity (don't need the ID, price or total).

There is obviously something a bit wrong with my code however, because all i can bring up is the actual name of the course/product issued for the code, and quantity (as required - all OK this part), but the other custom fields won't appear????!!

Please help. Able 7.0.3

TIA. Wendy

Code: Select all

<table class="Email">
<tr>
<td style="background:#cccccc; color:#00000; text-align: center;"><strong>Name</strong></td>
<td style="background:#cccccc; color:#00000; text-align: center;"><strong>Quantity</strong></td>
</tr>

<tr>
<td class="Email">$orderItem.Name
#if ($orderItem.VariantName.Length > 0)
($orderItem.VariantName)
#end

#foreach($orderItemInput in $orderItem.Inputs)
#if (!$orderItemInput.IsMerchantField)
<br /><b>$orderItemInput.Name:</b> $orderItem.Input.InputValue
#end
#end
</td>

<td class="Email" style="text-align: center;">$orderItem.Quantity</td>
</tr>
</table>		


Re: Add Merchant/Custom Fields to Digital Fulfilment Email

Posted: Thu Sep 15, 2011 2:15 am
by Witchdoctor
Hi all,

Update - still having no joy on getting this to work.

I have tried so many different variations on this, I can't remember them all today. I found another old posting that tried to go the opposite way with this kind of problem, and put the serial key in the confirmation order email, but it appeared from their replies that this was not possible to do. Therefore, I am wondering if it is the same case for me, simply not possible to have 'product' data on a fulfillment email template?

Theoretically, I understand that this is all to do with nVelocity variables, but I don't really know where all of the relevant variables are being set, and how they relate to tables/fields, or even a SQL query in the database. Where are the $orderItem variables listed? What is available, and where are they set?

The final aim of this is to have this data on the Serial Key Fulfillment Email:

Order Item Name
Order Item Custom Fields data
Quantity of Item (which will always be 1, because one serial key email per item)


Help, please? Thanks, Wendy

Re: Add Custom Fields to Digital Fulfilment Email (RESOLVED)

Posted: Thu Sep 15, 2011 9:08 pm
by Witchdoctor
Hi all,

Issue resolved - sort of, or at least I can rework things to make it do what I want anyway.

The problem ended up with the way that I had constructed the product for purchase. I had made up a product with a kit/bundle of 3 separate digital goods, and set them up as a radio-button component to select one of the options for sale:
* Digital Good A (Course A)
* Digital Good B (Course B)
* Digital Goods A & B (Courses A&B)

Each kit product item had it's own separate digital good and fulfillment email, and the custom fields were attached to the main product (not the kit components).

Which is why the product order was working all OK, and the fulfillment email was issuing correctly for the serial key, but of course, the custom fields were attached to the main product, not where the rest of the data was coming from, for the digital good (which was the individual kit component product). I blame it on my 2 day migraine. 8) It's my excuse, and I'm sticking to it! Not sure yet if my head hurts more or less because I solved it...



I ended up, and because there is special coding on these options for a specific client, ditching the kit/bundle product, and leaving all the components as (public) access, but under a (hidden) catalogue folder, and giving the client a direct link to the folder so they could choose the course products individually.

Of course, this leaves the products all open to anyone on the site who does a search (it isn't totally really hidden), but I fixed that also. I put the client in a special user group, I made the 'normal' price of the product $10,000, and then put in a price rule in for the special user group for the 'real' price (less than $100) they should pay. There are also links to the product that everybody else should purchase at the normal RRP. This will ensure that the client always logs in to purchase (to get their special price), in addition to everybody else leaving the product alone if they DO happen to find it.

Thanks to people who reviewed my postings.

Cheers, Wendy


FYI - THIS coding works in the HTML :

Code: Select all

<table class="Email">
        <tr>
              <td style="background:#cccccc; color:#00000; text-align: center;"><strong>Name</strong></td>
              <td style="background:#cccccc; color:#00000; text-align: center;"><strong>Quantity</strong></td>
  			</tr>

        <tr>
              <td class="Email">$orderItem.Name
                    #if ($orderItem.VariantName.Length > 0)
                    		($orderItem.VariantName)
                    #end																			
	    #foreach($orderItemInput in $orderItem.Inputs)
                                                <br /><b>$orderItemInput.Name:</b> $orderItemInput.InputValue
                    #end
               </td>
  
  	  <td class="Email" style="text-align: center;">$orderItem.Quantity
  	</td>
  
  </tr>

</table>