我正在使用Opencart 2.2
在我的商店的登录页面上,我必须显示多个类别的特色产品,所以我创建了4个特色扩展,分配产品,启用它们,将它们放在我的页面表单设计->布局->主页上,它工作得很完美。但现在我必须在每个featured.tpl中呈现类别名称。$heading_title变量从language中获取它的值,language始终是单词的特征。
class ControllerExtensionModuleFeatured extends Controller {
public function index($setting) {
$this->load->language('extension/module/featured');
$data['heading_title'] = $this->language->get('heading_title');
我想在视图中显示扩展名,如何在特色控制器或featured.tpl中获取扩展名
有什么帮助吗?
发布于 2018-02-05 00:31:26
所以我做了一些工作,打印了发送给索引函数的$setting,它返回了我的名字,所以我在产品下面添加了featured_name,如下所示
$data['products'][] = array(
'product_id' => $product_info['product_id'],
'thumb' => $image,
'name' => $product_info['name'],
'description' => utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get($this->config->get('config_theme') . '_product_description_length')) . '..',
'price' => $price,
'special' => $special,
'tax' => $tax,
'rating' => $rating,
'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id'])
);
$data['featured_name']=$setting['name'];
我只是在视图中打印了$featured_name
https://stackoverflow.com/questions/48613824
复制