承接 eboosttech/magento2-disable-compare-products 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

eboosttech/magento2-disable-compare-products

最新稳定版本:1.0.0

Composer 安装命令:

composer require eboosttech/magento2-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 eboosttech/magento2-disable-compare-products

Enable the module

php bin/magento module:enable EBoost_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.

Catalog Options Screenshot

OR run command to disable compare products

php bin/magento config:set catalog/recently_products/disable_compare 1

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

BSD-4-Clause - Do as you wish 👍

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-4-Clause
  • 更新时间: 2024-03-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固