Magento 2.3.4 安裝流程

You are here:
< All Topics

因有內銷、外銷兩個網站,所以有區別的部分會在標題後方特別標注出來

Reindex

bin/magento indexer:reindex

設定 Crontab

https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-cron.html#create-or-remove-the-magento-crontab

bin/magento cron:install

設定國家選項 Country Options

商店 (Stores) > 配置 (Configuration) > 一般 (General) > 一般 (General) > Default Country > Taiwan
商店 (Stores) > 配置 (Configuration) > 一般 (General) > 一般 (General) > Allow Countries > China, Hong Kong, Japan, Taiwan
商店 (Stores) > 配置 (Configuration) > 一般 (General) > 一般 (General) > Top destinations > Taiwan
保存設定 (Save Config)

設定地區、語系選項 Locale Options(內銷用)

商店 (Stores) > 配置 (Configuration) > 一般 (General) > 一般 (General) > 地區選項 (Locale Options) > 語系選擇 中文 台灣 (Locale Choose Chinese - Taiwan)
商店 (Stores) > 配置 (Configuration) > 一般 (General) > 一般 (General) > 地區選項 (Locale Options) > Weight Unit > kgs
商店 (Stores) > 配置 (Configuration) > 一般 (General) > 一般 (General) > 地區選項 (Locale Options) > First Day of Week > Monday
商店 (Stores) > 配置 (Configuration) > 一般 (General) > 一般 (General) > 地區選項 (Locale Options) > Weekend Days > Sunday Saturday 
保存設定 (Save Config)

設定商店資訊 Store Information

商店 (Stores) > 配置 (Configuration) > 一般 (General) > 一般 (General) > 商店資訊 (Store Information)
輸入下面參數
Store Name
Store Phone Number
Country
ZIP
City
Street Address
VAT Number
保存設定 (Save Config)

安裝中文語系(內銷用)

composer require astralweb/zh_hant_tw
bin/magento setup:upgrade
bin/magento setup:static-content:deploy zh_Hant_TW -f (確定在 default mode 下不需要執行)
chown -R nginx: ./

安裝玉山刷卡模組(內銷用,不確定外銷會不會用到)

/bin/cp -rf /home/cewolf/M2_files/app ./
bin/magento setup:upgrade
chown -R nginx: ./

設定付款方式 Payment Methods

商店 (Stores) > 配置 (Configuration) > 銷售 (Sales) > 付款方式 (Payment Methods)

