How to call mini cart in footer in magento? - magento

I want to call mini cart in footer.
i have to use below code in xml file
<reference name="footer">
<block type="checkout/cart_sidebar" name="footer_cart" template="checkout/cart/topcart.phtml" before="-">
<action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action>
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action>
<block type="core/text_list" name="cart_sidebar.extra_actions" as="extra_actions" translate="label" module="checkout">
<label>Shopping Cart Sidebar Extra Actions</label>
</block>
</block>
</reference>
or <?php echo $this->getChildHtml('top_cart') ?> in footer.phtml.
but its not working for me. please give me any idea for do it.

you name of block is footer_cart so
change
<?php echo $this->getChildHtml('top_cart') ?>
to
<?php echo $this->getChildHtml('footer_cart') ?>
other problem is you are calling the wrong file
change
<block type="checkout/cart_sidebar" name="footer_cart" template="checkout/cart/topcart.phtml" before="-">
to
<block type="checkout/cart_sidebar" name="footer_cart" template="checkout/cart/sidebar.phtml" before="-">

Related

Add Banner Below Menu in Category Page

I need to add the category banner below the Breadcrumbs.
I have tried by adding new reference
<?php echo $this->getChildHtml('category_banner') ?>
in the 2columns-left.phtml
and in local.xml
<catalog_category_view>
<reference name="category_banner">
<block type="core/template" name="topbanner" template="catalog/category/category-image.phtml" before="-"></block>
</reference>
</catalog_category_view>
<catalog_category_default translate="label">
<reference name="category_banner">
<block type="core/template" name="banner" template="catalog/category/category-image.phtml"></block>
</reference>
</catalog_category_default>
But output is not coming.
Added new line inside the all layout i.e 2columns-left.phtml etc.
<?php echo $this->getChildHtml('category_banner') ?>
added below line inside your xml
<catalog_category_view>
<reference name="root">
<block type="core/template" name="category_banner" template="catalog/category/category-image.phtml" before="-"></block>
</reference>
</catalog_category_view>

toolbar,phtml file need to show in another page(splash page list)

I want to show my toolbar.phtml file in other page like splash-page. I just copy <?php echo $this->getToolbarHtml(); ?> from list.phtml file and put it into my splash-page view.phtml file.. also I have checked that the attripute-splash.xml file. there toolbar.phtml file is already placed. like :
<block type="attributeSplash/page_view_product_list" name="product_list" template="catalog/product/list.phtml">
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_pager" name="product_list_toolbar_pager"/>
</block>
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
</block>
but it's not showing into splashpage..
Kindly help..

How can i display header only homepage in Magento?

I want to display header only homepage.
How can i disable header other page?
Hi If your website having one column layout then open the 1column.phtml file and
replace this line
<?php echo $this->getChildHtml('header') ?>
with this,
<?php $page= Mage::getSingleton('cms/page')->getIdentifier();?>
<?php if($page=='home'){ ?>
<?php echo $this->getChildHtml('header') ?>
<?php } ?>
If you want remove this header using xml then follow below steps
step1:create local.xml under app/design/frontend/yourpackage/yourtemplate/layout
code of local.xml is
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="root">
<remove name="headerone"/>
</reference>
</default>
<cms_index_index >
<reference name="root">
<block type="page/html_header" name="header" as="header">
<block type="page/template_links" name="top.links" as="topLinks"/>
<block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
<block type="core/text_list" name="top.menu" as="topMenu" translate="label">
<label>Navigation Bar</label>
<block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
</block>
<block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
<label>Page Header</label>
<action method="setElementClass"><value>top-container</value></action>
</block>
</block>
</reference>
</cms_index_index>
</layout>
Step2:goto page.xml under app/design/frontend/yourpackage/yourtemplate/layout
Find <block type="page/html_header" name="header" as="header">
change it to
<block type="page/html_header" name="headerone" as="headerone">
You could do this quite easily without any code changes by adding a <remove /> line for the header block in your local.xml and then in the home page layout, adding the header block to the home page in CMS under page layout in the design tab.
Layout is quite powerful in making such a custom mod.

Magento getChildHtml block not rendering

I'm attempting to rearrange some elements on a webpage and my code won't render it its new position.
The top of the page is handled in view.phtml and the bottom in list.phtml. I'm wanting to move form.phtml from view to list.
The xml looks like this:
<block type="review/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml">
<action method="disableGallery"/>
</block>
<block type="review/form" name="product.review.form" as="review_form" template="review/form.phtml"/>
the view.phtml contains this call:
<?php echo $this->getChildHtml('review_form') ?>
However, no dice. I'm very new to Magento, so any help would be great. I've looked into the following questions and more with no results:
Nested block within a reference not rendering when using ->getChildHtml()
Magento $this->getChildHtml('media') return blank
Call magento template via $this->getChildHtml()
Thanks!
As per as your description,review child block is call in under view then...
it should be
<block type="review/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml">
<action method="disableGallery"/>
</block>
<block type="review/form" name="product.review.form" as="review_form">
<block type="page/html_wrapper" name="product.review.form.fields.before" as="form_fields_before" translate="label">
<label>Review Form Fields Before</label>
<action method="setMayBeInvisible"><value>1</value></action>
</block>
</block>
.........

