A
A
Andrey Eskov2017-05-22 14:36:32
1C-Bitrix
Andrey Eskov, 2017-05-22 14:36:32

How to add your own tabs to a product in 1C-Bitrix: Site Manager 17.0.5?

Good afternoon. Tell. I decided to add my tab in the product card. But there is a problem, it is added there but breaks all the others. It looks like this.
Here is the list of tabs, where the last one is added

<ul class="product-item-detail-tabs-list">
                <?php if ($showDescription):?>
                  <li class="product-item-detail-tab active" data-entity="tab" data-value="description">
                    <a href="javascript:void(0);" class="product-item-detail-tab-link">
                      <span><?=$arParams['MESS_DESCRIPTION_TAB']?></span>
                    </a>
                  </li>
                                <?php endif;?>

                                <?php if (!empty($arResult['DISPLAY_PROPERTIES']) || $arResult['SHOW_OFFERS_PROPS']):?>
                  <li class="product-item-detail-tab" data-entity="tab" data-value="properties">
                    <a href="javascript:void(0);" class="product-item-detail-tab-link">
                      <span><?=$arParams['MESS_PROPERTIES_TAB']?></span>
                    </a>
                  </li>
                                <?php endif;?>

                                <?php if ($arParams['USE_COMMENTS'] === 'Y'):?>
                  <li class="product-item-detail-tab" data-entity="tab" data-value="comments">
                    <a href="javascript:void(0);" class="product-item-detail-tab-link">
                      <span><?=$arParams['MESS_COMMENTS_TAB']?></span>
                    </a>
                  </li>
                                <?php endif;?>

                <?php if(!empty($arResult['PROPERTIES']['ALL_VIDEO']['VALUE'])):?>
                                    <li class="product-item-detail-tab" data-entity="tab" data-value="video">
                                        <a href="javascript:void(0);" class="product-item-detail-tab-link">
                                            <span>Видео</span>
                                        </a>
                                    </li>
                                <?php endif; ?>
              </ul>

Well, the block itself also registered and gave it the same data-value
<div class="row" id="<?=$itemIds['TAB_CONTAINERS_ID']?>">
    <div class="col-xs-12">
                        //Тут стандартные блоки

                        <?php if(!empty($arResult['PROPERTIES']['ALL_VIDEO']['VALUE'])):?>
                            <div class="product-item-detail-tab-content" data-entity="tab-container" data-value="video">
                                мой блок
                            </div>
                        <?php endif; ?>
</div>
</div>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bx-coder, 2017-05-22
@taurus2790

Block:

<?php if(!empty($arResult['PROPERTIES']['ALL_VIDEO']['VALUE'])):?>
     <li class="product-item-detail-tab" data-entity="tab" data-value="video">
           <a href="javascript:void(0);" class="product-item-detail-tab-link">
                  <span>Видео</span>
           </a>
     </li>
<?php endif; ?>

needs to be re-duplicated below. See the code below. Focus on the comments in the code:
There is a similar construction. Duplicate there and should earn.

A
Andrey Eskov, 2017-05-22
@taurus2790

Thank you bx-coder ! I forgot that these menus on the site 2 are one when scrolling.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question