Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Converting to Online 2.0 problems

Converting to Online 2.0 problems

kayluhb
Tourist
7 1 1

I have an existing Shopify theme that I'm converting to Online 2.0. It's not a very complex theme, and I have moved all templates to be .json files, and moved their content to section liquid templates with schema tags, as per the documentation for migrating.

However, when I go to my Navigation settings to set up filters, I still get the message `The current theme doesn’t support filters`

I also don't see sections available to add to a section while editing a template in the theme editor, i.e. 'No theme sections available for this template', although my sections/blocks that I've added to a special page template work as expected ( I have a FAQ page that I can add blocks to an FAQ section just fine.

Additionally, when I added a new product_reference metafield to a product, I'm receiving the graphql gid instead of the product object as per the documentation. I'm getting this response https://shopify.dev/apps/metafields/definitions/types (product_reference)when I am expecting to get this https://shopify.dev/api/liquid/objects/metafield (product_reference)

It seems like there's something I'm missing about converting to 2.0 and I can't see why...

thanks

Replies 2 (2)

Ecommpremium
Shopify Partner
512 43 95

Hi @kayluhb may I have a look at your theme files so I can give you exact solution!

Regards

- Did we solve your issue? Like & Mark As Solution to help the community
- SKYPE: ahsanaliawan
- 300+ Video Tutorials
-Website

kayluhb
Tourist
7 1 1

So here's what I learned so far.

 

I didn't see sections in my 'Add a section' editor because I didn't have `presets` on my section template schema. Once I added those, I started seeing them in the editor.

 

For filtering, I just had to reference them in my template. Once I add this template rendered by a section, the filtering section of Shopify admin allowed me to edit them.

 

<div>
  {%- for filter in collection.filters -%}
    <div>
      {{ filter.label }}
      <ul>
        {%- for filter_value in filter.values -%}
          <li>
            <a href="{{ collection.url }}?{{ filter_value.param_name }}={{ filter_value.value }}">{{ filter_value.label }}</a>
          </li>
        {%- endfor -%}
      </ul>
    </div>
  {%- endfor -%}
</div>

 

I still have no idea why my metafield is returning a gid instead of a product object and Shopify Plus support directed me here, so......