I want to override the exist cart template since I add some module in it. I use the XML below to update the layout.
<checkout_cart_index>
<reference name="checkout.cart">
<action method="setCartTemplate">
<value>magefd/shipandpay/checkout/cart.phtml</value>
</action>
<action method="setEmptyTemplate">
<value>checkout/cart/noItems.phtml</value>
</action>
<action method="chooseTemplate"/>
<block type="fdshipandpay/checkout_cart_fee" name="magefd.shipandpay.cart.fee"
as="fee" template="magefd/shipandpay/checkout/cart/fee.phtml" />
</reference>
</checkout_cart_index>
However, the original template will be used when a new user visit the cart at first time. After they refresh, it work perfect. After session time out if the user refresh it, the same problem comes out. I don't know how it happened. Any one can help?
Just copy your .phtml file to all templates directories..eg, Default, and Base theme..Clean cache and try again..
Related
I have a minor bug/issue with my Magento site.
I've started to make a few group products, and all of the grouped product pages are broken.
It looks like 1 or both of the sidebars appear on the product page and "squeeze" the product info into the middle of the page.
I am using the "ultimo" theme.
Can anyone suggest how I can try and fix this myself?
I can probably fix it myself, if someone is able to point me to the correct file and suggest a code to fix.
Here is the example:
To me this page looks like it is set to the base template 3-columns rather than 2-columns-right.
Since you say it only happens with grouped products have a look in your layout xml files for the handle PRODUCT_TYPE_grouped then with this handle you will probably see something as follows.
<reference name="root">
<action method="setTemplate"><template>page/3columns</template></action>
</reference>
I guess it should be:
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference>
I have my homepage redirected to a product page, but I still want my banners from the home page to show up.
Anyone have any clue how I can add banners to my product page ? Pretty new to Magento... Certainly not as easy as Joomla.
There are handles in Magento who decide what block to show when specific controller is called.
Take a look at this file
/magento/app/design/frontend/base/default/layout/catalog.xml and find following lines
<catalog_product_view translate="label">
<label>Catalog Product View (Any)</label>
<!-- Mage_Catalog -->
<reference name="root">
<action method="setTemplate">
<template>page/2columns-right.phtml</template>
</action>
</reference>
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<!-- Some more code -->
</block>
</reference>
<!-- Some more code -->
</catalog_product_view>
catalog_product_view is the handle you may want to use for displaying the banner on product page.
Pick that handle and write the block specific code.
If you want to use an extension to simplify your task here is the one.
You can call banner code on products page. Or if you want to go with simple technique, use iframe
I'm working on a module in magento admin where I would like to show the scope selector as in manage products, manage categories, system configuration for my grid edit form.
Can anyone help me how could I add that and store values in database specific to the scope selected?
By searching on the store switcher, you can see Magento adds it by adding it in the layout file:
<your_layout_handle_here>
<reference name="left">
<block type="adminhtml/store_switcher" name="store_switcher" template="store/switcher.phtml" />
</reference>
</your_layout_handle_here>
For not show the confirm alert add an action in this block as in a core
<block type="adminhtml/store_switcher" name="store_switcher" before="-">
<action method="setUseConfirm"><params>0</params></action>
</block>
How do you remove the left hand column on product listings page in Magento?
I've looked in the local.xml file but I'm not sure which code I should edit.
You can change template of product listing in admin:
- Catalog->Manage Categories->Your category - tab Custom Design - field - Page Layout
OR
in your design layout xml (local.xml or something else) :
<catalog_category_layered>
<reference name="root">
<action method="unsetChild"><name>left</name></action>
</reference>
</catalog_category_layered>
OR
<catalog_category_default>
<reference name="root">
<action method="unsetChild"><name>left</name></action>
</reference>
</catalog_category_default>
also you can set anpother template in xml:
<catalog_category_layered>
<reference name="root">
<action method="setTemplate"><name>page/1column.phtml</name></action>
</reference>
</catalog_category_layered>
see template/page/ for templates.
Using local.xml (read 5 Useful Tricks For Your Magento local.xml)
<catalog_category_default translate="label">
<remove name="left"/>
</catalog_category_default>
Why do you need to remove the "left column" why don't you just change the product listing page to a different layout. i.e 2column-right.phtml, 1column.phtml, or 3column.phtml there is no need to physically remove the left column under 99% of most situations just change the layout.
First you need to create or update your local.xml file IF you do not have a local.xml file you can create one in
app->frontend->[Package Name]->[Theme Name]->layout->local.xml
Once this is created you can copy exactly what I have in this post into that file for a start of how to use one.
DO ALL UPDATES THROUGH A LOCAL.XML file not through catalog.xml !! This will make upgrades significantly easier later down the road. Additionally, you will be able to quickly see all changes you have made to your site in one file.
The below example will set the product listing page to 1column
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<catalog_product_view translate="label">
<reference name="root">
<action method="setTemplate">
<template>page/1column.phtml</template>
<!-- Below are examples of different layouts you can use
<template>page/2columns-right.phtml</template>
<template>page/2columns-left.phtml</template>
<template>page/3columns.phtml</template> -->
</action>
</reference>
</catalog_product_view>
</layout>
Hope this helps and is a guide to some newbies out there.
I've been trying to figure this problem out for several hours now - I've made two page templates for the products one is named vxs-view.phtml and the other is view.phtml. There located in the same directory.
The solution I tried was to input
<reference name="product.info">
<action method="setTemplate"> <template>catalog/product/view/vxs-view.phtml</template></action>
</reference>
However this only works if that product is in a certain category. Is there a way I can add the pay layout to the template files in the design tab?
I've been adding this code to the front end system/custom design/ custom layout update box
Sorry I'm need to magento and still learning.
Thanks for any help
you are placing wrong reference type. Please try below code.
<module_page_action> <!- Enter your modulename_pagename_action e.g. catalog_product_info-->
<reference name="root">
<action method="setTemplate"> <template>catalog/product/view/vxs-view.phtml</template></action>
</reference>
<module_page_action>
Hope this will work for you!
Cheers!