Add product dimensions to product description and additional info of detail pages.
- 0.3.0
- 7.1
- Not Applicable
-
Squarespace plan that supports JavaScript.
-
Install twcsl. After you install twcsl be sure to continue on with the rest of the steps.
-
Add code from file store page detail product dimensions.html to Store Settings > Advanced > Page Header Code Injection for the store page. Please see per-page code injection. Read the code for any instructions within. There are some caveats to using this effect.
-
Add [twc-spdpd] to the product description and/or text blocks in additional info. [twc-spdpd] will be replaced with the product dimensions. You can use [twc-spdpd] in multiple places.
This effect only considers the first variants dimensions. In other words it doesn't work with products that have more than one variant.
The dimensions entered in the squarespace editor are shipping dimensions, not product dimensions. If you don't need to use shipping dimensions for shipping you can use it for product dimensions. If you need product dimensions as well as shipping then add the following to a code block in Additional Info.
<script type="application/vnd.twc.spdpd">
{
"dimensions" : {
"length" : 1,
"width" : 2,
"height" : 3,
"weight" : 4
}
}
</script>
You can see a demo of this effect here.
Please consider making a donation.
-
2024-09-07
- support being able to use shipping dimension for shipping and product dimensions
- add weight to format
- remove trigger text from meta description and script[type="application/ld+json"] elements
- use TreeWalker in search for trigger text and replace
- bumped version to 0.3.0
-
2024-08-21
- fix for text blocks being hidden on category pages ( all and etc. )
- bumped version to 0.2.2
-
2024-08-19
- fix for text blocks being hidden in footer
- bumped version to 0.2.1
-
2024-08-16
- control decimal places in format instead of a single setting
- use site measurement standard setting for conversions
- bumped version to 0.2.0
-
2022-05-12
- initial version