bigcartel / dugway

Easily build and test Big Cartel themes.
https://developers.bigcartel.com/api/themes
MIT License
149 stars 22 forks source link

product.categories broken #159

Closed maxcr closed 6 years ago

maxcr commented 6 years ago

Output when used #<Dugway::Drops::CategoryDrop:0x0000558226865850

on products.html

with this code

<div class="products-container">
  <div class="grid-sizer"></div>
  {% for product in products %}
  <div class="{{ product.css_class}} {{product.categories}} ">
    <a href="{{ product.url }}">
      <img alt="Image of {{ product.name | escape }}" src="{{ product.image | product_image_url size: theme.product_image_size }}">
        <div class="product-info">
          <b>{{ product.name }}</b>
          <p>{{ product.default_price | money_with_sign }}</p>
          {% if product.on_sale %}
          <em>On Sale</em>
          {% endif %}
      </div>
    </a>
  </div>
  {% endfor %}
</div>
maxcr commented 6 years ago

Nevermind I fixed it with.

{% for category in product.categories %}      
 <span class="meta-category-name">{{ category.name }}</span>
{% endfor %}

It'd be nice if you gave an example json output or some kind of representation of the data schema so I know how to access it or work with it in your documentation.