Saturday, February 6, 2010

Remove "Add to Cart" buttons from Magento

Task Time: 10 minutes
  1. Edit /app/design/frontend/default/default/template/catalog/product/list.phtml
  2. Look for the two instances of the button containing: $this->getAddToCartUrl($_product)
  3. Either comment out this code or wrap it in a conditional statement
  4. Do the same for /app/design/frontend/default/theme037/template/catalog/product/compare/list.phtml
  5. Edit /app/design/frontend/default/theme037/template/catalog/product/view/addtocart.phtml
  6. Look for the fieldset with the class "add-to-cart"
  7. Either comment out the entire fieldset or wrap it in a conditional statement
  8. Edit /app/design/frontend/default//layout/checkout.xml
  9. Look for the block with the name "checkout_cart_link"
  10. Comment out the entire block
  11. Disabled mage_checkout module in system->config->advanced
  12. Refresh your cache by going to System->Cache Management
You can use this method to test if the user is logged in:
$this->helper('customer')->isLoggedIn()

Reference:  http://www.magentocommerce.com/wiki/price_on_application