Coder Social home page Coder Social logo

disable-compare-products's Introduction

Galactic Labs - Disable Compare Products

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.

Catalog Options Screenshot

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 ๐Ÿ‘

disable-compare-products's People

Contributors

alanablett avatar flancer64 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.