Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add variable into controller/header.php

Tags:

php

opencart

I have this site and I want to put some in header for SEO purposes. The H1 must contain manufacturer name (brand) and product code (model).

So the problem is that I'm not sure how to put this variables in controller's file so I could call them in template file next.

Any ideas? :)

like image 680
Aaviya Avatar asked Sep 22 '26 04:09

Aaviya


1 Answers

The best way around this would be to edit the product controller

catalog/controller/product/product.php

and change the heading there. It's set with

$this->document->setTitle($product_info['name']);

so you just need to prepend/append the manufacturer name there, such as

$this->document->setTitle($product_info['name'] . ' ' . $product_info['manufacturer']);
like image 120
Jay Gilford Avatar answered Sep 23 '26 17:09

Jay Gilford



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!