galacticlabs/disable-compare-products
Composer 安装命令:
composer require galacticlabs/disable-compare-products
包简介
Disable compare products functionality
README 文档
README
This simple module adds a new config value to the Catalog Recently Viewed/Compared Products admin section, allowing you to remove the compare products functionality.
It will remove product compare from:
- Category view sidebar
- Category view product list
- Product view
- Search results product list
- My account sidebar
Installation
Require the module
composer require galacticlabs/disable-compare-products
Enable the module
php bin/magento module:enable GalacticLabs_DisableCompareProducts
Run setup to install module and set up table(s)
php bin/magento setup:upgrade
Usage
Once installed, you can choose to disable the compare products functionality at Stores > Settings > Configuration > Catalog > Catalog > Recently Viewed/Compared Products then choosing yes or no from the new config option Disable Compare Products.
Note: By default this option is set to no. Set it to yes and clear any caches to see the results.
How it works
Removing layout items is not trivial when doing so based on a config value. Therefore I have had to add an observer that adds a new layout handle gl_remove_compare_products to the page when the module config value is set to yes.
This will have a small performance impact, so if performance is everything then use the traditional route of adding these handles manually to your theme.
You can see the layout changes made in the view/frontend/layout/gl_remove_compare_products.xml file.
Can you also disable the wishlist?
This is a native Magento 2 feature. Just go to Stores > Settings > Configuration > Customers > Wishlist > General Options and change enabled to no.
Bugs/Feature Requests & Contribution
Please do open a pull request on GitHub should you want to contribute, or create an issue.
License
MIT - Do as you wish 👍
galacticlabs/disable-compare-products 适用场景与选型建议
galacticlabs/disable-compare-products 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 66.06k 次下载、GitHub Stars 达 16, 最近一次更新时间为 2017 年 12 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 galacticlabs/disable-compare-products 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 galacticlabs/disable-compare-products 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 66.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-12-14
