G
G
Gennady2020-04-26 11:29:48
opencart
Gennady, 2020-04-26 11:29:48

OpenCart page checker is it a product?

Tell me, is there any way / method to check if the current page is a product in header.tpl, footer.tpl? For example: `if (is_product) { // do something }`

if (isset($this->request->get['product_id'])) {
                    echo 111;
                }


This story doesn't work...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lazuren, 2020-04-26
@theblackpost

But such a story works even with the included CNC
Controllercatalog/controller/common/header.php

if (isset($this->request->get['product_id'])){
            $data['is_product_page'] =  'Страница продукта с ID - ' . $this->request->get['product_id'];
        }

View
catalog/view/theme/default/template/common/header.(twig/tpl)

Output by key - is_product_page

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question