วิธีทำร้านค้าร้านหลาย (How yo Make Multi language In Magento)
1. ทำการ Login ไปที่หลังร้าน (BackEnd) แล้วไปที่ System -> Manager Stores
- 2015-07-08_12-30-16.jpg (96.69 KiB) Viewed 4676 times
2. คลิกที่ Create Stores View
- 2015-07-08_12-31-51.jpg (41.67 KiB) Viewed 4664 times
3. ทำการสร้าง Stores View ขึ้นมา
- 2015-07-08_12-32-58.jpg (34.79 KiB) Viewed 4676 times
3.1 ให้เลือกเป็น Main Website Store หลักของเรา
3.2 ตั้งชื่อ ให้กับ Store นี้
3.3 คำย่อของ Store นี้
3.4 สถานะ เลือกเป็น enabled
3.5 เป็นการเรียงลำดับของ Store views จะใส่หรือไม่ใส่ก็ได้
ตั้งค่าเสร็จกด Save Store views จะได้ตามภาพเพิ่มขึ้นมา
- 2015-07-08_12-36-59.jpg (47.01 KiB) Viewed 4664 times
4. จากนั้นไปที่ System > Configuration
- 2015-07-08_12-38-04.jpg (86.09 KiB) Viewed 4664 times
5. ทำตามขึ้นตอน
5.1 ดูตรง Current Configuration Scope :
5.2 คลิกเลือก เป็น Store Views ที่เราสร้าง
5.3 เมื่อคลิกเลือก Store views แล้วให้คลิกที่ General
5.4 ดูตรง เมนู Locale Options แล้ว ติ้กถูกตรง Use Website ออก จะทำให้เราสามารถแก้ไขในช่องนั้นได้
5.5 ตรง Local เลือกเป็น ประเทศที่เราต้องการ ตาม Store Views
5.6 กด Save Config
6. ไปที่ Folder Magento ของเรา เข้าไปที่ magento\app\design\frontend\base\default\template\page\switch
แล้วเปิดไฟล์ languages.phtml ตรงบรรทัด 40 ให้แก้ตรงกรอบสีแดง
เป็น
โค้ด: เลือกทั้งหมด
<option value="<?php echo $_lang->getCurrentUrl(FALSE) ?>
จากนั้น Save
7. กลับมาที่ System -> Configuration
- 2015-07-08_12-49-57.jpg (77.84 KiB) Viewed 4664 times
7.1 ดูตรง Current Configuration Scope:
7.2 เลือก ให้เป็น Default config
7.3 คลิกที Menu Web
7.4 ตรง url Options
7.5 ให้เปลียนให้เป็น Yes
7.6 กด Save Config
8. ทำการ Clear Cache และ Reindex data
9. เข้าไปหน้าเว็บไซต์ของเรา จะเห็นได้ว่า มี Options ให้เลือก ภาษา Default Store Views กับ Thai ทีเราสร้างไว้ เมื่อเราเลือก Thai หน้าเว็บก็จะกลายเป็น ภาษาไทย
- 2015-07-08_12-55-01.jpg (68.49 KiB) Viewed 4664 times
***** ถ้าอยากเปลียนคำว่า Default Store View เป็น คำอื่น ก็ให้คลิกแก้ไข Default Store View ตามรูปที่ 3 ให้เป็นชื่ออื่น เช่น ENG จากนั้นตรงแทป Store Name : Main Website Store ให้คลิกเข้าไปแก้ไข แล้วใน ช่อง Default Store View ให้แก้เป็น Store Views ที่เราต้องการให้เป็นหลัก ของ Website เรา *****