products per row in grid view magento go - magento

I am using magento go.
I have created a category and assign 8produts to it, i want to display 4 products in each row but it show 5-products.
Please give me solution.
Thanks

put this code in your category which you want to diplay 4 products, just open your category from admin and open custom design tab and put below code in custom layout update field.
<reference name="product_list">
<action method="setColumnCount"><columns>4</columns></action>
</reference>
Hope this will help you

Go to this path: magento_folder/app/design/frontend/mytheme(your_package)/neo(your_theme)/layout/catalog.xmlWrite this : <action method="setColumnCount"><count>4</count></action>
<catalog_category_default translate="label">
<reference name="content">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
<action method="setColumnCount"><count>4</count></action>
" "
" "
" "
</block>
And after that in the same catalog.xml file below add the same code (under :<catalog_category_layered translate="label"> tag) like this :
<catalog_category_layered translate="label">
<reference name="content">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
<action method="setColumnCount"><count>4</count></action>
" "
" "
" "
</block>
Hope this may help you

Related

How to call mini cart in footer in 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="-">

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>

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 - product list into CMS page

I want to show a category product in a CMS page. For that process I have
to insert the product list of a particular category inside a CMS page, to do it from backend I add a static block like this
{{block type="catalog/product_list"
name="home.catalog.product.list"
alias="products_homepage" category_id="4"
template="catalog/product/list.phtml"}}
How can I do the same thing inside phtml?
To do the same from phtml file, use:
<?php echo $this->getLayout()->createBlock("catalog/product_list")
->setCategoryId(4)->setTemplate("catalog/product/list.phtml")->toHtml();?>
This can be easily achieved through xml
<reference name="content">
<block type="catalog/product_list" name="home" template="catalog/product/list.phtml">
<!-- Product List View -->
<action method="setCategoryId"><category_id>40</category_id></action>
<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>
Just replace category id with your category id.

How to add Logout URL under every section of My Account Page?

I have a requirement that the logout url must be visible only in My Account bottom for every section of it like on "Account Information","Address Book", "My Orders" similar for all.
How to do this?
Where should I write
action method="addLink" translate="label title" module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>100</position></action>
in My customer.xml file.
You can remove the block 'customer_logged_in' in customer.xml and then you can add/make a block in customer.xml like this.
<reference name="content">
<block type="page/html_wrapper" name="my.account.wrapper" translate="label">
<label>My Account Wrapper</label>
<action method="setElementClass"><value>my-account</value></action>
<block type="core/template" name="logout_link" template="customer/logout_link.phtml"/>
</block>
</reference>
And the content of the logout_link.phtml would be something like,
<?php
$loggedIn = $this->helper("customer")->isLoggedIn();
if($loggedIn == 1){
echo "<a href=\"".Mage::getBaseUrl()."customer/account/logout/\" >LOGOUT</a>";
}else{
echo "<a href=\"".Mage::getBaseUrl()."customer/account/\" >LOGIN</a>";
}?>
....
It's better to use these URL's:
Mage::helper('customer')->getLogoutUrl()
Mage::helper('customer')->getLoginUrl()
It uses the customer helper instead of a hard coded URL.

Resources