缩略图类别中的Magento自定义主题
我正在使用1.9.2.0版本的Magento自定义主题,它运行平稳,我想要的是主类别的名称,而不是类别名称。我已经在这里测试了一些技巧,以及网上的一些教程。但我做不到,能不能指引我哪里出了问题 1.1。我有一段代码,在主页上显示类别和子类别:file top.phtml缩略图类别中的Magento自定义主题,magento,Magento,我正在使用1.9.2.0版本的Magento自定义主题,它运行平稳,我想要的是主类别的名称,而不是类别名称。我已经在这里测试了一些技巧,以及网上的一些教程。但我做不到,能不能指引我哪里出了问题 1.1。我有一段代码,在主页上显示类别和子类别:file top.phtml <?php Mage::helper('custommenu')->saveCurrentCategoryIdToSession(); $menuData = Mage::helper('cust
<?php
Mage::helper('custommenu')->saveCurrentCategoryIdToSession();
$menuData = Mage::helper('custommenu')->getMenuData();
extract($menuData);
// ---
$txtLoading = '';
$txtMenu = $this->__('Menu');
$xRtl = $_rtl ? ' rtl' : '';
$wpInitContent = <<<HTML
<div id="custommenu-loading" class="$xRtl">
<div class="menu">
<div class="parentMenu menu0">
<a href="javascript:;">
<span>$txtLoading</span>
</a>
</div>
</div>
<div class="clearBoth"></div>
</div>
<div id="custommenu" class="$xRtl" style="display:none;">
<div class="menu">
<div class="parentMenu menu0">
<a href="javascript:;">
<span>$txtLoading</span>
</a>
</div>
</div>
<div class="clearBoth"></div>
</div>
<div id="custommenu-mobile" class="$xRtl" style="display:none;">
<div id="menu-button" onclick="wpMenuButtonToggle()">
<a href="javascript:void(0);">
<span>$txtMenu</span>
</a>
</div>
<div id="menu-content" style="display:none;">
<div id="menu-mobile-loading" class="menu-mobile level0">
<div class="parentMenu">
<a href="javascript:;">
<span>$txtLoading</span>
</a>
</div>
</div>
<div class="clearBoth"></div>
</div>
</div>
HTML;
?>
<div class="nav-container" id="wp-nav-container"></div>
<script type="text/javascript">
//<![CDATA[
var CUSTOMMENU_POPUP_WIDTH = <?php echo $_popupWidth; ?>;
var CUSTOMMENU_POPUP_TOP_OFFSET = <?php echo $_popupTopOffset; ?>;
var CUSTOMMENU_POPUP_DELAY_BEFORE_DISPLAYING = <?php echo $_popupDelayBeforeDisplaying; ?>;
var CUSTOMMENU_POPUP_DELAY_BEFORE_HIDING = <?php echo $_popupDelayBeforeHiding; ?>;
var CUSTOMMENU_RTL_MODE = <?php echo $_rtl; ?>;
var CUSTOMMENU_MOBILE_MENU_WIDTH_INIT = <?php echo $_mobileMenuWidthInit; ?>;
var wpCustommenuTimerShow = {};
var wpCustommenuTimerHide = {};
var wpActiveMenu = null;
var wpMobileMenuEnabled = <?php echo $_mobileMenuEnabled; ?>;
var wpMenuAjaxUrl = '<?php echo $_menuAjaxUrl; ?>';
var wpMoblieMenuAjaxUrl = '<?php echo $_moblieMenuAjaxUrl; ?>';
var wpPopupMenuContent = '';
var wpMobileMenuContent = '';
if ($('wp-nav-container') != undefined) {
$('wp-nav-container').update(<?php echo Mage::helper('core')->jsonEncode($wpInitContent); ?>);
}
<?php if (Mage::getStoreConfig('custom_menu/general/ajax_load_content')) : ?>
wpCustomMenuMobileToggle();
Event.observe(window, 'resize', function() {
wpCustomMenuMobileToggle();
});
<?php endif; ?>
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
Event.observe(document, 'dom:loaded', function(){
$$('.skip-nav').each(function(element) {
element.observe('click', function(event) {
wpMenuButtonToggle();
});
});
});
//]]>
</script>
//;
var CUSTOMMENU_POPUP_TOP_OFFSET=;
var CUSTOMMENU_POPUP_DELAY_BEFORE_display=;
var CUSTOMMENU_POPUP_DELAY_BEFORE_hidden=;
var CUSTOMMENU_RTL_MODE=;
var CUSTOMMENU_MOBILE_MENU_WIDTH_INIT=;
var wpcustomenutimershow={};
var wpcustomenutimerhide={};
var wpActiveMenu=null;
var wpmobilementuenabled=;
var wpMenuAjaxUrl='';
var wpMoblieMenuAjaxUrl='';
var wppopmenucontent='';
var wpmobilementucontent='';
如果($('wp-nav-container')!=未定义){
$('wp-nav-container')。更新();
}
wpCustomMenuMobileToggle();
观察(窗口“调整大小”,函数(){
wpCustomMenuMobileToggle();
});
//]]>
//
**ThumbnailUrl
$child=Mage::getSingleton('catalog/layer')->getCurrentCategory()->getId();
$imageSrc=Mage::getModel('catalog/category')->load($child)->getThumbnail();
$ThumbnailUrl=Mage::getBaseUrl('media')。'catalog/category/'。$imageSrc;
回声“;
** ThumbnailUrl
$child=Mage::getSingleton('catalog/layer')->getCurrentCategory()->getId();
$imageSrc=Mage::getModel('catalog/category')->load($child)->getThumbnail();
$ThumbnailUrl=Mage::getBaseUrl('media').'catalog/category/'.$imageSrc;
echo "<img src='{$ThumbnailUrl}' />";