mfadel
mfadel

Reputation: 897

Showing data from controller in twig file Opencart 3.0.2.0

I have added this line to catalog/controller/product/category.php

$data['string1'] = "string 1";

before

$this->response->setOutput($this->load->view('product/category', $data));

and in catalog/view/theme/journal2/template/product/category.twig replaced

 <h4 class="name"><a href="{{ product.href }}">{{ product.name }} </a></h4> 

with this line

<h4 class="name"><a href="{{ product.href }}">{{ product.name }}  {{  string1 }} </a></h4>

but it shows nothing, what did I miss?

Thanks in advance.

Upvotes: 0

Views: 1636

Answers (1)

mfadel
mfadel

Reputation: 897

I have solved it, I forgot to refresh modification. That was the problem. Extension -> Modification -> refresh.

Upvotes: 1

Related Questions