A
A
Alexer052019-08-21 07:47:22
1C-Bitrix
Alexer05, 2019-08-21 07:47:22

How to find out in header.php which page of the catalog the user is on, the list of products or the product page?

The site has a nested URL (for example /catalog/phones/iphone/iphone-7/). How to find out in header.php which page of the catalog the user is on, the list of products or the product page?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yaroslav Alexandrov, 2019-08-21
@Alexer05

In my opinion, it is better to do this in the files of the complex component of the catalog.
1) sections.php - catalog main page 2) section.php
- sections
3) element.php - product

J
Jupiter Max, 2019-08-21
@vardoLP

maybe so?

$url = $_SERVER['REQUEST_URI'] ;
if ($url=="/catalog/phones/iphone/iphone-7/") {
// тут что-то делаем
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question