D
D
Dmax992021-09-18 21:19:43
opencart
Dmax99, 2021-09-18 21:19:43

Where to paste the code to apply it throughout the site?

Hello! I found on the Internet how to hide breadcrumbs in the product card in the mobile version.

There he is:

if(preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"])){
           unset($data['breadcrumbs']);
}

And I thought that, instead of hiding, through else, you can show messages on the mobile version and other messages on the PC.
Everything worked out, I inserted this code into the "product" controller and everything worked out, but where to insert it to show in the right places without adding it to each controller. Or is it not possible?
In fact, I need to display messages in mobile in the product card, categories and on the main page.

But the knowledge was only enough for the goods, and then, according to someone else's method ...
Please help me solve the problem

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
opencartbot, 2021-09-19
@opencartbot

If you need to add something on all pages, then work in the controller:
common/header
or
common/footer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question