Forum

Thread tagged as: Problem, Error, Shop

Perch Shop Email Errors

I seem to be having a problem with emails not sending. Currently I am trying to make use of the default templates but nothing is being sent out on purchase completion.

When I manually try to change the status on a order to one that should send out an email (dispatched or created) I get this error:

Fatal error: Uncaught Error: Call to a member function to_array() on boolean in /customers/e/a/0/aatelierengland.co.uk/httpd.www/perch/addons/apps/perch_shop/lib/PerchShop_Order.class.php:525 Stack trace: #0 /customers/e/a/0/aatelierengland.co.uk/httpd.www/perch/addons/apps/perch_shop/lib/PerchShop_Order.class.php(330): PerchShop_Order->format_invoice_for_template(Array) #1 /customers/e/a/0/aatelierengland.co.uk/httpd.www/perch/addons/apps/perch_shop/lib/PerchShop_Events.class.php(25): PerchShop_Order->send_order_email(Object(PerchShop_Email)) #2 /customers/e/a/0/aatelierengland.co.uk/httpd.www/perch/core/lib/Perch.class.php(228): PerchShop_Events::order_status(Object(PerchSystemEvent)) #3 /customers/e/a/0/aatelierengland.co.uk/httpd.www/perch/addons/apps/perch_shop/lib/PerchShop_Order.class.php(95): Perch->event('shop.order_stat...', Object(PerchShop_Order), 'dispatched') #4 /customers/e/a/0/aatelierengland.co.uk/httpd.www/perch/addons/apps/perch_shop_orders/modes/order.detail.pre.php(33): PerchShop_Order->set_status('di in /customers/e/a/0/aatelierengland.co.uk/httpd.www/perch/addons/apps/perch_shop/lib/PerchShop_Order.class.php on line 525

When I go back to orders the status has changed but no email. I am doing something wrong with the setup of the emails?

Diagnostics:

Perch: 2.8.32, PHP: 7.0.12, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32), perch_blog (5.0), perch_gallery (2.8.6), perch_shop_orders (PERCH_SHOP_VERSION), perch_shop_products (1.0.9), perch_shop (1.0.9), perch_members (1.5)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_members', 'perch_shop', 'perch_blog', 'perch_gallery' ); ?>
PERCH_LOGINPATH: /perch
PERCH_PATH: /customers/e/a/0/aatelierengland.co.uk/httpd.www/perch
PERCH_CORE: /customers/e/a/0/aatelierengland.co.uk/httpd.www/perch/core
PERCH_RESFILEPATH: /customers/e/a/0/aatelierengland.co.uk/httpd.www/perch/resources
Image manipulation: GD
PHP limits: Max upload 96M, Max POST 96M, Memory: 536870912M, Total max file upload: 96M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/
HTTP_HOST: www.aatelierengland.co.uk
DOCUMENT_ROOT: /customers/e/a/0/aatelierengland.co.uk/httpd.www

Thanks :)

Martin Murphy

Martin Murphy 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you tried the email test tool under Settings?

Hi Drew, sorry yes I forgot to mention that in OP. Yes I got that email through straight away without any issue.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you see the emails listed in the Emails section of the Shop app?

What status is each configured to send for? Have you change any of the other settings?

Yes they are listed in the emails section. The order paid is set to 'Created' and the order dispatched is set to 'Dispatched'.

I haven't done much configuring with it yet as I just wanted to know they were working first :)

Drew McLellan

Drew McLellan 2638 points
Perch Support

You probably don't want it on "created" as the order won't have sufficient information to send an email.

Ah okay, I just left it on that. Is it best to have it on 'paid'?

Drew McLellan

Drew McLellan 2638 points
Perch Support

That would be the logical place, as an order is really only a potential purchase until it hits the paid status.

That's fine, I have changed it to that however I still seem to be getting the errors when changing the status of the order to one that should fire out an email.

Any idea what they mean? :(

UPDATE: I deleted both emails and set up the emails again from scratch. Put an order through and the email came through. Absolutely no idea what was going on but it seems to be working now :/

Wondering if you might be able to shed some light on the order dispatched email.

For some reason the product data doesn't seem to be being brought through into the email when changing the order status.

My template for that section is:

<perch:orderitems>
    <tr>
        <td align="left"><perch:orderitem id="title" type="hidden" /></td>
        <td align="left"><perch:orderitem id="quantity" type="hidden" /></td>
        <td align="left"><perch:orderitem id="total_with_tax" type="hidden" format="$:%.2n" /></td>
    </tr>
</perch:orderitems>

However anything with <perch:shop /> seems to be getting the information absolutely fine.

Drew McLellan

Drew McLellan 2638 points
Perch Support

It shouldn't be any different for any of the statuses - it's all the same routine.

Are the templates equivalent?

Following this as I also have this issue with the order details not being passed to the order dispatched email upon staus change

It's strange because if I place an order through the site, I get the 'paid' email through fine with the product details on there.

However changing the status within the admin panel to dispatched, I get the email fine but with no product details. As a test I changed the status manually back to paid. Again this sent the paid email but with no product details again. Not sure where to look on this one.

Exactly the same here. For now I have just dropped the order details from the dispatched message, but obviously that is only a short term solution!

Drew is there anything you know that we could check to see what might be going wrong?

I have the same problem with order details not showing up in the dispatched email.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

I imagine these replies have not been seen by Drew.

  1. Adding to someone else's thread
  2. Or updating a thread where you told us the problem was solved

will mean we miss the thread. It's been closed in our system. This is why we ask you to start your own thread for each issue.

If you have a problem always start a new thread with your Diagnostics Report, template and so on. Reference the previous thread if you believe it to be the same issue.

If you realise you have a new issue, after telling us the issue is solved. Again it is best to start a new thread, often issues are not related and by starting a new thread we make sure we get all of the relevant information.