简体   繁体   中英

How can I add banner to product page? (magento)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM