How to hide add to cart button, add to compare and add to wishlist for particular products on all page in magento 2
To hide add to cart button all page using a below plugin:
>di.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<type name="Magento\Catalog\Model\Product">
<plugin name="hidebutton" type="Vendor\Module\Plugin\HideButton" sortOrder="10" disabled="false" />
</type>
</config>
>HideButton.php
<?php
namespace Vendor\Module\Plugin;
use Magento\Catalog\Model\Product;
class HideButton
{
public function aroundIsSalable(Product $product,\Closure $result)
{
return 0;
}
}
Above plugin works well but its shows an "Out of Stock" in listing and home page how to hide a "out of stock" text.
[![enter image description here][1]][1]
[1]: https://i.sstatic.net/7scWy.png