{% assign body = product.body_html | strip_html | newline_to_br %} {% assign keywords = "Pre-order. Ships" %} b{% assign tags = '' %} {% if body contains keywords %} {% assign lines = body | split: "<br />" %} {% for line in lines %} {% if line contains keywords %} {% assign tokens = line | split: keywords %} {% if tokens.size == 2 %} {% assign inner_tokens = tokens[1] | split: "." %} {% if inner_tokens.size >= 1 %} {% assign value = inner_tokens[0] | replace: "in", "" | escape_once | replace: " ", "" %} {% assign tag = "preorder**" | append:value | replace_first: " ", "" %} {% assign tags = tags | append: tag | append: ',' %} {% endif %} {% endif %} {% endif %} {% endfor %} {% endif %} {{ tags }}
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)