Answer the question
In order to leave comments, you need to log in
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
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
maybe so?
$url = $_SERVER['REQUEST_URI'] ;
if ($url=="/catalog/phones/iphone/iphone-7/") {
// тут что-то делаем
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question