I am developing a new custom module in magento. I need to customize the shopping cart page without affecting the original cart.phtml. My module name is Stallioni. I have placed the cart.phtml inside frontend/default/default/template/stallioni/checkout/cart.phtml .How can i use this cart.phtml in my new module instead of the original . I know we should change something in checkout.XML or stallioni/layout/stallioni.xml file. But no idea since i am new.I googled out a day but couldn't find.
http://blog.chapagain.com.np/magento-overriding-template-file-from-custom-module/ this link tells something but it didn't worked for me.I need your help!
If your layout.xml is working add this code in your layout
`<checkout_cart_index>
<reference name="content">
<reference name="checkout.cart">
<action method="setTemplate">
<template>default/default/template/stallioni/checkout/cart.phtml</template>
</action>
</reference>
</reference>
</checkout_cart_index>`
It should work :)
Related
I want to show revolution slider on category page using by "nwdthemes revolution slider".
I am doing this:
1) created a category "Men"
2) created a revolutions slider with alias "category_men" and short-code {{revslider alias="category_women"}} using by "nwdthemes revolution slider"
3) In category Custom Design tab, put below code into Custom Layout Update field
<reference name="top.container">
<block type="nwdrevslider/revslider" name="revslider">
<action method="setAlias"><alias>category_men</alias></action>
</block>
</reference>
But revolution slider is not showing on category page front-end. Any help would be appreciated.
You probably need to go into the Revslider global settings and set it to load scripts globally for it work on category pages.
The code you post looks correct. Try to clear cache in System > Cache management. If you are using any 3rd-party cache extensions - clear their cache too.
You can also insert slider instead of category image
Check if category has image. If yes - remove it
Open "Display Settings" tab and set "Display Mode" to Products Only
Update xml code to
<reference name="content">
<block type="nwdrevslider/revslider" name="revslider" before="-">
<action method="setAlias"><alias>ecorecycle</alias></action>
</block>
</reference>
Full article can be found here - https://nwdthemes.com/2015/04/29/slideshow-for-category-page-with-slider-revolution-magento-extension/
please try with below code snippet :
<referenceContainer name="page.top">
<block class="Nwdthemes\Revslider\Block\Revslider">
<arguments>
<argument name="alias" xsi:type="string">category_men</argument>
</arguments>
</block>
</referenceContainer>
and don't forget to clear the cache
I followed this tutorial to create the custom block in magento
http://www.gravitywell.co.uk/blog/post/how-to-creating-your-own-custom-block-in-magento
But nothing is showed when I open up home page or any other page. I have searched alot on web but unable to solve the issue.
The above tutorial did not mention where to create layout.xml file but I have created it at:
app\design\frontend\gravitywell\example\layout\layout.xml ---It has just following code:
<block type="gravitywellexample/menu" name="menu" as="menu" template="gravitywell/menu.phtml" />
Any help will be highly appreciated.
Thanks in advance.
I would use local.xml, but then the question becomes what handle tags to put it inside of i.e. where do you want it to show up. When using a 2column-right layout, I can position it inside of the right column on the product page this way:
<catalog_product_view>
<reference name="right">
<block type="gravitywellexample/menu" name="menu" as="menu" template="gravitywell/example/menu.phtml" />
</reference>
</catalog_product_view>
my template is stored in a slightly different folder.
hth, sconnie
I'm trying to remove "recently viewed" from the home page, but I don't know where the block is called. I tried to delete reports.xml but the block stayed there. Then I tried to delete all the code in home_product_viewed.phtml and it worked, but I don't want to delete the code. I only want to delete the call to that file but I don't know where that file is called.
Goto magento backend.
Select the CMS page for homepage.
In the Design section add the below code in the Layout Update XML field
<reference name="right">
<action method="unsetChild"><alias>right.reports.product.viewed</alias></action>
</reference>
To remove it from only the home page, I would do this. Go to your /app/design/frontend/packagename/themename/layout/local.xml
and edit it like this:
<layout>
<cms_index_index>
<remove name="right.reports.product.viewed" />
</cms_index_index>
</layout>
To verify your packagname and themename, go in to admin - System - Configuration - Design.
There may already be other code inside of the layout tag which you should leave there!
This worked for me -> Using left below not right.reports.product.viewed.
Custom Layout Update
<reference name="right">
<action method="unsetChild"><alias>left.reports.product.viewed</alias></action>
</reference>
In my magento i want to create a Block in Product Page for this itried like this
Magento- How can i add a new custom block in product details page using module
But no use
Any thing wrong i did here
Any Ideas
Hello check below code may be help you
add into product template (view.phtml) where you want
<?php echo $this->getChildHtml('mynewblock');?>
call block into your custom template xml or catalog.xml
<catalog_product_view>
<reference name="product.info">
<block type="core/template" name="mynewblock" template="hello/hello.phtml" />
</reference>
</catalog_product_view>
I'm pretty new to Magento, and have been following the base theme so far along, but I am having problems with catalog pagination.
At the moment I'm having problems getting the "page/html_pager" block to display.
So, my catalog.xml has this for both anchor and non-anchor categories:
<reference name="content">
<block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
<block type="catalog/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>
</block>
</block>
</reference>
My toolbar.phtml has the corresponding code:
<?php echo $this->getPagerHtml() ?>
and my default/template/page/html/pager.phtml just contains some test code along the lines of:
<h1>Test</h1>
At first I thought it might be because there weren't multiple pages, so I added some products and set the both the grid and the list views to show a maximum of 1 per page, and the item count reflects this:
Showing 1 of 11 items
Doing a var_dump on the $this->getPagerHtml() returns an empty string, and using the template path hints indicates it doesn't even seem to load the block - yet it loads it's parent block.
Copying the code directly from the base design package doesn't work, yet switching to that package it does.
So, what am I missing? Or doing wrong? I've run out of ideas as to what it could be.
thanks
Solved:
Adding<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
After the product_list_toolbar block appeared to fix this issue.
Magento's documentation is a little thin on the ground with this so I'm unsure as to why
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
requires it's name set again with an action tag, but it does.
If anyone can explain this, I'd love to understand it.
Any chance that it's being overridden by a different .xml file in layout?
You could always remove all the .xml files in the layout directory and bring them back in one by one and see if the pagination toolbar disappears, whilst making sure cache is turned off.
After that, rename the template directory catalog to ~catalog and let it pick up the base catalog directory and see if it's actually the .phtml files causing the problem.