PeteA wrote: ↑Tue Sep 09, 2014 3:22 pm
Just an update that I've managed to solve this although I'm happy for somebody to suggest a better solution
End result has been to create a vQmod that adds some code within /system/engine/controller.php as the very first call of the render() method. This queries if $this->data['breadcrumbs'] exists and if so then passed that data to $this->document that has been extended to handle the LD+JSON components.
Hi,
If you still have an interest, maybe my pull request might help you:
https://github.com/opencart/opencart/pull/7398
Initially I created the breadcrumb class to be used in administration, but I will extend it to the catalog as well, when I have a free time
You can use the logic behind this class for your project:
Create an event before in the header class and then pass the variable route and data. Then create a controller file wherever you want (I suggest in the common folder). In this file you can capture the route and add to the breadcrumbs array. Add the LD + JSON information you need.
Finally, you render in the twig file. That way you do not need Vqmod / Ocmod and it does not change the original OC files.