OpenCart如果没有可用的特殊优惠,则隐藏特殊优惠标题 [英] OpenCart Hide special offers title if no special offers available

查看:98
本文介绍了OpenCart如果没有可用的特殊优惠,则隐藏特殊优惠标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想对OpenCart进行一个相对简单的修改,以便在没有可用的或没有特别优惠的情况下,不显示标题特别优惠".

I want to make a relatively simple modification to OpenCart so that if there are no Special Offers available, or applicable, that the title Special Offers does not display.

如果没有可用的或不适用的内容,当前它将在彩色背景上显示标题标题,如果没有要显示的特殊优惠,则标题会显得很奇怪.

If none are available or applicable, currently it will display the heading title on a coloured background which looks odd if there are no special offers to show.

我猜想需要对/catalog/controller/module/special.php进行修改,就像这样.

I am guessing the modification needs to be made to /catalog/controller/module/special.php and would be something like.

If special offers > 0 then do this
  else
Don't do anything

但是我不确定如何实现.

But I am not sure how to implement this.

如果有人能提供建议,我将不胜感激.

I'd be grateful if someone could advise.

推荐答案

不完全确定您在此指的是什么,但是最好编辑模板而不是控制器文件并使用

Not entirely sure what you are referring to here, but you would be best editing the template not the controller file and using

<?php if($products) { echo $heading_title; } ?>

代替当前的内容-类似于<?php echo $heading_title; ?>

in place of what is there currently - something like just <?php echo $heading_title; ?>

此外,您可能会发现标题被<h1><h2>标记包围.如果是这样,只需对标签做同样的事情,就像

Also you may find the title is surrounded by <h1> or <h2> tags. If so, just do the same but around the tags, something like

<?php if($products): ?>
<h2><?php echo $heading_title; ?></h2>
<?php endif; ?>

这篇关于OpenCart如果没有可用的特殊优惠,则隐藏特殊优惠标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