UC doesn't have the best tokens available for product display on rules emails. Attached are a few patches that can be used to add a few additional tokens to the rules order tokens for displaying attribute information. Tested against 3.9. NOT tested against product classes, only the default "product" node.

The reason for these patches, is to allow an admin to create much more informative "rules based" status update emails. The default message is very vague, tells the customer nothing and expects the customer to login to the site to view order details, etc. People these days are conditioned to receive an email with all pertinent information. These tokens allow the site admin to provide better details during status updates about a given order by listing what is on the order. The links allow for the possibility of a customer to re-order a product later, by looking through email to find it again instead of hunting for it on the site.

"Why not do this through a template?" Because I don't code and the templates are a pain in the arse. Throw a few extra tokens at rules and it can do the exact same thing as the templates, without the headache of trying to figure out how to code it by hand.

Note: These patches were created a few months back by my trusty programmer, for one of my sites and I'm just now getting around to adding them on here. Forgive me if the descriptions below are mixed up, I'm serving from memory.

a-order_products_links_token-2139337-1.patch
Displays the product title (node title) and creates a link back to the node of that product

b-order_products_attributes_token-2139337-1.patch
Displays a given product along with all attributes belonging to that product. Does NOT provide any links back to the product; displayed as plain text.

c-order_products_links_attributes_token-2139337-1.patch
Same as patch b, however it also provides a link for the product title, similar to patch a

abc-order_products_links_attributes_all_tokens-2139337-1.patch
A collection of all three patches, conveniently bundled into one. Pick and choose how you want to output the products.

----

To the maintainers: If you want to look into adding this functionality into UC core, feel free. Otherwise, these are available for others who would like or need similar functionality. Feel free to close whenever and allow SEO to do it's magic.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

philsward created an issue. See original summary.

TR’s picture

Status: Active » Needs review

Let's see what the testbot thinks ...

The last submitted patch, a-order_products_links_token-2139337-1.patch, failed testing.

The last submitted patch, b-order_products_attributes_token-2139337-1.patch, failed testing.

The last submitted patch, c-order_products_links_attributes_token-2139337-1.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, abc-order_products_links_attributes_all_tokens-2139337-1.patch, failed testing.

philsward’s picture

Another go... If it's successful, I'll run with the rest.

philsward’s picture

Never added a patch... no idea how to get it to kick off the test.

TR’s picture

Status: Needs work » Needs review

Normally you just set the issue to "Needs review" and that should trigger the testbot. The new testbot is a little flaky though, so if that doesn't start the test click on the "Add test" link next to the comment with the patch and test it again.

Status: Needs review » Needs work

The last submitted patch, 8: a-order_products_links_token-2139337-2.patch, failed testing.

philsward’s picture

@TR thanks :) looks like the second one failed again, so I'm back to the drawing board. I'll look for the test link after I get the next batch from my programmer.

TR’s picture

Status: Needs work » Needs review
FileSize
1.22 KB

It looks like the problem is that your patch uses DOS line terminators instead of Unix. Here's the same patch converted to the proper format.

philsward’s picture

@TR yeah, that's kind of what my programmer was saying. He gave me some other patch files to try: "The files that I have sent you do not contain CRLF, but when I downloaded your uploaded file from drupal.org, it has CRLF. I send the files in a zip file, hopefully that helps."

I'll upload the updated versions and see what happens. It "might" be some weird issue with my windows computer converting them...