0

I want to display my below image on product page left side,

https://i.stack.imgur.com/OEZDN.jpg

I just added directly into 2columns-left.phtml,

<div class="col-left sidebar col-xs-12 col-sm-3">

                                    <?php echo $this->getChildHtml('left') ?><br/>
                                    <?php echo $this->getLayout()->createBlock('cms/block')
                                          ->setBlockId('free_shipping_banner_pdp')->toHtml();?> 
                                </div>

Is my work recommend?

6
  • instead use catalog_product_view.xml and override view.phtml in your module or theme. Than it is right Dec 20, 2019 at 6:56
  • @PadhiyarGaurang after added lines on catalog_product_view.xml, then what i need to do in view.phtml.
    – zus
    Dec 20, 2019 at 7:05
  • <?php echo $this->getChildHtml('free_shipping_banner_pdp'); ?> Dec 20, 2019 at 7:34
  • Please check full answer below Dec 20, 2019 at 7:38
  • @PadhiyarGaurang may i know path of the catalog_product_view.xml
    – zus
    Dec 20, 2019 at 7:51

1 Answer 1

0

Full answer, this is the correct way.

Path : app\design\frontend\rwd\default\layout\catalog.xml

catalog.xml

<block type="cms/block" name="your_block_id_1_name" before="-">
        <action method="setBlockId">
            <block_id>your_block_id_1</block_id>
        </action>
    </block>

Path : app\design\frontend\rwd\default\template\catalog\product\view.phtml

view.phtml

<?php echo $this->getChildHtml('free_shipping_banner_pdp'); ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.