71
votes
Accepted
Magento 2: Safe and easiest way to disable Compare products & Wishlist Module
In Magento 2, you can actually now remove Compare products functionality via xml file.
Compare products block is defined in vendor/magento/module-catalog/view/frontend/layout/default.xml
and you can ...
44
votes
Magento 2: Safe and easiest way to disable Compare products & Wishlist Module
I grepped the source for all compare blocks. For 2.3 this is the complete list. This will also remove the compare link from the header.
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...
40
votes
Magento 2: Safe and easiest way to disable Compare products & Wishlist Module
You can add following xml instruction to either your custom theme's default xml file which should be located at /app/design/frontend/Vendor/theme/Magento_Theme/layout/default.xml or to Magento_Catalog/...
18
votes
Accepted
How render product wishlist link functionality in custom template (phtml) in magento 2
You can try something like the following code:
<a href="#" data-post='<?php echo $this->helper('Magento\Wishlist\Helper\Data')->getAddParams($_product) ?>' class="action towishlist" ...
14
votes
Accepted
How to add programmatically product to wishlist in Magento 2?
To do so, you will first have to inject the following in your constructor:
Magento\Wishlist\Model\WishlistFactory
Magento\Catalog\Api\ProductRepositoryInterface
So update your class constructor like ...
13
votes
Magento 2: Safe and easiest way to disable Compare products & Wishlist Module
Wishlist can be disabled from
store > Configurations > Customers > Wish List> General options>
Enabled: No.
11
votes
Accepted
Remove product from wishlist using customer id and product id in Magento2?
Unfortunately Magento didn't provide ready to use function to delete item from wishlist. But you can use follow code to do this, I tested it and all works fine at my local Magento.
protected $...
10
votes
Magento 2 - How to disable wishlist and product review module
For Magento_Wishlist, we can also disable the feature in the admin (Store > Config > Customer > Wish List > General Options, config path is wishlist/general/active).
Regarding Magento_Review, the ...
9
votes
Accepted
setup:upgrade SQL error after update from 2.2.8 to 2.3.1
Apparently it is a Magento bug. When comparing current schema to declared schema, constraints and other indexes are handled separately, but the existing index is not dropped before the new UNIQUE ...
8
votes
Magento 2: Safe and easiest way to disable Compare products & Wishlist Module
Disable Wishlist on Stores > Configuration > Customers > Wishlist and to disable the Compare function paste this lines below on Magento_Catalog/layout/default.xml of your theme.
<?xml version="1.0"...
8
votes
Accepted
Magento 2 - Keep Wishlist items
In app/code/Magento/Wishlist/Controller/Index/Cart.php in the execute() method the following code is what adds the item to the cart and removes it from the wishlist:
$item->addToCart($this->cart,...
8
votes
Accepted
create mini wish list icon like mini cart
You can either create a module or customize the code in the theme, I have used custom module as follows,
app/code/VendorName/ModuleName/registration.php
<?php
\Magento\Framework\Component\...
7
votes
Magento 2: Safe and easiest way to disable Compare products & Wishlist Module
Magento provide command line utility for it example
php bin/magento module:disable -f Magento_Wishlist
as Magento wishlist depend upon the other module as well so using without [-f] will not ...
7
votes
Magento 2 - How to disable wishlist and product review module
As highlighted in a previous comment, disabling the module is not a good method as others may depend on it, this has been enforced in Magento 2.2.0 when trying to run the below commans:
php bin/...
7
votes
Check if product is in wishlist
Another approach in order to retrieve wishlist or custumer related information, is to use localStorage combined with Ajax request if the localstorage is empty.
Check information in your console :
...
7
votes
Accepted
Load additional product attributes in Wishlist
Where are the products loaded?
The products are loaded in the "_afterLoad" method of the items collection. A product collection is instantiated there based on the product ids of all items and ...
7
votes
Accepted
How to get the wishlist collection of a customer by Customer Id in magento2
Try this
private $wishlist;
public function __construct(
...
\Magento\Wishlist\Model\Wishlist $wishlist
) {
$this->wishlist = $wishlist;
...
}
...
$customer_id = 1;
$...
7
votes
Accepted
How get wishlist in Magento 2 Rest API?
Create a module Test_Mobileshop
Please follow the below steps with the file paths
2.app/code/Test/Mobileshop/etc/webapi.xml
<?xml version="1.0" ?>
<routes xmlns:xsi="http://...
6
votes
Accepted
Magento 2 - How to disable wishlist and product review module
As I can see, deactivate the module is not a good idea. So I decided to remove all links with the default.xml.
6
votes
Magento 2: Safe and easiest way to disable Compare products & Wishlist Module
UPDATE: After a Magento 2 core update, klara's answer is now the best way to disable Compare functionality. Please read below !
To disable Wish List functionality, you need to go in the ...
6
votes
Accepted
Magento 2.3.2: Uncaught Error: Call to a member function setUseContainer() on boolean
I think i should add another answer and leave previous answer as it is for knowledge purpose. I realized that i'm missing something. a very simple way to resolve this issue.
i have two overridden ...
5
votes
Returning wishlist item collection for currently logged in user
To do so you need to use the Magento\Wishlist\Controller\WishlistProviderInterface interface.
Inject this class in your constructor:
protected $wishlistProvider;
public function __construct(
......
5
votes
Accepted
Removing wishlist link - top header magento 2
app/design/frontend/vendorName/themeName/Magento_Wishlist/layout/default.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="...
5
votes
how to remove text "items" from top links wishlist magento 2
You can override the phtml: Theme_Root/Magento_Wishlist/templates/link.phtml
Instead this:
<span data-bind="text: wishlist().counter" class="counter qty"></span>
You can do this:
<...
5
votes
Accepted
Wishlist button color on Magento 2.1
Copy the following file:
/vendor/magento/module-wishlist/view/frontend/templates/catalog/product/view/addto/wishlist.phtml
to you desired theme like below:
/app/design/frontend/Dapl/demo/...
5
votes
Accepted
How to update/trigger wishlist counter in Magento 2.3?
Update your js file as
require([
....
'Magento_Customer/js/customer-data'
], function (...,customerData) {
"use strict";
...
var sections = ['wishlist'];
customerData.invalidate(...
5
votes
Magento 2 - Don't want to remove wishlist items when click 'Add all to cart' button
Magento adds wishlist items to the cart using the addToCart() method on the wishlist Item class. This method has a parameter that specifies whether to also remove the item from the wishlist. You can ...
4
votes
Magento 2: Safe and easiest way to disable Compare products & Wishlist Module
For Magento 2.1.x
Adding a default.xml file to your theme in: /Magento_Catalog/layout/default.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
4
votes
Magento2 rewrite _prepareCollection method in wishlist returning blank page
Worked like a charm. Was trying to add a function for delete all wishlist by extending \Magento\Wishlist\Block\Customer\Wishlist but wasn't giving the desired output, but after adding the constructor ...
4
votes
Accepted
Magento2 - How to remove item from wishlist?
You first need to inject several classes in your constructor
protected $_wishlistProviderInterface;
protected $_itemFactory;
public __construct(
...
\Magento\Wishlist\Controller\...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
wishlist × 409magento2 × 165
magento-1.9 × 79
product × 34
magento-2.1 × 25
magento2.3 × 18
customer × 16
addtocart × 16
cart × 14
configurable-product × 14
php × 13
magento-1.8 × 13
magento2.2 × 13
addtowishlist × 12
products × 11
ajax × 11
magento-1.7 × 10
customer-account × 10
magento-1 × 9
collection × 8
magento-enterprise × 8
frontend × 8
custom-options × 8
rest-api × 8
items × 8