Jump to content

วิธีแก้หน้า Admin - Orders รายชื่อย่อลูกค้า ให้แสดงชื่อเต็ม


aifarfa

Recommended Posts

ปกติในรายการสั่งซื้อ backoffice orders

รายชื่อของลูกค้าที่สั่งซื้อจะแสดงเป็นชื่อย่อ แบบนี้

S. MAURY
S. DUMRUS
ก. วิริย...
ว. กำล

(เวอร์ชั่นเก่า อาจจะปะหลาดกว่านี้อีก เพราะมันเอานามสกุลขึ้นต้นก่อน)
สร้างความรำคาณใจให้ user เป็นอย่างมาก แล้วก็มาวีนใส่คนทำเว็บว่า แกจะไปย่อชื่อลูกค้าทำไมฟระ

วิธีแก้ ไปที่ไฟล์ /tabs/AdminOrders.php
search หาโค้ดบรรทัดนี้.. (line 28 function __construct)

$this->_select = '
           a.id_order AS id_pdf,
           CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`,



replace แทนที่ด้วยโค้ดนี้

$this->_select = '
           a.id_order AS id_pdf,
           CONCAT(c.`firstname`, \' \', c.`lastname`) AS `customer`,



เท่านี้ก็จะเห็น ชื่อ-นามสกุล ลูกค้าแบบเต็มๆแร้ว

15502_rjZXmWBh1gWhYOyTFqbw_t

Link to comment
Share on other sites

ขอบคุณมากเลยครับ

ผมลอง แล้ว มันขึ้น "Query ไม่ถูกต้อง" ผมเลยลองใหม่
เดิม

$this->_select = 'a.id_order AS id_pdf, CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`,



replace เป็น

$this->_select = 'a.id_order AS id_pdf, CONCAT(LEFT(c.`firstname`, 20), \'  \', c.`lastname`) AS `customer`



firstname เป็น 20 ตัวอักษร ส่วน จุด "." เอาเป็น เว้นวรรค
ผมใช้ Version 1.1.0.5

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 1 month later...

$this->_select = '
a.id_order AS id_pdf,
CONCAT(LEFT(c.`firstname`, 1), \'. \, c.`lastname`) AS `customer`,

แก้จากเลข 1 เป็นเลขสัก 20 ชื่อก็โชว์หมดแล้วครับ

Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...