Magento: Using Custom layout update XML to remove price - magento

In Magento i want to remove the prices from all articles in certain categories by using a custom layout update in the category.
This is what i came up with my self, but i'm still missing the last piece of the puzzle.
<catalog_product_view>
<reference name="product_list">
<remove name="xxx" />
</reference>
</catalog_product_view>
In the above piece of code i need the corresponding name for the price template.
Does anyone know which one i have to use here?
Thanks!!

Related

Magento removing a block for certain products

I am using a block "block_product_primary_bottom" on 98% of my products. however one the other 2% I want to have it removed, since it will only be about 4 products, I don't see the need to create a custom layout. Is there a way when creating the product to remove the block in the design.
I have tried:
<reference name="product.info">
<remove name="block_product_primary_bottom"/>
</reference>
What do I need to do?
That's the right way to do it.
I tried this in product design, as a test, and it removed the media block (I'm using 1.9.3.6):
<reference name="product.info">
<remove name="product.info.media" />
</reference>
Also, you don't need to reference product.info, the name alone is descriptive enough to remove it:
<remove name="product.info.media" />
Make sure you are referencing the block name and not the block alias (as="..."). Referencing the alias won't work.
If you want to remove it for some particular products only, you can do this from admin panel. Edit that particular product, now in design tab add below code for Custom Layout Update
<remove name="block_product_primary_bottom" />

Magento - Change Product Page Layout for only one Product in the define Layout Section

This is for sure a quicky, but nothing i found so far is working.
I would like to set a different product view for a choosen Product only. Not for a category. I tried to add this to the custom layout tab without any luck so far.
I tried any variantions of this:
<reference name="product.info">
<action method="setTemplate"><template>catalog/product/newview.phtml</template></action>
</reference>
But Magento will not read it!
Is there any easy solution to this ? Or maybe how i can get the template added to the layout dropdown in the Design Tab of the Product ? I mean the Tab where you can choose between 1-2 or 3 Columns Layout.
Thank you very much for your help. I am using Magento 1.9.1.
In your local.xml file put the following,
<layout>
...
<PRODUCT_86>
<reference name="root">
<action method="setTemplate"><template>catalog/product/newview.phtml</template></action>
</reference>
</PRODUCT_86>
...
</layout>
Here 86 is a product_id. Flush the cache and then check.
The Solution is quite easy: Make the new File readable by the Webserver.
For what its worth, maybe it helps someone.

Adding a block to magento category page using local.xml

Before posting this, i have looked in to the following, but all of them did not helped me and i was not able to add the block.
magento - adding and positioning a block using local.xml
Magento - Add phtml file to layout block
Magento 1.7:Show category image on category page in full width in a 2 column template
I want to add the category image on top of the page. Currently it is displayed under the product list view, and i want it to be above the left navigation, so that it takes full page width.
I created a template file in mytheme/template/catalog/category/image.phtml and i just added some text "I am here".
After that i add the following xml to my local.xml file under catalog_category_default
<reference name="content">
<block type="catalog/category_view" name="category.image" template="catalog/category/image.phtml"></block>
</reference>
But it is still not working and the text is not displayed there. When this text is displayed, then i will display the category image, but for now i just want to make the block working and display it on top of the page.
Thank you
Maybe your category does not load the layout handle catalog_category_default. There are 2 handles for categories _default and _layered.
To make sure you cover both cases and so you won't duplicate markup try this approach.
define your custom handle.
<my_awsome_category_handle>
<reference name="content">
<block type="catalog/category_view" name="category.image" template="catalog/category/image.phtml"></block>
</reference>
</my_awsome_category_handle>
Then include that handle in both category handles.
<catalog_category_default>
<update handle="my_awsome_category_handle" />
</catalog_category_default>
<catalog_category_layered>
<update handle="my_awsome_category_handle" />
</catalog_category_layered>

Change template page layout on cart page in Magento

Please help me on this. I want to change template page layout of cart page in magento.
The following is the URL : http://www.wildgoosetrading.com/index.php/checkout/cart/
I want this to look like other pages of category.
Thanks in advance.
You'd set the template for the cart in your checkout.xml layout file.
In the checkout_cart_index section (straight after <default>) look for the following block and change the template the cart page is using;
<!-- Mage_Checkout -->
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
EDIT
I know this is the accepted answer but soipo's answer is the better way. Apply the change to local.xml, don't modify the core layout files, override them using local.xml in your theme's layout. See http://www.classyllama.com/development/magento-development/the-better-way-to-modify-magento-layout
In your local.xml file you can just add the following:
<checkout_cart_index translate="label">
<reference name="root">
<action method="setTemplate"><template>page/3columns.phtml</template ></action >
</reference>
Just change the template to the one you need.
By using Magento's common setTemplate method, the inherent granularity introduced by Magento's own app/design/frontend/base/default/layout/checkout.xml is lost.
Magento deliberately created two methods for doing this: setCartTemplate and setEmptyTemplate. They handle two separate conditions.
One condition is when the cart has items, the other is when the cart is empty. By calling setTemplate, that granularity is lost. That means a cart with items and a cart with zero items will both display the same template, which might be not desired.
More on this can be found here: https://stackoverflow.com/a/33875491/2973534

Magento Cart layout change not sticking

Sorry this is a novice question...
I have changed the layout of my magento cart to popup.html.
i have edited the checkout.xml to use popup.phtml... this is the code i have used in the checkout.xml....
<checkout_cart_index translate="label">
<label>Shopping Cart</label>
<remove name="right"/>
<remove name="left"/>
<reference name="root">
<action method="setTemplate">
<template>page/popup.phtml</template>
</action>
</reference>
</checkout_cart_index>
The problem is that everything was working fine... but i was making changes on the category page and suddenly the cart has stopped showing layout popup.phtml and has started showing 2 column-left and that too without the cart content.
i was making some changes to catalog.xml ... but cant see how it would override the display of checkout/cart
I have been banging my head around this for couple of hours now... Any suggestions as to where i should look to see whats overriding the popup.phtml completely and just displaying an empty two column layout with left column.
thanks..much appreciate..
The particular file generally does not matter. What matters is the layout update handle, i.e. top level nodes in layout update XML, e.g. default, catalog_category_layered, checkout_onepage_index. It is these which "scope" your layout XML directives.

Resources