1

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?

Luke
  • 4,825
  • 2
  • 30
  • 37

1 Answers1

2

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 -%}
Luke
  • 4,825
  • 2
  • 30
  • 37
  • Dude, I don't think you are supposed to ask a question and then answer it. – Daut Dec 20 '16 at 10:29
  • Actually, not only is it totally legit, it's encouraged: http://stackoverflow.com/help/self-answer. Makes sense when you think about it - I even use it as a sort of documenting technique so I can come back and reference solutions to problems I've solved in the past. – Luke Dec 20 '16 at 10:49