OpenCart 在主页上显示类别图片?
我正在使用最新版本的开放购物车。
我想要做的是在每个页面上显示商店类别页面的图像,因为我想将其实现到菜单中。您可以在这里明白我的意思: http://www.tomrawcliffe.com/portfolio/ strings-r-us/
在 cetegory.tpl 文件中我发现:
<?php if ($thumb) { ?>
<div class="image"><img src="<?php echo $thumb; ?>" alt="<?php echo $heading_title; ? >" /></div>
<?php } ?>
但我开始意识到这并不像将其复制并粘贴到 header.tpl 等中那么容易。
我该怎么办!?
I'm using the most up to date version of open cart.
What I'm wanting to do is show the image from the store category page on every page page, as I'm wanting to implement it into the menu. You can see what I mean here: http://www.tomrawcliffe.com/portfolio/strings-r-us/
In the cetegory.tpl file I found:
<?php if ($thumb) { ?>
<div class="image"><img src="<?php echo $thumb; ?>" alt="<?php echo $heading_title; ? >" /></div>
<?php } ?>
But I've come to realise that it's not as easy as copy and pasting this into the header.tpl etc.
What do I do!?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,打开
/catalog/controller/common/header.php
找到此代码
将其更改为
然后在
/catalog/view/theme/[your-theme-name]/template/common /header.tpl
只需在需要的地方使用$category['thumb']
请注意,我在上面的代码中将宽度和高度设置为 100px,您应该更改它酌情
OK, open up
/catalog/controller/common/header.php
Find this code
change it to
Then in
/catalog/view/theme/[your-theme-name]/template/common/header.tpl
simply use$category['thumb']
wherever you need itnote that I've set the width and height to 100px in the above code, and you should change it as appropriate