設定運送方式 Shipping Methods(未完成

商店 (Stores) > 配置 (Configuration) > 銷售 (Sales) > 運送方式 (Shipping Methods)

設定運送方式 Shipping Methods

商店 (Stores) > 配置 (Configuration) > 銷售 (Sales) > 運送方式 (Shipping Methods)

設定搜尋最低字元長度(很重要

商店 (Stores) > 配置 (Configuration) > 目錄 (Catalog) > 目錄 (Catalog) > (Catalog Search) > (Minimal Query Length) > 由 3 改為 1 > 保存設定 (Save Config)

啟用統一編號(內銷用,不確定外銷會不會用到)

商店 (Stores) > 配置 (Configuration) > 客戶 (Customers) > 客戶配置 (Customer Configuration) > (Create New Account Options) > (Show VAT Number on Storefront) > (Yes)
保存設定 (Save Config)

修改客戶地址格式(顯示台灣地址格式)

Address Book

/Users/cewolf/Documents/GitHub/Magento-CE-2.3.4/vendor/magento/module-customer/view/frontend/templates/address/edit.phtml

結帳頁面顯示地址格式

/Users/cewolf/Documents/GitHub/Magento-CE-2.3.4/vendor/magento/module-checkout/view/frontend/web/template/billing-address/details.html

/Users/cewolf/Documents/GitHub/Magento-CE-2.3.4/vendor/magento/module-checkout/view/frontend/web/template/shipping-address/address-renderer/default.html

結帳頁面新增地址重新排序(建議從資料庫修改
UPDATE `customer_eav_attribute` SET `sort_order` = '20' WHERE `customer_eav_attribute`.`attribute_id` = 25;
UPDATE `customer_eav_attribute` SET `sort_order` = '40' WHERE `customer_eav_attribute`.`attribute_id` = 23;
UPDATE `customer_eav_attribute` SET `sort_order` = '50' WHERE `customer_eav_attribute`.`attribute_id` = 34;
UPDATE `customer_eav_attribute` SET `sort_order` = '120' WHERE `customer_eav_attribute`.`attribute_id` = 33;
UPDATE `customer_eav_attribute` SET `sort_order` = '122' WHERE `customer_eav_attribute`.`attribute_id` = 32;
UPDATE `customer_eav_attribute` SET `sort_order` = '125' WHERE `customer_eav_attribute`.`attribute_id` = 29;
UPDATE `customer_eav_attribute` SET `sort_order` = '130' WHERE `customer_eav_attribute`.`attribute_id` = 28;
UPDATE `customer_eav_attribute` SET `sort_order` = '140' WHERE `customer_eav_attribute`.`attribute_id` = 27;
UPDATE `customer_eav_attribute` SET `sort_order` = '150' WHERE `customer_eav_attribute`.`attribute_id` = 36;

 

 

/Users/cewolf/Documents/GitHub/Magento-CE-2.3.4/vendor/magento/module-customer/view/frontend/templates/address/edit.phtml

/Users/cewolf/Documents/GitHub/Magento-CE-2.3.4/vendor/magento/module-customer/view/frontend/templates/address/grid.phtml

 

vendor/magento/module-multishipping/view/frontend/templates/checkout/billing.phtml

vendor/magento/module-multishipping/view/frontend/templates/checkout/shipping.phtml

vendor/magento/module-customer/view/frontend/templates/address/book.phtml

安裝 Plumrocket Twitter and Facebook login 模組

composer config repositories.plumrocket composer https://store.plumrocket.com/repo/
composer require plumrocket/module-shippingtracking
#   Authentication required (store.plumrocket.com)
#   Username: mez2UlxQ2JahenlvH3bOpqgA4tGANHlL
#   Password: ApI5Q265IVaGDigfK8aDNpN8lnp13TKm

php bin/magento setup:upgrade
chown -R nginx: ./
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

內銷我們有將姓、名兩個欄位對調,詳細介紹請參照:Plumrocket Twitter and Facebook login 姓名順序對調

修改 vendor/plumrocket/module-psloginfree/Model/Facebook.php

vim /usr/share/nginx/html/vendor/plumrocket/module-psloginfree/Model/Facebook.php

@Line 31-32 將

'firstname' => 'first_name',
'lastname' => 'last_name',

修改為

'firstname' => 'last_name',
'lastname' => 'first_name',

安裝 Amasty Pre-Order 模組

 

安裝 MOB 模組

/bin/cp -rf /home/cewolf/M2_files/src/app ./
bin/magento setup:upgrade
chown -R nginx: ./

MOB 檔案修正(內銷專用)

修正了訂單同步的欄位與格式、還有電話號碼格式化

/Users/cewolf/Documents/GitHub/Odoo-Bridge-Magento2.3/app/code/Webkul/Odoomagentoconnect/Model/ResourceModel/Order.php

 

MOB 設定

請直接參照教學:

MOB 屬性同步

請直接參照教學:

MOB 分類同步

請直接參照教學:MOB(Magento Odoo Bridge)教學:同步分類 From Odoo

MOB 產品同步

請直接參照教學:MOB(Magento Odoo Bridge)教學:匯出單一產品 From Odoo

安裝佈景

# 安裝主程式
unzip Porto\ Theme.zip
/bin/cp -rf app pub /usr/share/nginx/hanyu_234 && rm -rf app pub

# 安裝 Magento 2.2.x 以上用修正檔
unzip Patch\ for\ Magento\ 2.2.x\ And\ Above.zip
/bin/cp -rf app /usr/share/nginx/hanyu_234 && rm -rf app

# 安裝 Magento 2.2.4 以上用修正檔
unzip Patch\ for\ Magento\ 2.2.4\ And\ Above.zip
/bin/cp -rf app /usr/share/nginx/hanyu_234 && rm -rf app

# 安裝 Magento 2.3.x 修正檔
unzip Patch\ for\ Magento\ 2.3.x.zip
/bin/cp -rf app /usr/share/nginx/hanyu_234 && rm -rf app

# 安裝 Magento 2.3.1 以上用修正檔
unzip Patch\ for\ Magento\ 2.3.1\ And\ Above.zip
/bin/cp -rf app /usr/share/nginx/hanyu_234 && rm -rf app

# 安裝 Magento 2.3.3 修正檔
unzip Patch\ for\ Magento\ 2.3.3.zip
/bin/cp -rf app /usr/share/nginx/hanyu_234 && rm -rf app

# 安裝 Magento 2.x.x 產品內容修正檔
unzip Patch\ for\ Product\ Detail\ Magento\ 2.x.x.zip
/bin/cp -rf app /usr/share/nginx/hanyu_234 && rm -rf app

# 移除 Mageplaza Core 模組(Porto 內的版本為舊版,會造成檔案衝突)
rm -rf /usr/share/nginx/hanyu_234/app/code/Mageplaza/Core

# 修正檔案權限與安裝
cd /usr/share/nginx/hanyu_234
php bin/magento setup:upgrade
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush
chown -R nginx: ./

關閉 Magento Business Intelligence service

每次進入後台管理介面,總會跳出警告訊息

Failed to synchronize data to the Magento Business Intelligence service. Retry Synchronization

於 system.log 中也充滿著相關的訊息,由於 Magento Business Intelligence Service 是付費服務,所以我們直接關閉它

商店 (Stores) > 配置 (Configuration) > 一般 (General) > Advanced Reporting > Advanced Reporting Service > 停用

保存設定 (Save Configuration)

修改 Message Queues 設定

main.INFO: Consumer “async.operations.all” skipped as required connection “amqp” is not configured. Unknown connection name amqp [] []

於 system.log 中也充滿著相關的訊息,查了相關資料是說 Message Queues 是透過 AMQP Server 處理

官方文件中有提到可以修改 env.php 改為透過 Database 來處理,就不會有這個錯誤訊息了

vim app/etc/env.php

在最後面加上這段

    'cron_consumers_runner' => array(
        'cron_run' => false,
        'max_messages' => 20000,
        'consumers' => array(
            'consumer1',
            'consumer2',
        )
    ),

重新清除快取即可

php bin/magento cache:clean
php bin/magento cache:flush
chown -R nginx: ./

啟用佈景

商店 (Stores) > 配置 (Configuration) > Porto > 一般 (General) > Activate Theme

保存設定 (Save Configuration)

 

Previous Google Analytics 移除 Referrer Spam 並用 Segments(區隔)從歷史紀錄中排除
Next Magento 備份、複製到測試環境的流程
Table of Contents