Page 1 of 1
Missing customer name
Posted: Mon Aug 30, 2021 1:20 pm
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
Re: Missing customer name
Posted: Sat Sep 04, 2021 12:27 pm
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'
Re: Missing customer name
Posted: Sat Sep 04, 2021 4:29 pm
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.
Re: Missing customer name
Posted: Sat Sep 04, 2021 10:36 pm
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.