Missing customer name

Open to all! Ask other shopowners for help.
Post Reply
Xpajun
Contributor
Posts: 187
Joined: Thu Mar 04, 2021 1:18 pm
Phoenix Version: v1.0.9.0
Has thanked: 3 times
Been thanked: 6 times

Missing customer name

Post by Xpajun »

I'm just about to go live with my 1.0.7.5 and have found that 'customers_name' is missing from orders>edit, invoices, packing_slips (including in the batch add-on)
It is, however,> orders on the orders page and in the data base>orders

This may have be a problem with 1.0.7.4 (no orders update for 1.0.7.5) and has been corrected in a later update, if it is I apologise for the question but could someone point me to which version it was corrected on

Thank you
Current Store is now running 1.0.9.0 - php 8.2.18
Now working on taking a short rest :D - php 8.2.18


Join The Code Co-op to get access to your library in the Code Co-op Forum
Xpajun
Contributor
Posts: 187
Joined: Thu Mar 04, 2021 1:18 pm
Phoenix Version: v1.0.9.0
Has thanked: 3 times
Been thanked: 6 times

Re: Missing customer name

Post by Xpajun »

Very much still getting problems with this.
My understanding is that the address block is created in admin>classes>order.php where the details for it are selected from the database by this query:

Code: Select all

      $order_query = tep_db_query("SELECT * FROM orders WHERE orders_id = " . (int)$order_id);
      $order = tep_db_fetch_array($order_query);
and then the address block is formed like so:

Code: Select all

      $this->customer = [
        'id' => $order['customers_id'],
        'name' => $order['customers_name'],
        'company' => $order['customers_company'],
        'street_address' => $order['customers_street_address'],
        'suburb' => $order['customers_suburb'],
        'city' => $order['customers_city'],
        'postcode' => $order['customers_postcode'],
        'state' => $order['customers_state'],
        'country' => ['title' => $order['customers_country']],
        'format_id' => $order['customers_address_format_id'],
        'telephone' => $order['customers_telephone'],
        'email_address' => $order['customers_email_address'],
      ];

      $this->delivery = [
        'name' => trim($order['delivery_name']),
        'company' => $order['delivery_company'],
        'street_address' => $order['delivery_street_address'],
        'suburb' => $order['delivery_suburb'],
        'city' => $order['delivery_city'],
        'postcode' => $order['delivery_postcode'],
        'state' => $order['delivery_state'],
        'country' => [ 'title' => $order['delivery_country']],
        'format_id' => $order['delivery_address_format_id']];

      if (empty($this->delivery['name']) && empty($this->delivery['street_address'])) {
        $this->delivery = false;
      }

      $this->billing = [
        'name' => $order['billing_name'],
        'company' => $order['billing_company'],
        'street_address' => $order['billing_street_address'],
        'suburb' => $order['billing_suburb'],
        'city' => $order['billing_city'],
        'postcode' => $order['billing_postcode'],
        'state' => $order['billing_state'],
        'country' => ['title' => $order['billing_country']],
        'format_id' => $order['billing_address_format_id'],
      ];

and then transfered to admin>orders.php here:

Code: Select all

            <tr>
              <td>
                <p><?php echo $address->format($order->customer, 1, '', '<br>'); ?></p>
                <p><?php echo $order->customer['telephone'] . '<br>' . '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></p>
              </td>
              <td><p><?php echo $address->format($order->delivery, 1, '', '<br>'); ?></p></td>
              <td><p><?php echo $address->format($order->billing, 1, '', '<br>'); ?></p></td>
            </tr>
But I get everything except the 'name'
Current Store is now running 1.0.9.0 - php 8.2.18
Now working on taking a short rest :D - php 8.2.18
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: Missing customer name

Post by heatherbell »

Xpajun wrote: Sat Sep 04, 2021 12:27 pm Very much still getting problems with this.
Sorry I don't know the answer but one of the benefits of being a Pro Supporter is that you can post this question in the VIP PRO Supporters forum where help and support direct from the Core Developers is available.
MyGamesShop
Contributor
Posts: 131
Joined: Wed Mar 10, 2021 3:02 am
Phoenix Version: v1.1.0.6
Has thanked: 8 times
Been thanked: 5 times

Re: Missing customer name

Post by MyGamesShop »

I had that problem a while back.

INSERT INTO `customers` (`customers_id`, `customers_gender`, `customers_firstname`, `customers_lastname`, `customers_dob`, `customers_email_address`, `customers_default_address_id`, `customers_telephone`, `customers_fax`, `customers_password`, `customers_newsletter`) VALUES


INSERT INTO `address_book` (`address_book_id`, `customers_id`, `entry_gender`, `entry_company`, `entry_firstname`, `entry_lastname`, `entry_street_address`, `entry_suburb`, `entry_postcode`, `entry_city`, `entry_state`, `entry_country_id`, `entry_zone_id`) VALUES

I'm betting that your issue was with a database change to First and Last Name.

Good luck.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply