Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to add script in header.phtml?? 
 
messned
Jr. Member
 
Total Posts:  4
Joined:  2010-07-29
 

Hi,

First of all im from holland so my english is not that good.

I try to explain my problem:
Recently i have bought a extension so i have googletranslate on my webshop.
Now i installed it and all is done correctly only my seller wont help me out to get it working in my custom theme.
He only today have told me to do this:

Hello,

Our Tech Support just told me to add this code in your theme’s header.phtml (app/design/frontend/default/yourtheme/template/page/html):

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

It must be anywhere inside <div class=”header”> container.

Regards,

VJ Templates

Now i want to know where i need to add this code in my header.phtml so it will be displayed correctly before my currency dropdown menu.
Here is my header.phtml file:
[quote<div class="top container">
<div class="shopLinks">
<div class="row">
<div class="span4">
<div class="lan-cur"><?php echo $this->getChildHtml('store_language') ?><?php echo $this->getChildHtml('store_currency_selector') ?></div></div>
<div class="span8"> <?php echo $this->getChildHtml('topLinks') ?> </div>
<?php /*?><p class="welcome-msg"><?php echo $this->getWelcome() ?><?php echo $this->getAdditionalHtml() ?></p><?php */?>
</div>
</div>
<div class="header-container">
<div class="header">
<div class="row">
<?php if ($this->getIsHomePage()):?>
<div class="span4">
<div class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>” title="<?php echo $this->getLogoAlt() ?>"><img src="<?php echo $this->getLogoSrc() ?>” alt="<?php echo $this->getLogoAlt() ?>” /></a></div>
</div>
<?php else:?>
<div class="span4">
<div class="logo"><a href="<?php echo $this->getUrl('') ?>” title="<?php echo $this->getLogoAlt() ?>"><strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>” alt="<?php echo $this->getLogoAlt() ?>” /></a></div>
</div>
<?php endif?>
<div class="span8">
<div class="shop-info">
<div class="shoppingCart"><?php echo $this->getChildHtml('topcart'); ?></div>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('top_info')->toHtml(); ?>
</div>
<div class="user-search">
<?php echo $this->getChildHtml('topContainer'); ?> <?php echo $this->getChildHtml('topSearch') ?>
<div class="welcome-to"><?php echo $this->getWelcome() ?></div>
</div>
</div>
</div>
</div>
<?php echo $this->getChildHtml('topMenu') ?> </div>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('social')->toHtml(); ?> </div>
]

Please let me know how to do this thanks in advice!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Magikvishal
Sr. Member
 
Total Posts:  278
Joined:  2012-06-12
 

Hello check below code

<div class="top container">
<
div class="shopLinks">
<
div class="row">
<
div class="span4">
<
div class="lan-cur"><?php echo $this->getChildHtml('store_language'?><?php echo $this->getChildHtml('store_currency_selector'?></div></div>
<
div class="span8"<?php echo $this->getChildHtml('topLinks'?> </div>
<?php /*?><p class="welcome-msg"><?php echo $this->getWelcome() ?><?php echo $this->getAdditionalHtml() ?></p><?php */?>
</div>
</
div>
<
div class="header-container">
<
div class="header">
<?php echo $this->getChildHtml('googletranslate'?> // [b]your code added here[/b]
<div class="row">
<?php if ($this->getIsHomePage()):?>
<div class="span4">
<
div class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>” title="<?php echo $this->getLogoAlt() ?>"><img src="<?php echo $this->getLogoSrc() ?>” alt="<?php echo $this->getLogoAlt() ?>” /></a></div>
</div>
<?php else:?>
<div class="
span4">
<div class="
logo"><a href="<?php echo $this->getUrl(''?>” title="<?php echo $this->getLogoAlt() ?>"><strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>” alt="<?php echo $this->getLogoAlt() ?>” /></a></div>
</
div>
<?php endif?>
<div class="span8">
<
div class="shop-info">
<
div class="shoppingCart"><?php echo $this->getChildHtml('topcart'); ?></div>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('top_info')->toHtml(); ?>
</div>
<
div class="user-search">
<?php echo $this->getChildHtml('topContainer'); ?> <?php echo $this->getChildHtml('topSearch'?>
<div class="welcome-to"><?php echo $this->getWelcome() ?></div>
</
div>
</
div>
</
div>
</
div>
<?php echo $this->getChildHtml('topMenu'?> </div>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('social')->toHtml(); ?> </div>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top