Hi,
I have disabled compare functionality in the backend.
So compare buttons are not on the page anymore, that's exactly what I wanted.
However, I still have this URL that can be found in the code:
/catalog/product_compare/index/
I can also see this script:
<script>
function initHeader () {
return {
searchOpen: false,
cart: {},
getData(data) {
if (data.cart) { this.cart = data.cart }
}
}
}
function initCompareHeader() {
return {
compareProducts: null,
itemCount: 0,
receiveCompareData(data) {
if (data['compare-products']) {
this.compareProducts = data['compare-products'];
this.itemCount = this.compareProducts.count;
}
}
}
}
</script>
How can I remove it from the code ?
Many thanks !
Hello @jacqueskirchner
You can not remove "/catalog/product_compare/index/" URL. It's available in multiple places in the code. So only disable compare functionality from the backend. We also checked your script in the default code but we have not found it in the code. So please check in your custom theme if you have used otherwise check Magento backend. Custom theme path: app/design/frontend/{Vendor}/{Theme}/
If you find our reply helpful, please give us kudos.
A Leading Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.
WebDesk Solution Support Team
Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789
Thank You,
WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789
Location: 150 King St. W. Toronto, ON M5H 1J9