Forum

Thread tagged as: Error, Shop

Uncaught Error: Call to a member function customerFirstName() on boolean

Hello again,

While attempting to diagnose my previous issue with addresses, I have now encountered this on checkout.

[31-Jan-2018 16:54:50 UTC] PHP Fatal error:  Uncaught Error: Call to a member function customerFirstName() on boolean in /homepages/21/d688763965/htdocs/utt/perch/addons/apps/perch_shop/lib/gateways/PerchShopGateway_default.class.php:239
Stack trace:
#0 /homepages/21/d688763965/htdocs/utt/perch/addons/apps/perch_shop/lib/gateways/PerchShopGateway_default.class.php(42): PerchShopGateway_default->get_payment_card(Object(PerchShop_Order))
#1 /homepages/21/d688763965/htdocs/utt/perch/addons/apps/perch_shop/lib/PerchShop_Order.class.php(90): PerchShopGateway_default->take_payment(Object(PerchShop_Order), Array)
#2 /homepages/21/d688763965/htdocs/utt/perch/addons/apps/perch_shop/lib/PerchShop_Runtime.class.php(620): PerchShop_Order->take_payment('purchase', Array)
#3 /homepages/21/d688763965/htdocs/utt/perch/addons/apps/perch_shop/runtime/cart.php(186): PerchShop_Runtime->checkout('paypal-express', Array, 'default')
#4 /homepages/21/d688763965/htdocs/utt/checkout.php(59): perch_shop_checkout('paypal-express', Array)
#5 {main}
  thrown in /homepages/21/d688763965/htdocs/utt/perch/addons/apps/perch_shop/lib/gateways/PerchShopGateway_default.class.php on line 239

I had switched to manual gateway to quickly test a few things, then this seemed to happen when I switched back to paypal-express. Manual no longer works either.

This is the checkout code:

<?php  if (!perch_shop_addresses_set()) { perch_shop_edit_address_form(false, [ 'template' => 'checkout/customer_create_passwordless.html', ]); }else{  // your 'success' return URL $return_url = 'https://www.***.org.uk/paypal-complete.php'; $cancel_url = 'https://www.***.org.uk/paypal-failed.php';  perch_shop_checkout('paypal-express', [ 'return_url' => $return_url, 'cancel_url' => $cancel_url, ]); } ?>

Short diagnostics:

Perch: 3.0.13, PHP: 7.1.13, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (3.0.13), assets (3.0.13), categories (3.0.13), perch_blog (5.6.1), perch_events (1.9.5), perch_forms (1.10), perch_shop_orders (1.2.5), perch_shop_products (1.2.5), perch_shop (1.2.5), perch_members (1.6.2)
App runtimes: <?php $apps_list = [ 'content', 'categories', 'perch_blog', 'perch_forms', 'perch_members', 'perch_shop', ];
PERCH_LOGINPATH: /perch
PERCH_PATH: /homepages/21/d688763965/htdocs/utt/perch
PERCH_CORE: /homepages/21/d688763965/htdocs/utt/perch/core
PERCH_RESFILEPATH: /homepages/21/d688763965/htdocs/utt/perch/resources
Image manipulation: GD
PHP limits: Max upload 64M, Max POST 64M, Memory: 256M, Total max file upload: 64M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
HTTP_HOST: www.xxxx.org.uk
DOCUMENT_ROOT: /kunden/homepages/21/d688763965/htdocs/utt
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Chris McMahon

Chris McMahon 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you logged in as a customer?

I shouldn't be - I'm creating password-less accounts.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you doing that multiple times in the same session?

Yes, quite a few times. I had been clearing my history now and again, but not every time.

I then deleted the orders & customers created (through the Perch Admin).

Have I knackered something?

Drew McLellan

Drew McLellan 2638 points
Perch Support

You probably want to log out between tests.

Like this?

if (perch_shop_order_successful()) {
        perch_shop_empty_cart();
        perch_member_log_out();
}

Is there anything I can do to fix the current error?

Aha, you're a gentleman Drew, working now, many thanks for all your help. I'm currently basking in post-I-havent-a-clue-what-I'm-doing endorphins.

There's a suggestion that we learn from mistakes. By that yardstick I must be a genius.