SwissUpLabs Logo

Display activity and material blocks on product page

Activity and material blocks can be added to the product page with Inline php code, Layout update xml or Cms widget interface. Follow the description mentioned below to learn how to use each of the proposed ways.

Table of Contents


activity and material blocks on product page

Inline php code

You can add the code mentioned below to any template, that is shown on product page.

Look at list of available attributepages/product helper methods

    echo $this->helper('Swissup\Attributepages\Helper\Product')
            'activity'  => 'View All',
            'material' => 'View All'
            'activity'  => true,
            'material' => false
            'activity'  => true,
            'material' => true
        ->setSize(38, 17)

Layout update xml

Look at list of available product_option block methods

<referenceContainer name="">
    <block class="Swissup\Attributepages\Block\Product\Option" template="Swissup_Attributepages::product/options.phtml" name="attributepage_activity_material">
            <argument name="attributeCode" xsi:type="string">activity,material</argument>
            <argument name="useImage" xsi:type="boolean">true</argument>
            <argument name="imageType" xsi:type="string">thumbnail</argument>
            <argument name="width" xsi:type="number">45</argument>
            <argument name="height" xsi:type="number">15</argument>
            <argument name="useLink" xsi:type="boolean">true</argument>
            <argument name="cssClass" xsi:type="string">hidden-label</argument>

Cms widget interface

Widget popup

You can add this widget to the product page at Content > Elements > Widgets page with following layout update instructions:

Layout update instructions

Edit this Page