Discussions

"No line items found." in email receipt if user is not authenticated during checkout

We need to allow unauthenticated users shop and check out, but when they receive the email confirmation receipt, it does not list the line items and states "No line items found."

I am using [commerce-order:commerce_line_items] to pull the line items, and it works fine if the user is authenticated.

Help soon please we launch tomorrow thanks!! :)

Posted: Oct 12, 2011

Comments

rfay Randy Fay on October 12, 2011

Are you configuring the action "send_mail" in the rule checkout_order_email ?

Perhaps you could attach an export of the rule you're using.

When I look at this I see no easy way to get the line items. They're certainly not there by default.

For your launch, you can just go back to the default and give them a link to the order :-)

leez on October 12, 2011

Hi rfay,

Thanks for responding. Yes, configuring the action "Send mail" I use the token [commerce-order:commerce_line_items] to produce the line items in the email. (You can view the available tokens under Replacement patterns.) This works fine only if the user is logged in during checkout (which none of our users will be.)

We'd really prefer to list the line items in the email, but you've got me curious -- can you include a link to the order for an anonymous user? And if so, how?

Thx!

rfay Randy Fay on October 12, 2011

Of course, you'll have to have the default setup where a user is created for the anon user during checkout to do that. (If you're not working from a commerce kickstart install you'll want to install one and experiment with the default configuration; a user is created during checkout, and the email to them explains the new account and the order and provides a link to it.)

[commerce-order:commerce_line_items] is not an available token in a plain vanilla commerce kickstart install, so I'm wondering how you got access to it. Did you add an entity-has-field condition to gain access or something? That's why I asked you to attach a dump of your rule.

trajedy on October 13, 2011

Entity has field gives access to the line items token. Im also stuck on this issue. I tried shuffling the weighting around so that an invoice is sent after the user account is created, but the line items token still outputs the empty view text.

All the other tokens show up fine [commerce_order:commerce_order_total], [commerce_order:commerce_customer_billing]

Is there a permission that needs to be set for an anonymous user so they are able to view the line items? What are the implications of setting 'View own orders of any type' to an anonymous user?

rfay Randy Fay on October 13, 2011

I'm sorry. I did think you were leez. Please accept my apologies and thanks for posting this.

It's probably more convenient to post it as an attachment text file, but at least we have a start here.

trajedy on October 20, 2011

Any progress on this rfay? Ive noticed that the line items don't show on the 'completing checkout' event. But they show for the 'after updating an existing order' event. Perhaps they haven't been associated with the order at that point in the checkout process?? But that couldn't be possible, as you can view orders which are in 'Cart' phase.

Im stumped, have stumbled around the code for far too long.

trajedy on October 20, 2011

Adding 'administer line items' to the anonymous role allows the line items to be shown. Although im not too sure what the implications would be setting this permission on the anonymous user role.

Najtsirk on November 12, 2011

I'm also using Commerce invoice receipt and get no line items for anonymous user.

When i checked permission "administer line items" i get line items into commerce_receipte_email. But I saw that permission has security implications, so I assume we need separate permisssion for see line items.

Best,

Najtsirk

r4f on December 7, 2011

Commerce E-mail is not setup to send an e-mail after an order has updated its status.
For instance from Pending -> Shipped. (Or maybe someone can educate me if it's there)

I have a rule that sends an e-mail everytime an order is updated to shipped. With that e-mail I would like to at least send a list of the items that the customer has bought. (for not talking about the billing info which is just a number, but'll have to wait)

How do I do that? Without giving the anonymous user any permissions? And without hacking the commerce e-mail module. There must be a way!!!

Best Regards
Raf

esbon on November 19, 2012

Hi, I am in need of the same functionality there currently is in ubercart's E-mail admin checkout notification where all order attributes are included in the email. I've been using fields in line items types to accomplish ubercart 6 attributes