Is there a way to reuse HTML code in the Product Description section?

11 0 2

I will try to keep this short and simple. I know that the description section for the products in Shopify is basically an HTML editor. What I am trying to do here is to use it to display the following info:

✔ In Stock.
✔ FREE Shipping to the United States.
✔ Ships in 5 days. Delivered in 2-3 weeks.
✔ Discount valid only for next 11 hours & 32 minutes.

and I am using plain HTML to edit/modify the description and JavaScript to make the countdown timer run. Here's the HTML for the section above:

    <strong class="descriptionbody"><span>✔ </span><span id="instocktag">In Stock.</span></strong><br />
    <strong class="descriptionbody"><span>✔ </span><span class="descriptionhighlighter">FREE Shipping </span>to United States.</strong><br />
    <strong class="descriptionbody"><span>✔ </span>Ships in 5 days. Delivered in <span class="descriptionhighlighter">2-3 weeks</span>.</strong><br />
    <strong class="descriptionbody"><span>✔ </span><span >Discount valid <span class="descriptionhighlighter">only</span> for next </span><span id="customdescountdown" class="greenhighlighter">...loading...</span></strong>

 Now, I have to copy and paste this HTML to each of the product's description sections to display it on every product. The problem is, if I decide to make any changes to the HTML in near future, then I would have to go to each product's description and make the changes to the HTML. 

So, to overcome this, I wanted to know if there exist a way that I can write this HTML to a file, save it onto Shopify somewhere, and in the description section of every product, just reference it to the HTML file so that if I do decide to make the changes, then I just have to make the changes to the HTML file and the changes would then reflect to every product description?

Reply 1 (1)
New Member
1 0 0

Hey did you ever found a solution to this? running into it now. Thanks!!