Online Store 2.0
Summary
Shopify has recently released a version 2.0 of their online themes with numerous changes and enhancements, notably the migration from .liquid
template files to .json
template files. This impacted the process of installing Nosto in any of the version 2.0 themes as Nosto mostly expects and modifies .liquid
files. Nosto has recently released support for version 2.0 themes and this documentation will discuss the details in-depth. For more information Shopify side of changes, visit corresponding links below,
As per this Shopify documentation, shopify has a limitation of a maximum of 25 sections per json template.
Nosto's implementation
After the recent update, Nosto supports for the following,
Existing Shopify themes (let's call it version 1.0 themes)
Online store 2.0 themes (let's call it version 2.0 themes)
Hybrid themes (will discuss more shortly)
Existing Shopify themes
Support and process for version 1.0 of shopify themes will remain unchanged
Online 2.0 themes
In order to support the new JSON
templates and inject Nosto snippet, following changes will be made to the installed theme (For e.g, the Dawn theme).
Existing JSON templates
Following table lists existing JSON templates that will be updated while installing Nosto
templates/index.json
templates/404.json
templates/collection.json
templates/product.json
templates/search.json
templates/cart.json
New liquid templates
Each of the section values/properties introduced in the section above needs the corresponding liquid present under sections group of the theme. Following sections will list all the new liquid template files that will be introduced along with it's content
sections/nosto-404.liquid
sections/nosto-cart.liquid
sections/nosto-collection-prepend.liquid
sections/nosto-collection-append.liquid
sections/nosto-index.liquid
sections/nosto-product.liquid
sections/nosto-search-prepend.liquid
sections/nosto-search-append.liquid
Hybrid themes
As per their migration guide, Shopify allows the option of migrating their themes one file at a time, meaning a customer can migrate templates/404.liquid
to templates/404.json
today and leave the rest of their theme setup as it is and continue using the liquid template files. In that case, a customer will be using scheme structure of both version 1.0
and version 2.0
themes. Nosto has implemented support for this scenario under the recent release. It will automatically identify those files that are still using version 1.0
liquid templates and injects content, into the liquid template, using the existing logic. Also identifies those that belongs to version 2.0
json templates and injects content, into those json templates, using the approach discussed in above sections.
Migrating customers
Assume a customer is on version 1.0
and has Nosto installed already. When such a customer is migrating to version 2.0
, they can do either of the following,
For every migration, uninstall Nosto, migrate your files and then reinstall Nosto from within the Nosto app
Migrate everything excluding Nosto content
The reason is Nosto uses unique logic for injecting contents into Shopify themes. With the introduction of non structured json schema, it became little challenging to isolate Nosto content for easy installation or removal. In case if the Nosto contents are copied over during manual migration, this could result in duplication on Nosto sections on screen. In those scenarios, we will be able to identify and mitigate the issue by removing the duplicated contents from liquid templates. We can avoid this issue, if we follow the points above and use Nosto app to install or uninstall Nosto contents. In future, we will introduce other options to better handle this situation
Last updated