bigcartel / dugway

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

GET feature not working in dugway #148

Closed Bouncey closed 7 years ago

Bouncey commented 7 years ago

I have a client with a current Big Cartel store, and in there existing template they have this at the top of home.html:

{% get products from products.all limit:theme.featured_products order:theme.featured_order %}

and it works just fine on the live site.

I have downloaded their template files and copied them into my dugway project dir, however there are no products to display.

This conditional returns false:

{% if products != blank %}

So this renders:

{% else %}

<p class="alert-noproducts"><span>No products found.</span></p>

{% endif %}

I have configured the .dugway.json file with their subdomain.

Their settings.json:

{
  "show_search": true,
  "show_newest": true,
  "featured_products": 42,
  "sidebar_rollovers": "#09010f",
  "show_top_selling": true,
  "links_rollover": "#000000",
  "text": "#030000",
  "background": "#451a66",
  "font": "Verdana",
  "header_text": "#000000",
  "header_background": "#451a66",
  "show_products_feed": true,
  "links": "#000000",
  "products_background": "#451a66",
  "products_per_page": 54,
  "show_inventory_bars": true,
  "featured_order": "position",
  "sidebar_links": "#000000"
}

If I remove the limit and order options I receive the full list of products.

Any help would be gratefully received

Dugway: 0.10.4 ruby: 2.3.1p112 (2016-04-26) [x86_64-linux-gnu] gem: 2.5.1 OS: Ubuntu 16.04LTS

nickendle commented 7 years ago

@Bouncey sorry for the trouble! The settings.json downloaded from the Customize Design area is actually a bit different than the file that's used in Dugway... you can see this in action with our Lunch Break theme: https://github.com/bigcartel-themes/lunch-break/blob/master/source/settings.json#L72-L179

Your best option might just be simulating the theme values in .dugway.json instead, which we talk about here: https://github.com/bigcartel/dugway#store-customization

In that case you can just add in those featured products settings, restart Dugway, and you should be good to go.

  "customization": {
    "featured_order": "position",
    "featured_products": 2
  }
Bouncey commented 7 years ago

Great! It's working now. :tada:

Thanks @nickendle.