替换 Magento 中的 getHomeLink

发布于 2024-12-06 07:05:11 字数 2353 浏览 0 评论 0原文

我可以将下面复制的 header.phtml 文件中的代码 getHomeLink() ?> 替换为 http://ourdomainname.com >?

由于我们的 magento 商店是通过网站内的导航链接的,因此我们希望在标题中使用指向主域的链接,而不是使用商店域名。

感谢您的帮助。

<div class="header-top"> 
<a href="<?php echo $this->getHomeLink() ?>"><img src="<?php echo $this->getSkinUrl($this->__('images/logo.gif')) ?>” alt="<?php echo $this->__('Magento Logo') ?>” class="logo"/></a> 
<div class="header-right"> 
<p class="super"> 
<?php echo $this->__("Logged in as %s", $this->getUser()->getUsername()) ?><span class="separator">|</span><?php echo $this->formatDate(null, 'full') ?><span class="separator">|</span><a href="<?php echo $this->getLogoutLink() ?>” class="link-logout"><?php echo $this->__('Log Out') ?></a> 
</p> 
<?php if ( Mage::getSingleton('admin/session')->isAllowed('admin/global_search') ): ?> 
<fieldset> 
<legend>Search</legend> 
<span id="global_search_indicator" class="autocomplete-indicator" style="display: none"> 
<img src="<?php echo $this->getSkinUrl('images/ajax-loader.gif') ?>” alt="<?php echo $this->__('Loading...') ?>” class="v-middle"/> 
</span> 
<?php $defSearch = $this->__('Global Record Search') ?> 
<input id="global_search" name="query" type="text" class="input-text" value="<?php if(!empty($query)): ?><?php echo $query ?><?php else: ?><?php echo $defSearch ?><?php endif ?>” onfocus="if(this.value==’<?php echo $defSearch ?>’)this.value=’’; “ onblur="if(this.value==’’)this.value=’<?php echo $defSearch ?>’;” /> 
<div id="global_search_autocomplete" class="autocomplete"></div> 
<script type="text/javascript\"> 
new Ajax.Autocompleter( 
‘global_search’, 
‘global_search_autocomplete’, 
‘<?php echo $this->getUrl('*/index/globalSearch') ?>’, 
{ 
paramName:"query", 
minChars:2, 
indicator:"global_search_indicator", 
updateElement:getSelectionId, 
evalJSON:’force’ 
} 
); 
function getSelectionId(li) { 
location.href = li.getAttribute(’url’); 
} 
</script> 
</fieldset> 
<?php endif; ?> 
</div> 
</div>

Can I just replace code <?php echo $this->getHomeLink() ?> in the header.phtml file copied below with http://ourdomainname.com?

Since our magento store is linked through navigation within our site, we want to use a link to our main domain in the header INSTEAD of using the store domain name.

Thanks for your help.

<div class="header-top"> 
<a href="<?php echo $this->getHomeLink() ?>"><img src="<?php echo $this->getSkinUrl($this->__('images/logo.gif')) ?>” alt="<?php echo $this->__('Magento Logo') ?>” class="logo"/></a> 
<div class="header-right"> 
<p class="super"> 
<?php echo $this->__("Logged in as %s", $this->getUser()->getUsername()) ?><span class="separator">|</span><?php echo $this->formatDate(null, 'full') ?><span class="separator">|</span><a href="<?php echo $this->getLogoutLink() ?>” class="link-logout"><?php echo $this->__('Log Out') ?></a> 
</p> 
<?php if ( Mage::getSingleton('admin/session')->isAllowed('admin/global_search') ): ?> 
<fieldset> 
<legend>Search</legend> 
<span id="global_search_indicator" class="autocomplete-indicator" style="display: none"> 
<img src="<?php echo $this->getSkinUrl('images/ajax-loader.gif') ?>” alt="<?php echo $this->__('Loading...') ?>” class="v-middle"/> 
</span> 
<?php $defSearch = $this->__('Global Record Search') ?> 
<input id="global_search" name="query" type="text" class="input-text" value="<?php if(!empty($query)): ?><?php echo $query ?><?php else: ?><?php echo $defSearch ?><?php endif ?>” onfocus="if(this.value==’<?php echo $defSearch ?>’)this.value=’’; “ onblur="if(this.value==’’)this.value=’<?php echo $defSearch ?>’;” /> 
<div id="global_search_autocomplete" class="autocomplete"></div> 
<script type="text/javascript\"> 
new Ajax.Autocompleter( 
‘global_search’, 
‘global_search_autocomplete’, 
‘<?php echo $this->getUrl('*/index/globalSearch') ?>’, 
{ 
paramName:"query", 
minChars:2, 
indicator:"global_search_indicator", 
updateElement:getSelectionId, 
evalJSON:’force’ 
} 
); 
function getSelectionId(li) { 
location.href = li.getAttribute(’url’); 
} 
</script> 
</fieldset> 
<?php endif; ?> 
</div> 
</div>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧情别恋 2024-12-13 07:05:11

当然可以。你可以任何你想做的事,你只需要承担你采取的任何行动的后果。

Of course you can. You can do whatever you want, you just need to live with the consequences of whatever action you take.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文