1

using languages.phtml code we are displaying different stores result as below :

enter image description here

we are trying to add languages.phtml file result after 3 icons in header here.

enter image description here

but when i placed below code , its not working

    <?php echo $this->getLayout()->createBlock('page/html')->setTemplate('page
/switch/languages.phtml')->tohtml(); ?>

file is present in app/design/frontend/rwd/theme/template/page/switch/languages.phtml

header.phtml

    <div id="header">
<header id="header" class="page-header">
    <div class="page-header-container">
        <a class="logo" href="<?php echo $this->getUrl('') ?>">
            <img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" class="large" />
            <img src="<?php echo $this->getLogoSrcSmall() ?>" alt="<?php echo $this->getLogoAlt() ?>" class="small" />
        </a>

        <div id='hideshow'><img src="<?php echo $this->getSkinUrl('images/search_16.png');?>" alt="Search">


        </div>



        <?php echo $this->getLayout()->createBlock('page/html')->setTemplate('page/switch/languages.phtml')->tohtml(); ?>

        <?php // In order for the language switcher to display next to logo on smaller viewports, it will be moved here.
              // See app.js for details ?>
        <div class="store-language-container"></div>

        <!-- Skip Links -->

        <div class="skip-links">
            <a href="#header-nav" class="skip-link skip-nav">
                <span class="icon"></span>
                <span class="label"><?php echo $this->__('Menu'); ?></span>
            </a>

            <a href="#header-search" class="skip-link skip-search" id="hideshow1">
                <span class="icon"></span>
                <span class="label"><?php echo $this->__('Search'); ?></span>
            </a>

            <div class="account-cart-wrapper">
                <a href="<?php echo $this->helper('customer')->getAccountUrl(); ?>" data-target-element="#header-account" class="skip-link skip-account">
                    <span class="icon"></span>
                    <!-- <span class="label"><?php echo $this->__('Account'); ?></span> -->
                </a>


                <!-- Cart -->

                <div class="header-minicart">
                    <?php echo $this->getChildHtml('minicart_head'); ?>
                </div>

            </div>


        </div>

        <!-- Navigation -->

        <div id="header-nav" class="skip-content">
            <?php echo $this->getChildHtml('topMenu') ?>
        </div>

        <!-- Search -->

        <div id="header-search" class="skip-content desktop-only">
            <?php echo $this->getChildHtml('topSearch') ?>
        </div>

        <!-- Account -->

        <div id="header-account" class="skip-content">
            <?php echo $this->getChildHtml('topLinks') ?>
        </div>
    </div>



    <!--<div id="header-search" class="desktop-only">
            <?php echo $this->getChildHtml('topSearch') ?>
        </div>-->
</header>


<?php echo $this->getChildHtml('topContainer'); ?>
</div>

1 Answer 1

1

Try this :

<?php echo $this->getLayout()->createBlock('page/switch')->setTemplate('page
/switch/languages.phtml')->tohtml(); ?>

Note: Changed Block type to page/switch

Also try: <?php echo $this->getChildHtml('store_language') ?> in header.phtml

2
  • same result after i used : <?php echo $this->getChildHtml('store_language') ?> please check code and help me. Commented Jun 1, 2016 at 13:08
  • your link is not working Commented Jun 2, 2016 at 6:53

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.