Shopify linking product using SEO handle coding

0 votes

I followed the directions for the second way to tag a product to a blog

This is the website I used https://happypoints.io/shopify-add-products-to-blog-post-c2-stt-66/ This is the code that was entered {% assign my_description = article.content | split: '=== split content ===' %}

 {% assign  my_description_size = my_description.size | minus: 2 %}
  {{ my_description | first}}
 <div class="show-product-list">           
   {% if article.tags.size > 0 %}             
       {% for tag in article.tags %}
       {% paginate collections.all.products by 100 %}
       {%- for product in collections.all.products -%}
           {% if product.handle == tag %}
              <div class="product_item">
               {% include 'product-card-list' %} 
             </div> 
           {% endif %}
       {%- endfor -%}
       {% endpaginate %} 
       {% endfor %}          
   {% endif %}
 </div>
   {{ my_description | last}}

after following all the directions I received an error message saying

Liquid error (sections/article-template.liquid line 42): Could not find asset snippets/product-card-list.liquid

I am not sure why the product wont link to the blog using the seo handle. I have copied and pasted this code correctly and still getting this error

Collection code:

{% if collection.title == blank %}
  {% assign collection_image = blank %}
{% elsif collection.image %}
  {% assign collection_image = collection.image %}
{% else %}
  {% assign collection_image = collection.products.first.featured_media.preview_image %}
{% endif %}

{% unless collection.title == blank %}
  {% include 'card-image', type: collection_image, grid_style: grid_style %}
{% else %}
  <div class="card__image-wrapper">
    {% capture current %}{% cycle 1, 2, 3, 4, 5, 6 %}{% endcapture %}
    {{ 'collection-' | append: current | placeholder_svg_tag: 'placeholder-svg' }}
  </div>
{% endunless %}

<div class="card__info">
  <h3 class="card__name h4">{% if collection.title != blank %}{{ collection.title }}{% else %}{{ 'homepage.onboarding.collection_title' | t }}{% endif %}</h3>

  {% if section.settings.show_description and collection.description != blank %}
    <div class="rte card__description{% if width == '2' %} card__description--padding{% endif %}">
      {{ collection.description | strip_html | truncatewords: 15 }}
    </div>
  {% endif %}
</div>
Mar 12, 2022 in Digital Marketing by Kichu
• 19,040 points
520 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
The problem is that your theme does not have a file named "product-card-list" in the snippets folder. The code for the product tiles is in this file. The name of the file may vary in the theme that you're using. Find out the correct file name and replace "product-card-list" with that.
The collection code is also incomplete in your case. This code does not have the logic for rendering products. The code for rendering products will look something like {% for product in collection.products %} The variable name "product" may vary.
answered Mar 13, 2022 by narikkadan
• 63,600 points

edited Mar 5

Related Questions In Digital Marketing

0 votes
1 answer

How to over-ride meta data in Wordpress, using Squirrly SEO

if (is_archive()){ add_filter('sq_title', 'filter_product_wpseo_metadesc'); function filter_product_wpseo_metadesc($wpseo_metadesc){ ...READ MORE

answered Mar 1, 2022 in Digital Marketing by narikkadan
• 63,600 points
981 views
0 votes
0 answers

How to over-ride meta data in Wordpress, using Squirrly SEO

I currently have a Wordpress website using ...READ MORE

Mar 4, 2022 in Digital Marketing by Kichu
• 19,040 points
667 views
0 votes
0 answers

SEO indexing fails with lazy load images using Intersection Observer API

To improve my site performance I'm trying ...READ MORE

Mar 5, 2022 in Digital Marketing by Kichu
• 19,040 points
716 views
0 votes
1 answer

Setting a Custom SEO Title Using Yoast Wordpress SEO API

Firstly disable WordPress SEO by Yoast, then ...READ MORE

answered Mar 11, 2022 in Digital Marketing by narikkadan
• 63,600 points
1,316 views
0 votes
0 answers

Internationalize target country for SEO using language url path

I'm adding now Internationalization support for English ...READ MORE

Mar 13, 2022 in Digital Marketing by Kichu
• 19,040 points
615 views
0 votes
1 answer

Wordpress SEO : Semrush audit report

actually autoptimize, and Wp Rocket are the ...READ MORE

answered Mar 1, 2022 in Digital Marketing by narikkadan
• 63,600 points
693 views
0 votes
0 answers

One Hot Encoding in Apache Spark

The following code that I wrote for ...READ MORE

Feb 11, 2020 in Apache Spark by Manish
• 120 points
2,767 views
0 votes
0 answers

PHP json encode - Malformed UTF-8 characters, possibly incorrectly encoded

I am using json_encode($data) on an array ...READ MORE

Jun 27, 2022 in PHP by narikkadan
• 63,600 points
5,229 views
0 votes
1 answer

Trouble with excel macros (possibly encoding?)

To solve your issue: Replace your macro names ...READ MORE

answered Sep 26, 2022 in Others by narikkadan
• 63,600 points
1,097 views
0 votes
1 answer

Excel to CSV with UTF8 encoding

Use of Google Spreadsheet is a straightforward ...READ MORE

answered Dec 23, 2022 in Others by narikkadan
• 63,600 points
1,188 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP