Bài viết này sẽ hướng dẫn các bạn tắt chức năng so sánh sánh sản phẩm trong Magento bằng cách làm theo các bước dưới đây:
Sửa app/code/core/Mage/Catalog/Helper/Product/Compare.php và thay đổi code như sau:
public function getAddUrl($product){return $this->_getUrl(’catalog/product_compare/add’, $this->_getUrlParams($product));}
Tới
public function getAddUrl($product){//return $this->_getUrl(’catalog/product_compare/add’, $this->_getUrlParams($product)); return false;}
Sửa ./app/design/frontend/base/default/layout/catalog.xml (nếu bạn đang sử dụng một giao diện Magento khác, hãy nhập tên của theme thay vì mặc định) và thay đổi code sau đây:
<block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
Tới
<!-- <block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/> -->
Xóa cache Magento từ Quản trị Magento> System > Cache Management.