This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for product in products %} | |
{% assign collection_handles = product.collections | map: 'handle' %} | |
{% assign variant = product.selected_or_first_available_variant %} | |
<div class="product-{{ product.id }} section clearfix"> | |
<div class="product_section js-product_section" itemscope itemtype="http://schema.org/Product"> | |
<div class="product-images half"> | |
{% include 'product-images', image_width: 'full' %} | |
<div class="banner_holder"> | |
{% if settings.sale_banner_enabled and product.compare_at_price_max > product.price %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const data = require("./data.json"); | |
const clone = ({ children, ...obj }) => obj; | |
const flattenJson = obj => | |
obj | |
.flatMap(el => | |
el.children ? [clone(el), ...flattenJson(el.children)] : [el] | |
) |