Forum

Thread tagged as: Error, Shop

Perch shop order status email

Hi When the status is changed in the orders section for say Paid to Dispatched. The email that is automatically sent to the customer misses out the following - item, options, quantity and unit price. Every thing else shows up though.
On the first initial order email that is sent out, all off the above is showing fine. So this seems to be only when status is changed in the admin section.
My debug from the orders admin page after trigger

SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='9ede1fbf24dd58a76fe7e2b8ceda5e95' LIMIT 1
UPDATE perch2_users SET userHash='b4097c1b7d1271214e1754de473db569' WHERE userID='1'
[67] SELECT p.privKey FROM perch2_user_privileges p
[27] SELECT * FROM (SELECT DISTINCT settingID, settingValue, userID FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID, settingValue, userID
[nil] SELECT collectionID, collectionKey, collectionEditRoles FROM perch2_collections WHERE collectionInAppMenu=1 ORDER BY collectionOrder ASC
[1] SELECT * FROM perch2_shop_orders WHERE orderID='66' AND orderDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_currencies WHERE currencyID='47' LIMIT 1
[1] SELECT * FROM perch2_shop_customers WHERE customerID='1' AND customerDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_addresses WHERE addressID='85' AND addressDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_addresses WHERE addressID='85' AND addressDeleted IS NULL LIMIT 1
Setting order status to dispatched
UPDATE perch2_shop_orders SET orderDynamicFields='{\"status\":\"dispatched\"}', orderStatus='dispatched', orderUpdated='2016-09-14 14:58:01' WHERE orderID='66'
No ids to log.
[1] SELECT * FROM perch2_shop_order_statuses WHERE statusKey='dispatched' AND statusActive=1 AND statusDeleted IS NULL
[1] SELECT * FROM perch2_shop_emails WHERE emailStatus=6 AND emailActive=1
Sending customer email
[1] SELECT * FROM perch2_shop_customers WHERE customerID='1' AND customerDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_members WHERE memberID='48' LIMIT 1
Using email template: /Users/xyxy/Sites/licoriceDesign/perch/templates/shop/emails/order_dispatched.html (html)
[1] SELECT * FROM perch2_shop_order_statuses WHERE statusKey='dispatched' AND statusDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_addresses WHERE addressID=85 AND addressDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
[1] SELECT * FROM perch2_shop_addresses WHERE addressID=85 AND addressDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
[1] SELECT * FROM perch2_shop_order_items WHERE orderID='66' ORDER BY itemID ASC
[1] SELECT * FROM perch2_shop_order_statuses WHERE statusKey='dispatched' AND statusDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_currencies WHERE currencyID=47 LIMIT 1
[1] SELECT * FROM perch2_shop_shippings WHERE shippingID=0 AND shippingDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_products WHERE productID=19 AND productDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_currencies WHERE currencyActive=1 AND currencyID=47
Looking up missing property sender_name
Looking up missing property sender_email
Building message with Perch template
[1] Using template: /templates/shop/emails/order_dispatched.html
Using sub-template: /templates/shop/emails/email.html
Using sub-template: /templates/shop/emails/_email_header.html
Using sub-template: /templates/shop/emails/_email_footer.html
[27] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
Sent email: "Your order has been dispatched" to email@mail.com
[1] SELECT * FROM perch2_shop_order_statuses WHERE statusKey='dispatched' AND statusDeleted IS NULL LIMIT 1
[1] SELECT oi.*, p.* FROM perch2_shop_order_items oi, perch2_shop_products p WHERE oi.itemType='product' AND oi.productID = p.productID AND orderID=66
[10] SELECT * FROM perch2_shop_order_statuses WHERE 1=1 AND statusDeleted IS NULL ORDER BY statusIndex ASC
[10] SELECT statusKey FROM perch2_shop_order_statuses WHERE statusDeleted IS NULL ORDER BY statusIndex ASC
[0] SELECT promoID FROM perch2_shop_order_promotions WHERE orderID=66
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
Queries: 36
Memory: 4.738

Any ideas?

William Chicken

William Chicken 1 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What does your template look like?

It is the one that comes with perch. Unedited.

Looking at the template - Everything that works has perch:shop e.g. <p><b>Order:</b> <perch:shop id="orderInvoiceNumber" type="hidden" /></p>
Everything that doesn't has perch:order item e.g. <td><perch:orderitem id="title" type="hidden" /> </td>
This must have something to do with it as it works being sent from the order as it's created but not from the admin.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, thanks, we'll log it as an issue.

Abby Larsen

Abby Larsen 0 points
Registered Developer

I’m having the same problem. Is there a workaround in the interim as we wait for a fix?