snippets
Product Meta Data
The following snippet, when included on a Product page or within a Product loop, will set Liquid variables for rendering or performing logic on:
{% include 'tsio-workshop-data-product', wsProduct: product %}Variables set up:
wsPhasestring where possible values arecrowd-sourced,pre-order,in-production,retailwsActiveboolean; true when Product phase iscrowd-sourcedorpre-orderwsStartsdate; of Workshop Project startwsEndsdate; of Workshop Project endwsTargetnumber; representing sales targetwsSalesnumber; representing current saleswsProgressnumber; percentage (without%) of wsSales/wsTargetwsShipDatesarray; of (max 3) potential ship dates
Hiding Workshop Projects From "Regular" Collections
Within a Collection loop, the logic below hides the product-grid-item include for all Workshop Projects until their phase is marked as "retail":
{% assign wsProductHide = false %}
{% include 'tsio-workshop-data-product', wsProduct: product %}
{% if wsPhase and wsPhase != 'retail' %}
{% assign wsProductHide = true %}
{% endif -%}
{% unless wsProductHide %}
{% include 'product-grid-item' %}
{% endunless %}Last updated