mage2kishan/module-disable-wishlist-compare
Composer 安装命令:
composer require mage2kishan/module-disable-wishlist-compare
包简介
Disable Wishlist and Compare functionality across the entire Magento 2 frontend (works on Hyva and Luma).
README 文档
README
Magento 2 Disable Wishlist and Compare Extension (Hyva + Luma)
A single module that removes Wishlist and Compare from every surface of your Magento 2 store. It covers header icons, product detail buttons, category list buttons, cart row actions, customer account tabs, sidebar blocks, widget links, and direct URL routes. Works on both Hyva and Luma with no theme edits needed.
Product page: kishansavaliya.com/magento-2-disable-wishlist-compare.html
Quick Answer
What is Panth Disable Wishlist and Compare? It is a Magento 2 extension that gives you a clean admin toggle to remove Wishlist and Compare from every part of the frontend, including all buttons, links, sidebars, and direct URL routes.
What does it add to my store?
- A master on/off switch in the admin configuration panel.
- Individual toggles for Wishlist and Compare so you can disable one or both.
- Route blocking that returns a 404 for
/wishlist/*and/catalog/product_compare/*instead of redirecting to a login page. - Six separate removal mechanisms covering layout XML, helper plugins, ViewModel plugins, block plugins, and controller plugins so nothing is left behind.
Which themes are supported? Both Hyva (Alpine.js) and Luma. The right plugins activate automatically based on which theme is in use.
What does it need? Magento 2.4.4 to 2.4.8, PHP 8.1 to 8.4, and the free mage2kishan/module-core package.
Need Custom Magento 2 Development?
Get a free quote for your project in 24 hours for custom modules, Hyva themes, performance work, M1 to M2 migrations, and Adobe Commerce Cloud.
Visit our website: kishansavaliya.com | Get a quote: kishansavaliya.com/get-quote
Table of Contents
- Who Is It For
- Key Features
- Compatibility
- Installation
- Configuration
- How It Works
- Preview
- FAQ
- Support
- About Panth Infotech
- Quick Links
Who Is It For
- Single-SKU brands that sell one product or a tight range and have no use for wish lists or comparisons.
- B2B and wholesale stores where buyers purchase on spec sheets, not saved lists.
- Industrial and trade suppliers whose customers never use Magento's default wishlist or compare features.
- Merchants cleaning up the frontend who want to remove unused UI without touching theme files.
- Hyva storefronts that need the compare icon, wishlist icon, and all related ViewModel calls switched off without custom Alpine.js overrides.
Key Features
Admin Toggles for Everything
- Master module switch turns the entire module on or off without uninstalling it.
- Separate Wishlist and Compare toggles so you can disable one without touching the other.
- Block Direct URL Access toggle forces a 404 on
/wishlist/*and/catalog/product_compare/*instead of a 302 redirect to the login page. - All settings are available at default, website, and store view scope.
Complete Wishlist Removal
- Header wishlist icon removed on both Hyva and Luma via layout XML.
- Wishlist sidebar block removed on Luma.
- Product detail "Add to Wish List" removed including related and upsell sections.
- Category list add-to-wishlist buttons removed via layout and JS helper override.
- Cart row "Move to Wishlist" removed for all product types.
- Customer account side-nav tab removed.
- Luma widget links cleared by a block plugin on
AbstractProduct::getAddToWishlistUrl(). - Magento Wishlist helper plugged to return false from
isAllow()andisAllowInCart(). - Hyva WishlistViewModel plugged to return false from
isEnabled()andisAllowInCart(). /wishlist/*direct URL routes return 404 before the auth redirect fires.
Complete Compare Removal
- Hyva header compare icon removed via layout and
show_compare=falseargument. - Core compare header link and sidebar removed on Luma.
- Product detail "Add to Compare" removed including related and upsell sections.
- Category list add-to-compare buttons removed via layout and JS helper override.
- Luma widget links cleared by a block plugin on
AbstractProduct::getAddToCompareUrl(). - Hyva ProductCompare ViewModel plugged to return false from
showCompareSidebar(),showInProductList(), andshowOnProductPage(). /catalog/product_compare/*routes return 404 via a controller plugin.
Hyva and Luma Ready
- Six separate removal mechanisms so every rendering path is covered regardless of how a theme emits wishlist or compare markup.
- Hyva-specific plugins are harmless on Luma-only stores because Magento's plugin runtime skips them if the target class is never instantiated.
- No theme file overrides needed on either theme.
Built to Last
- Clean constructor DI only, no ObjectManager.
- MEQP-style code with full compliance with Magento coding standards.
- Translation ready with every label using
__().
Compatibility
| Requirement | Versions Supported |
|---|---|
| Magento Open Source | 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8 |
| Adobe Commerce | 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8 |
| Adobe Commerce Cloud | 2.4.4 to 2.4.8 |
| PHP | 8.1.x, 8.2.x, 8.3.x, 8.4.x |
| Hyva Theme | 1.0+ (fully compatible) |
| Luma Theme | Native support |
| Required Dependency | mage2kishan/module-core (free) |
Installation
Composer Installation (Recommended)
composer require mage2kishan/module-disable-wishlist-compare bin/magento module:enable Panth_Core Panth_DisableWishlistCompare bin/magento setup:upgrade bin/magento setup:di:compile bin/magento setup:static-content:deploy -f bin/magento cache:flush
Manual Installation via ZIP
- Download the latest release from Packagist or from the product page.
- Extract it to
app/code/Panth/DisableWishlistCompare/in your Magento install. - Make sure
Panth_Coreis installed too (required dependency). - Run the commands above starting from
bin/magento module:enable.
Verify Installation
bin/magento module:status Panth_DisableWishlistCompare
# Expected: Module is enabled
After install, open:
Admin -> Stores -> Configuration -> Panth Extensions -> Disable Wishlist & Compare
Configuration
Go to Stores -> Configuration -> Panth Extensions -> Disable Wishlist & Compare.
| Setting | Group | Default | Description |
|---|---|---|---|
| Module Enabled | General | Yes | Master switch. If No, all runtime plugins are disabled and stock Wishlist/Compare behave normally. |
| Disable Wishlist | General | Yes | Hides every wishlist link, icon, button, and sidebar on the frontend. |
| Disable Compare | General | Yes | Hides every compare link, icon, button, and sidebar on the frontend. |
| Block Direct URL Access | General | Yes | Returns 404 when anyone hits /wishlist/* or /catalog/product_compare/* directly. |
Note on layout removals: Layout XML removals apply whenever the module is enabled at the CLI level. The admin toggles above control only the runtime plugins and route blocking. To restore the UI while keeping the module installed, disable the module via CLI.
How It Works
The module uses six complementary mechanisms so every rendering path is covered.
- Layout XML removes on
default,catalog_product_view,catalog_category_view,catalog_list_item,catalogsearch_result_index,catalogsearch_advanced_result, andcheckout_cart_index. Every named wishlist and compare block that Magento core and Hyva declare is removed here. - Header argument override - Hyva's
header.phtmlgates the compare and wishlist icons onshow_compareandshow_wishlistarguments of theheader-contentblock. Both are forced tofalse. - Helper plugin on
Magento\Wishlist\Helper\Data::isAllow()andisAllowInCart()forces false so any third-party block that checks the helper drops out silently. - Block plugin on
Magento\Catalog\Block\Product\AbstractProduct::getAddToCompareUrl()andgetAddToWishlistUrl()returns an empty string, which breaks the conditional gates in every Luma widget template without any template overrides. - Hyva ViewModel plugins on
Hyva\Theme\ViewModel\WishlistandHyva\Theme\ViewModel\ProductCompareforce all display methods to false. - Route blocking - a predispatch observer for
controller_action_predispatch_wishlistruns before the customer session auth redirect, so/wishlist/*returns a 404. A controller plugin onMagento\Catalog\Controller\Product\Compare::executeblocks compare routes. AJAX and POST requests return a JSON stub so stale JS listeners fail quietly.
Restoring the UI
Option A - keep the module, restore UI:
bin/magento module:disable Panth_DisableWishlistCompare bin/magento cache:flush
Option B - uninstall entirely:
bin/magento module:disable Panth_DisableWishlistCompare composer remove mage2kishan/module-disable-wishlist-compare bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:flush
Preview
Admin Configuration
Stores -> Configuration -> Panth Extensions -> Disable Wishlist & Compare - four toggles, all defaulting to Yes, applied immediately after cache flush.
FAQ
Does this work on Hyva themes?
Yes. The module ships dedicated Hyva ViewModel plugins for both Hyva\Theme\ViewModel\Wishlist and Hyva\Theme\ViewModel\ProductCompare, plus the header argument override that removes the icons from the Hyva header. It requires no Alpine.js changes or template overrides.
Does it work on Luma too?
Yes. Layout XML removals, block plugins, and helper plugins cover every Luma surface including sidebars, widget templates, and cart row actions. The module detects which plugins are needed at runtime.
What if I only want to disable Wishlist but keep Compare active?
Turn on "Disable Wishlist" and leave "Disable Compare" set to No in the admin. Each feature is controlled by its own toggle.
Will /wishlist/ redirect to login instead of showing a 404?
No. The predispatch observer fires before the customer session auth check, so the route returns a proper 404 rather than a 302 redirect to the login page. Set "Block Direct URL Access" to No if you want the routes accessible without the frontend UI.
Does a third-party module that adds its own wishlist button still show?
The module plugs every Magento core integration point. If a third-party module renders its own button via a custom block that bypasses those points, add a <referenceBlock name="..." remove="true"/> in a child theme layout override or open a GitHub issue.
Does the layout XML apply even when the admin toggle is No?
Layout XML removals are module-level and apply whenever the module is enabled at the CLI. The admin toggles control only the runtime plugins and route blocking. To fully restore the UI, disable the module via bin/magento module:disable.
Does it create any database tables?
No. The module has no database schema. All behavior is handled through plugins, observers, and layout XML.
Can I use it on a multi-store setup?
Yes. All admin settings are available at default, website, and store view scope, so you can disable wishlist on one store view and leave it active on another.
Does it need Panth Core?
Yes. mage2kishan/module-core is a free required dependency that Composer installs automatically. It provides the shared admin tab and menu parent.
Support
| Channel | Contact |
|---|---|
| Product Page | kishansavaliya.com/magento-2-disable-wishlist-compare.html |
| kishansavaliyakb@gmail.com | |
| Website | kishansavaliya.com |
| +91 84012 70422 | |
| GitHub Issues | github.com/mage2sk/module-disable-wishlist-compare/issues |
| Upwork (Top Rated Plus) | Hire Kishan Savaliya |
| Upwork Agency | Panth Infotech |
Response time: 1-2 business days.
Need Custom Magento Development?
Looking for custom Magento module development, Hyva theme work, store migrations, or performance tuning? Get a free quote in 24 hours:
About Panth Infotech
Built and maintained by Kishan Savaliya (kishansavaliya.com), a Top Rated Plus Magento developer on Upwork with 10+ years of eCommerce experience.
Panth Infotech is a Magento 2 development agency that builds high quality, security focused extensions and themes for both Hyva and Luma storefronts. The extension suite covers SEO, performance, checkout, product presentation, customer engagement, and store management, with each module built to MEQP standards and tested across Magento 2.4.4 to 2.4.8.
Browse the full extension catalog on our Magento extensions page or on Packagist.
Quick Links
| Resource | Link |
|---|---|
| Product Page | magento-2-disable-wishlist-compare.html |
| Packagist | mage2kishan/module-disable-wishlist-compare |
| GitHub | mage2sk/module-disable-wishlist-compare |
| Website | kishansavaliya.com |
| Free Quote | kishansavaliya.com/get-quote |
| Upwork (Top Rated Plus) | Hire Kishan Savaliya |
| Upwork Agency | Panth Infotech |
| kishansavaliyakb@gmail.com | |
| +91 84012 70422 |
Want to remove Wishlist and Compare from your store?
SEO Keywords: magento 2 disable wishlist, magento 2 disable compare, magento 2 remove wishlist button, magento 2 hide wishlist, magento 2 hide compare, magento 2 disable wishlist extension, magento 2 disable compare module, magento 2 remove compare products, hyva disable wishlist, hyva disable compare, luma disable wishlist, luma disable compare, magento 2 wishlist toggle, magento 2 compare toggle, magento 2 disable wishlist compare module, magento 2 remove wishlist link, magento 2 block wishlist url, magento 2 404 wishlist, magento 2 frontend cleanup, magento 2.4.8 disable wishlist, php 8.4 disable wishlist, mage2kishan disable wishlist compare, panth disable wishlist, panth infotech, hire magento developer, top rated plus upwork, kishan savaliya magento, custom magento development
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2026-04-20
