At Shoolu, we take advantage of Custom Fields on products in BigCommerce all the time. Our inventory software runs some rules against the product data and sets various fields as various values we use to enhance the product pages across the site.
The Problem
When the theme templates are processed, the custom fields are passed to the frontend as an array of objects:
{
'product': {
'custom_fields': [
{'name': 'Property', 'value': 'Property Value'},
{'name': 'Property2', 'value': 'Property2 Value'},
]
}
}
Unfortunately, due to whatever technical limitations or "for security purposes" this doesn't work:
{{#if product.custom_fields.Property2}}
... do something
{{/if}}
Why can't they just build custom_fields
as an object with the custom field names as keys? Require the name to be something that works as a JSON key with a max length and build it that way.