DEV Community

Sa
Sa

Posted on

Shopify - the peculiarity that I hit my forehead

Another client has a store created on Shopify. It is important to clarify that the store sells bags, casual clothes and clothes for an active lifestyle and yachting: https://rewind.com.ua.

That is, three main areas of activity.

And then the task comes: to present these main directions on the main page in the form of cubes. Where each cube represents the goods of its category.

Product blocks on rewind.com.ua

The idea of building was simple: to set an array of categories, and even better - a ligament of the product-category, so that you can decide in manual mode which goods to be withdrawn in cubes. And then, sorting out the array, to configure its conclusion. Nothing complicated.

Working mainly on PHP, such a problem is solved in 3 minutes. If not for one "but" - in Shopify you can’t clearly set an array!

Not wanting to spend a lot of time learning Liquid, I turned to GPT for help.

His idea turned out to be simple and brilliant at the same time: yes, it is impossible to set the array directly, but you can set the line and divide it (as "split" in JS) into array!

Image description

And to perform all further actions as if we have an ordinary array. In principle, this is an array, only obtained not in a direct way, but by converting the line.

A trifle, but unpleasant! Thanks to GPT for saved time!

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay