How to insert own code in Shopify

Topic summary

A user wants to display daily sales as green squares on their Shopify store using custom HTML/CSS/JavaScript code that works in Atom but needs implementation guidance.

Solution provided:

  • Create a new snippet file in Theme Editor → Snippets
  • Paste the custom code into this new snippet
  • Add a custom liquid block through Theme Customizer
  • Reference the snippet using {% render 'SnippetName' %}
  • The custom section can then be added to specific pages

Outcome:
The implementation was successful. The user confirmed the code now works on their Shopify store and expressed appreciation for the step-by-step guidance.

Summarized with AI on November 23. AI used: claude-sonnet-4-5-20250929.

Hi,

I would like to display the amount of sales in a given day using the following code, where every green square is a sale. It works with atom but I am having a hard time implementing it as a section (I suppose that’s what I’m supposed to do) to add some custom HTML/CSS/JS in the shopify store? Is there a simple way to do that and to make it work?

Here is my shopify store : https://portee1629.myshopify.com/admin/themes/138376610069/editor

PW: skeenu

/* style.css */ .contribution-grid { justify-content: center; display: flex; flex-wrap: wrap; margin: 0 auto; width: 80vw; height: 10vh; } .square { width: 10px; height: 10px; margin: 1px; background-color: #eee; }

Thank you in advance!

Hi @Antalya

We checked your site and saw that the simplest way is to add your code to the custom-liquid. Please follow these steps:

  • First, Go theme file => Edit code => Snippets and Create new snippet. Then paste all your code on the new file:

  • Then go back to theme file => Customize and Add the custom-liquid:

  • Add the code to the right-corner content section:
{% render 'ListOrder' %}
  • where ‘ListOrder’ is the name of the new file you have created.

  • Now, you have your custom section. You could add this section to a specific page by “Add section”.

I hope that it will work for you.

1 Like

Thank you very much for your help. It works!!! I appreciate it a lot. :hugs:

Have a good day!

1 Like