Business Catalyst: Display Product Dimensions in Online Shop Layouts

87 views Asked by At

When setting up a product in Business Catalyst, there is a Product Dimensions section in which one can enter the following information:

  • Product Weight in Grams
  • Product Width in MM:
  • Product Height in MM:
  • Product Depth in MM:

The BC docs on Online Shop Layouts don't include any reference to {tag_dimensions} or similar and I have been unable to find any information online.

Is it possible to output the Product Dimensions in BC's Online Shop?

1

There are 1 answers

2
Luke On BEST ANSWER

Yes! This is possible using {module_data}!

The following, inserted into either the Small Product Layout or Large Product Layout will use the ID of the product in question and output the product dimensions of that product as JSON data.

{module_data resource="products" version="v3" fields="productVolume,productHeight,productDepth" skip="0" limit="10" where="\{'catalogs.productId':'{{id}}'\}" order="id" collection="myData"}

From there the JSON data can be used to display the product dimenions, for example:

    {% for item in myData.items -%}

        <table>
            <tbody>
                <tr>
                    <th>Width</th>
                    <th>Height</th>
                    <th>Depth</th>
                </tr>
                <tr>
                    <td>{{item.productVolume}}</td>
                    <td>{{item.productHeight}}</td>
                    <td>{{item.productDepth}}</td>
            </tbody>
        </table>

    {% endfor -%}