Magento EE 1.11 - Customer Attributes Not Visible

Our client wants to add an 'Industry' dropdown to customer registration. We have created a new customer attribute, 'industry' and entered in the appropriate values.
It was not showing on the front-end. I looked into customer/form/register.phtml and it wasn't calling anything for attributes, so I pulled from enterprise/default/template/customer/form/register.phtml the following:
<?php $customerAttributes = $this->getChild('customer_form_user_attributes');?>
<?php if ($customerAttributes): ?>
<?php $customerAttributes->setShowContainer(false);?>
<?php $this->restoreSessionData($customerAttributes->getForm());?>
<?php echo $customerAttributes->toHtml()?>
<?php endif;?>
And then I added in the .xml update found in 'enterprise/layout/customer.xml':
<remove name="right"/>
<remove name="left"/>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
<block type="page/html_wrapper" name="customer.form.register.fields.before" translate="label">
<label>Form Fields Before</label>
<!--action method="setMayBeInvisible"><value>1</value></action-->
<action method="setElementClass"><value>rewards</value></action>
</block>
<block type="enterprise_customer/form" template="customer/form/userattributes.phtml" name="customer_form_user_attributes">
<action method="setFormCode"><code>customer_account_create</code></action>
<action method="setEntityModelClass"><code>customer/customer</code></action>
</block>
<block type="enterprise_customer/form" template="customer/form/userattributes.phtml" name="customer_form_address_user_attributes">
<action method="setFormCode"><code>customer_register_address</code></action>
<action method="setEntityModelClass"><code>customer/address</code></action>
</block>
<reference name="content">
<block type="customer/form_register" name="customer_form_register" template="customer/form/register.phtml">
<action method="append"><block>customer.form.register.fields.before</block> <alias>form_fields_before</alias></action>
<action method="append"><block>customer_form_user_attributes</block> </action>
<action method="append"> <block>customer_form_address_user_attributes</block></action>
</block>
</reference>
<update handle="customer_form_template_handle"/>
At this point, the attributes are not visible on the front-end. If I perform:
<pre>
<?php print_r($customerAttributes->getUserDefinedAttributes()) ?>
</pre>
I am returned the array of attributes as I would expect. What am I missing here?
Found it. Needed this stuff in customer.xml. For some reason using the enterprise/default customer.xml wasn't working, but I added this in and it was good.
<customer_form_template_handle>
<reference name="content">
<block name="customer_form_template" type="enterprise_customer/form_template">
<action method="addRenderer">
<type>text</type>
<renderer_block>enterprise_customer/form_renderer_text</renderer_block>
<template>customer/form/renderer/text.phtml</template>
</action>
<action method="addRenderer">
<type>textarea</type>
<renderer_block>enterprise_customer/form_renderer_textarea</renderer_block>
<template>customer/form/renderer/textarea.phtml</template>
</action>
<action method="addRenderer">
<type>multiline</type>
<renderer_block>enterprise_customer/form_renderer_multiline</renderer_block>
<template>customer/form/renderer/multiline.phtml</template>
</action>
<action method="addRenderer">
<type>date</type>
<renderer_block>enterprise_customer/form_renderer_date</renderer_block>
<template>customer/form/renderer/date.phtml</template>
</action>
<action method="addRenderer">
<type>select</type>
<renderer_block>enterprise_customer/form_renderer_select</renderer_block>
<template>customer/form/renderer/select.phtml</template>
</action>
<action method="addRenderer">
<type>multiselect</type>
<renderer_block>enterprise_customer/form_renderer_multiselect</renderer_block>
<template>customer/form/renderer/multiselect.phtml</template>
</action>
<action method="addRenderer">
<type>boolean</type>
<renderer_block>enterprise_customer/form_renderer_boolean</renderer_block>
<template>customer/form/renderer/boolean.phtml</template>
</action>
<action method="addRenderer">
<type>file</type>
<renderer_block>enterprise_customer/form_renderer_file</renderer_block>
<template>customer/form/renderer/file.phtml</template>
</action>
<action method="addRenderer">
<type>image</type>
<renderer_block>enterprise_customer/form_renderer_image</renderer_block>
<template>customer/form/renderer/image.phtml</template>
</action>
</block>
</reference>
</customer_form_template_handle>
You should check template/customer/form/userattributes.phtml which is controlling user defined attributes. I don't know, does anybody touched this file? Check this first.
<?php foreach ($this->getUserDefinedAttributes() as $attribute):?>
<?php $attributeContent = $this->getAttributeHtml($attribute);?>
<?php if ($attributeContent): ?>
<li><?php echo $attributeContent;?></li>
<?php endif;?>
<?php endforeach;?>

Resources