Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function doesnt work #7

Open
imSanv opened this issue Apr 24, 2017 · 3 comments
Open

Function doesnt work #7

imSanv opened this issue Apr 24, 2017 · 3 comments

Comments

@imSanv
Copy link

imSanv commented Apr 24, 2017

Hello!
I implemented all things but i can't see your design and the js doesn't work i select my size and doesnt make anything, i don't know what happened, i followed all steps but i dont found product-loop

Please help me! Thank you

@jglovier
Copy link
Member

Hi @imSanv, it's very hard to troubleshoot without more details, or actually seeing your implementation. If you have it in a repo or want to paste it into a Gist, I'd be happy to take a look and see if I can spot the issue.

Also, did you check your browser for console errors? If there is an error in the browser console, that might help you pinpoint the issue.

@michaelkingbaa
Copy link

Hi @jglovier!

I'm having sort of the same issue as the previous poster.

Here's my product-loop.liquid file:

{% assign product_found = false %}
{% assign skip = false %}

{% capture new_row %}
    <br class="clear product_clear" />
{% endcapture %}

{% for product in products limit: limit %}

  {% if product.id == skip_product.id or skip == true %}
    {% assign product_found = true %}
  {% else %}
    {% if forloop.rindex0 == 0 and product_found == false and forloop.length != products.count and template != 'search' %}
      {% assign skip = true %}
    {% else %}

      {% include 'product-thumbnail' with product-loop %}

      {% if products_per_row == "2" %}
        {% cycle '', new_row %}
      {% elsif products_per_row == "3" %}
        {% cycle '', '', new_row %}    
      {% elsif products_per_row == "4" %}  
        {% cycle '', '', '', new_row %}
      {% endif %}
    {% endif %}    
  {% endif %}
  
{% endfor %}


js-size-filter
{% for variant in product.variants %}
	{% if variant.available %}
		size-{{ variant.title }}
	{% endif %}
{% endfor %}

Any pointers would be appreciated!

-Mike

@joesasson
Copy link

@michaelkingbaa I think the intention of the code in Step 4 is to set a class for the actual product thumbnails to be selected by js. It looks like in your code (like in mine) the product thumbnails are somewhere else. In mine, it was in a file called product-thumbnail.liquid but it doesn't really matter. The point is that you are inserting

js-size-filter
{% for variant in product.variants %}
	{% if variant.available %}
		size-{{ variant.title }}
	{% endif %}
{% endfor %}

into the class attribute of your thumbnail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants