How to remove "add to cart" button from only one cms page?
I created a web store with a custom CMS page that also has its own layout. This page will show all the products in the store.
On this CMS page all products are displayed but
I want to remove "Add to Cart" link, add "Favorites" and "Add to Compare" links from products
I only want to remove these links from this CMS page.
I tried
<remove name="" />
in Layout Refresh XML of this CMS page but I cannot get the specific names to delete and while searching I tried every possible name but had no success.
Any suggestions?
source to share
If you have used a custom layout and you are displaying all products on this page, you must use a block type to display all products in the content of this page.
Something like
{{block type="catalog/product_list_random" name="product" template="catalog/product/list.phtml"}}
Just create a new file and save it at the same position where list.phtml is saved (obviously with a different name say new.phtml
Place this new.phtml instead of list.phtml
And remove whatever you don't want to display on this page from new.phtml
source to share
You can delete entire blocks with these layout updates, but these links and buttons are not separate blocks, but appear in the block Mage_Catalog_Block_Product_List
. You will need to replace the template of this block with your own:
- copy
/app/design/frontend/base/default/template/catalog/product/list.phtml
to/app/design/frontend/YOUR/THEME/template/WHATEVER/catalog/product/list.phtml
(use your theme directory and directory name under the template that links to your CMS page) - edit this copy and remove links and buttons
- in the layout update descriptor for your CMS page add:
XML:
<reference name="product_list">
<action method="setTemplate" template="WHATEVER/catalog/product/list.phtml" />
</reference>
(assuming the product list block is called product_list
)
source to share
Then, depending on what you want to remove, you can put the following lines between the default tags:
<remove name="cart_sidebar" /> "
<remove name="catalog.compare.sidebar" /> "
http://www.hostknox.com/tutorials/magento/remove-default-blocks/manual-removal
source to share