Shopify - the peculiarity that I hit my forehead

sa-hola

Sa

Posted on November 5, 2023

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!

💖 💪 🙅 🚩
sa-hola
Sa

Posted on November 5, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related