N
N
Nadezhda Golovina2020-12-03 12:28:09
1C-Bitrix
Nadezhda Golovina, 2020-12-03 12:28:09

How to display the current section if the product is attached to several categories?

Good afternoon.
There is a catalog here . In it, some of the goods are attached to several categories. Tell me how to make it so that the current category is displayed, depending on where the user is? Those. if it is Combined cabinets, then it should be "Combined" cabinets, not cabinet ones (this is the parent section, it only displays it at the moment)

<div class="description">
                <div class="top">
                    <span class="title"><?=$arItem["NAME"]?></span>
                    <p><?=$arSection['NAME']?></p>
                </div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nadezhda Golovina, 2021-03-20
@Golovina90

Found a solution

<p><?echo $arResult["SECTION"]["PATH"][0]["NAME"]?></p>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question