K
K
KASich2020-05-12 11:54:22
1C-Bitrix
KASich, 2020-05-12 11:54:22

How to include a link to another product in the detailed description of a product?

The detailed description of the product mentions other products, you want to link to them. But over time, links to all products change (either the section where the product is located changes, or the symbolic code of the product has changed). Therefore, in the detailed description, I would like to indicate some kind of template with the product id, and the link was formed independently based on this Id. Are there such solutions?

The most primitive option is to create a template in the description, for example #ELEMENT_ID_55481#. And when displaying the product, replace it with str_replace.
But this is not very suitable when there are 50-100 such links. And perhaps those who read this topic will need 1000 links to make such links.
Perhaps you can parse the id from this template and use it to display a link to the product. But this task is difficult for me to cope with. Perhaps there are already solutions.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IvanMogilev, 2020-05-12
@IvanMogilev

You can use the element binding property, as a result you will have the id of the products selected in the admin panel, and using the id get the DETAIL_PAGE_URL, for example, CIBlockElement::GetByID

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question