I am creating a custom module and want to add another tab after product description tab in product detail page. Below is my xml code for execute:
<catalog_product_view>
<reference name="product.description">
<block type="testimonial/monblock" name="stockas">
<action method="setTemplate">
<template>testimonial/viewMore.phtml</template>
</action>
</block>
</reference>
</catalog_product_view>
But it shows under price column. I want to show it under product details tab.
Any one please help me.
Just add this code after Description block in catalog.xml files
<block type="testimonial/monblock" name="stockas">
<action method="setTemplate">
<template>testimonial/viewMore.phtml</template>
</action>
</block>
you can add in the above way for any number of tabs needed hope this helps.
Related
I created a new CMS with 2column layout and now want to put full width or 1 column banner on top of 2 columns.
I tried
<reference name="root">
<block type="cms/block" name="my_banner" as="my_banner" template="path/to/my_banner.phtml" />
</reference>
in Layout Update XML but nothing happened. Any help will be appreciated!
As per #richtea response I updated the CMS page layout settings like the screenshot given below but didn't worked
http://screencast.com/t/CiidoSRgkNs
You are requesting the page to add a CMS block, but referencing a PHTML template. You can either:
Insert a CMS block, use the below and create a block in your admin panel with identifier my_banner.
<reference name="root">
<block type="cms/block" name="my_banner">
<action method="setBlockId"><block_id>my_banner</block_id></action>
</block>
</reference>
Or insert a template file as follows
<reference name="root">
<block type="core/template" name="my_banner" as="my_banner" template="path/to/my_banner.phtml" />
</reference>
This is how i tried. bud didn't get answer. what my template will do is each product image will have a like button. i have done with view.phtml but not in list.phtml. Pls friends broadcast your knowledge.
<reference name="content">
<block type="productlike/most" name="productlike" before="-">
<action method="setTemplate" ifconfig="section_1/group_1/enabled"><template>productlike/like.phtml</template>
</action>
</block>
</reference>
I need to change category and product view for each category/product, for change category list I have add into local.xml:
<layouts>
<CATEGORY_3>
<reference name="product_list">
<action method="setTemplate">
<name>catalog/product/list-1.phtml</name>
</action>
</reference>
</CATEGORY_3>
</layouts>
but I don't know how to change layout from product of category_3, I try adding
<reference name="product.info">
<action method="setTemplate">
<action method="setTemplate">
<template>catalog/product/view-1.phtml</template>
</action>
</action>
</reference>
inside tag but nothing, where is the mistake?
First off, your second XML config block seems to be missing a .phtml extension inside <template></template>.
Second, your action method="setTemplate" is nested twice. Remove the first one
<reference name="product.info">
<!-- action method="setTemplate" REMOVED-->
<action method="setTemplate">
<template>catalog/product/view-1.phtml</template>
</action>
<!-- /action REMOVED-->
</reference>
Also the template you're trying to call
Additionally, Please don't do this from local.xml. You will have caching issues. I guarantee it. This is probably one of the reasons why you're not seeing changes. We did a similar thing last month and it bit us in the arse.
Instead go to Catalog > Manage Categories > (Click on/Select a Category) > Custom Design Tab and then enter your XML layout changes at the Custom Layout Update box. This worked for us better and thus it might give you a better chance of success, too.
I installed a template, and there is no My Cart link at top link.
This in checkout.xml:
<reference name="top.links">
<block type="checkout/links" name="checkout_cart_link">
<action method="addCartLink"></action>
<action method="addCheckoutLink"></action>
</block>
</reference>
I want to show it with item quantity ex: My Cart(1)
Please help me!
Best regards,
One way you can do this is within the template file add this code:
$count = $this->helper('checkout/cart')->getSummaryCount();
This will display the number of items in the cart. If you copy the template and layout files into your theme you should be able to add this in and get it working.
If I want to control how each product is displayed (i.e. a custom design when specified) my first thought is to do this:
Create a custom view.phtml in template/catalog/product/my_view.phtml
Navigate in the admin to Product->Design->Custom Layout Update
Add this block:
<reference name="content">
<action method="setTemplate">
<template>catalog/product/view_print.phtml</template>
</action>
</reference>
But the template is never loaded, only the default view.phtml. Is this the correct method? I need to be able to do this in the product settings.
Found the answer:
<reference name="product.info">
<action method="setTemplate"><template>catalog/product/NEW_VIEW.phtml</template></action>
</reference>
Navigate in the admin to Product->Design->Custom Layout Update > Add the below custom block. > It works for all the stores.
"<reference name="product.info">
<block type="namespace_modulename/catalog_product_list_custom"
name="catalog.product.modulename" as="modulename" after="tierprices"
template="modulename/catalog/product/modulename.phtml"/>
</reference> "
Add the below code in view.phtml
<?php echo $this->getChildHtml('modulename'); ?>