How to add BCPO to a product on your homepage (featured-product.liquid)

Go to Online Store->Actions->Edit Code
Open your featured-product.liquid file in the Sections area.
Paste this code after the place where product is defined.
See attached screenshot for the correct placement.

{% if product != empty %}
<script>
var bcpo_product = {{product | json}};
{% if all_products[product.handle].metafields.bcpo.bcpo_data %}
var bcpo_data = {{all_products[product.handle].metafields.bcpo.bcpo_data}};
{% endif %}
</script>
{% endif %}

Was this article helpful?
Dislike 0

Pin It on Pinterest