N
N
Nikolay S.2019-12-27 14:49:52
1C-Bitrix
Nikolay S., 2019-12-27 14:49:52

How to display additional images on the product detail page from a property in the regular (.default) catalog.element component?

added

if( $arResult['MORE_PHOTO_COUNT'] = sizeof( $arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"] ) ) {
  $showSliderControls = true;
  foreach($arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"] as $FILE_ID) {
    if( is_array($FILE = CFile::GetFileArray($FILE_ID)) ) {
      array_push($actualItem["MORE_PHOTO"], $FILE);
    }
  }
}

immediately after the definition of $actualItem, everything is displayed, but the slider does not scroll. Maybe I went the wrong way?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikolay S., 2019-12-27
@Nikolays93

My Crutch Recipe:
After

else
{
  $actualItem = $arResult;
  $showSliderControls = $arResult['MORE_PHOTO_COUNT'] > 1;
}

add
if( $arResult['MORE_PHOTO_COUNT'] = sizeof( $arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"] ) ) {
  $showSliderControls = true;
  foreach($arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"] as $FILE_ID) {
    if( is_array($FILE = CFile::GetFileArray($FILE_ID)) ) {
      array_push($actualItem["MORE_PHOTO"], $FILE);
    }
  }

  $arResult['MORE_PHOTO'] = $actualItem["MORE_PHOTO"];
  $arResult['MORE_PHOTO_COUNT'] = sizeof( $arResult['MORE_PHOTO'] );
}

Where
MORE_PHOTO ( $arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"] )
Property code with pictures.

A
Andrey Ryazantsev, 2019-12-29
@fo_otman

Is the problem on the server side? If the slider does not scroll, you need to look in the browser console. Perhaps there are some JS errors.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question