Magento2 移除不需要的模組
Magento2 安裝時資料過於龐大這是眾所皆知的事情了,但是如何關閉或是刪掉不需要使用的內建模組,讓 Magento 系統更輕巧呢?請參考以下兩個方法:
1.關閉模組
Magento 2 內建就有此功能,直接於後台操作即可,對於非工程師的人員來說,這是再方便不過的事情了
* 後台操作路徑: Stores -> Configuration -> Advanced -> Advanced
* 或是使用指令:
bin/magento module:disable Magento_Marketplace
2.使用 Composer 方式
* 自從 Magento 2 開始,都是使用現代化 PHP 管理套件的工具 `Composer`( 什麼!你還不知道 `Composer` ? ) 來做為套件管理,想要刪除內建模組,從 `Composer` 下手才是最根本的方式,能夠徹徹底底的把模組程式碼完全移除(如果你想要的話,連資料表都可以刪掉)。做法很簡單,我們只需要在 composer.json 新增一個replace 欄位,格式如下:
"require": { [...] }, "replace": { "magento/module-marketplace": "*" }, "config": { [...]
輸入完後,執行指令 `composer update`,等待指令執行完後,就刪除了指定的模組。
- 刪除建議
Magento 2 內有許許多多不常用到的模組,以下是部份的刪除建議。當然你也可以隨著你的需求做些許的調整。
Magento 2.2.3:
"require": { [...] }, "replace": { "magento/module-admin-notification": "*", "magento/module-dhl": "*", "magento/module-fedex": "*", "magento/module-marketplace": "*", "magento/module-multishipping": "*", "magento/module-captcha": "*", "magento/module-persistent": "*", "magento/module-catalog-rule-configurable": "*", "magento/module-authorizenet": "*", "magento/module-google-adwords": "*", "magento/module-sample-data": "*", "magento/module-send-friend": "*", "magento/module-swagger": "*", "magento/module-swatches": "*", "magento/module-swatches-layered-navigation": "*", "magento/module-tax-import-export": "*", "magento/module-google-optimizer": "*", "magento/module-ups": "*", "magento/module-encryption-key": "*", "magento/module-usps": "*", "magento/module-braintree": "*", "magento/module-webapi-security": "*", "magento/module-weee": "*", "magento/module-signifyd": "*", "temando/module-shipping-m2": "*", "shopialfb/facebook-module": "*" }, "config": { [...]
Magento 2.2.5:
"require": { [...] }, "replace": { "magento/module-admin-notification": "*", "magento/module-dhl": "*", "magento/module-fedex": "*", "magento/module-marketplace": "*", "magento/module-multishipping": "*", "magento/module-captcha": "*", "magento/module-persistent": "*", "magento/module-catalog-rule-configurable": "*", "magento/module-authorizenet": "*", "magento/module-google-adwords": "*", "magento/module-sample-data": "*", "magento/module-send-friend": "*", "magento/module-swagger": "*", "magento/module-swatches": "*", "magento/module-swatches-layered-navigation": "*", "magento/module-tax-import-export": "*", "magento/module-google-optimizer": "*", "magento/module-ups": "*", "magento/module-encryption-key": "*", "magento/module-usps": "*", "magento/module-braintree": "*", "magento/module-webapi-security": "*", "magento/module-weee": "*", "magento/module-signifyd": "*", "magento/module-analytics": "*", "magento/module-catalog-analytics": "*", "magento/module-customer-analytics": "*", "magento/module-quote-analytics": "*", "magento/module-review-analytics": "*", "magento/module-sales-analytics": "*", "magento/module-wishlist-analytics": "*", "temando/module-shipping-m2": "*", "dotmailer/dotmailer-magento2-extension": "*", "shopialfb/facebook-module": "*", "klarna/module-kp": "*", "klarna/module-ordermanagement": "*", "klarna/module-core": "*", "amzn/amazon-pay-and-login-magento-2-module": "*", "vertex/module-tax": "*" }, "config": { [...]
如果有您有更多疑問可以詢問我們,未來會撰寫更多電商網站相關文章,您想知道什麼嗎?歡迎在下方留言給我們。或追蹤我們的粉絲專頁,就不錯過最新文章喔!
想學習更多Magento設定嗎?請見:Magento教學導覽
我要留言