Go to file path, vendor/magento/module-checkout/view/frontend/web/js/view/minicart.js
check below part for close button html like,
<button type="button" id="btn-minicart-close" class="action close" data-action="close" data-bind="attr: { title: $t('Close') }" title="Close">
<span><!-- ko i18n: 'Close' --><span>Close</span><!-- /ko --></span>
</button>
For close button html in minicart above display we can find data-action="close"
from js file.
closeSidebar: function() {
var minicart = $('[data-block="minicart"]');
minicart.on('click', '[data-action="close"]', function(event) {
event.stopPropagation();
minicart.find('[data-role="dropdownDialog"]').dropdownDialog("close");
});
return true;
}
Here list of url for checkout, update button, login url, remove button
"url": {
"checkout": window.checkout.checkoutUrl,
"update": window.checkout.updateItemQtyUrl,
"remove": window.checkout.removeItemUrl,
"loginUrl": window.checkout.customerLoginUrl,
"isRedirectRequired": window.checkout.isRedirectRequired
},
"button": {
"checkout": "#top-cart-btn-checkout",
"remove": "#mini-cart a.action.delete",
"close": "#btn-minicart-close"
}
Try with below solutions,
Replace _ with folder and separate each folder path like below,
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Catalog\Block\Product\View" type="Magento\Module\Inject\Session\Block\Product\View"/>
</config>
Set your block php file at below location,
app/code/Magento/Module/Inject/Session/Block/Product/View.php
inside php file,
<?php
namespace Magento\Module\Inject\Session\Block\Product;
class View extends \Magento\Catalog\Block\Product\View{
//your custom code.....
}
Best Answer
Go to admin panel:
For Front End:
And refresh product list page check which path use list.phtml file in magento 2