O
O
oleg_drozdov2015-11-26 22:47:47
CMS
oleg_drozdov, 2015-11-26 22:47:47

How to make a modal window with a component in Bitrix?

Good day to you. Can you please tell me if it is possible, and if so, how, to make a modal window on the click of a button, in which there will be a component of recommended products? Featured products should therefore be different on each page. Thank you for attention)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey, 2015-11-26
@reaferon

1. Create a new page without including header & footer. Just put at the beginning of the file

require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
then paste the call code of the required component.
2. When calling the modal window, specify this file as the source. For example, bootstrap calls something like this:
3. Basically Eunjoy

A
Alexander, 2015-12-19
Madzhugin @Suntechnic

How are the "differences" of recommended products on different pages connected and are they shown in a modal window?
Andrey already suggested an option, but forgot to add that if the recommended products depend on the product displayed on the page, then the page loaded with the content of the window, you need to transfer some information about what is on the page. Let's say a product id if it's an item's detail page. Those. the call should be in a template and should be something like this:
In addition to this, you can simply throw the window directly on the page in advance in a hidden div, and then show it with a modal window.
In order for the products to be different, you need to send a filter to the component that selects more products than the component will show, and specify RAND as the sorting parameters for both the sorting property and the direction.
You just need to remember that if the second display method and the component are in the cached area, then it will show the same products on the same page for the duration of the cache.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question