V
V
ventacom2021-06-10 11:41:31
PHP
ventacom, 2021-06-10 11:41:31

How to organize dynamic breadcrumbs in php?

Good afternoon!
Interested in the possibility of implementing dynamic. breadcrumbs for an online store based on the sections/filters from which the user came to the product card. For example, the implementation on the site mvideo.
If you go from the catalog page with the selected filters to the product card, then the breadcrumbs will contain the entire path that the user followed, including links to the filtering pages
60c1cf52d6560084433049.png
Where can I store data about which user visited sections, clicked filters before going to the card? Sessions? How to update all this so that it doesn’t turn out that I collected a session for one product (I went to the section, selected the filter, but didn’t get to the card), and then in another tab I made a direct call to another product from another section, and it reflected session from my old way

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
knutov, 2021-07-27
@knutov

it is possible to store, obviously, in session. In some other question, probably LocalStorage would be a better fit here.
Handle with js code.
You can save the referrer for each page and build a path tree by tracking it, then there will be no problem to show the desired branch when you click further in any open window.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question