Skip to content

Instantly share code, notes, and snippets.

@CameronGilroy
Last active December 17, 2015 22:29
Show Gist options
  • Save CameronGilroy/5682300 to your computer and use it in GitHub Desktop.
Save CameronGilroy/5682300 to your computer and use it in GitHub Desktop.
FireSale Sample 2
{{ firesale:products limit="24" category="2" order="created desc" }}
{{ if products }}
<div id="accordion" class="accordion">
{{ products }}
<div class="accordion-group">
<div class="accordion-heading"><a href="#collapse{{ id }}" class="accordion-toggle" data-toggle="collapse" data-parent="#accordion">{{ title }}</a></div>
<div id="collapse{{ id }}" class="accordion-body collapse">
<div class="accordion-inner">
<p>{{ description }}</p>
<input type="number" id="quanty_{{ id }}" value="1" />
{{ rrp_tax }}
{{ church_price_tax }}
{{ reseller_price_tax }}
<a href="{{ firesale:url route='cart' }}insert/{{ id }}/1" id="cart_{{ id }}" class="basket"><span class="icon"></span>Add to Cart</a>
</div>
</div>
</div>
{{ /products }}
</div>
{{ else }}
no products
{{ endif }}
{{ /firesale:products }}
@AJSturrock
Copy link

This looks good, in reply to your question you can place this in the theme or through the CMS, it's entirely up to you. If your going to be upgrading to the latest version of FireSale at some point (That we're working on) then it'll be useful to know the product plugin has changed slightly. You'll require a loop inside the main plugin tags as follows:

{{ firesale:products limit="24" category="2" order="created desc" }}
    {{ if products }}
        {{ products }}
            Inside product loop
        {{ /products }}
    {{ else }}
        no products
    {{ endif }}
{{ /firesale:products }}

This lets you put conditionals in for if there are any products.

@CameronGilroy
Copy link
Author

Hey @AJSturrock I'm running FireSale 1.2.2-dev & the original version of this code doesn't work & the current version doesn't work either. Any Idea?

@CameronGilroy
Copy link
Author

It's a strange problem here - I'm completely confused, fully uninstalled FireSale & reinstalled.
Ended up going back to 1.2.0 and removed the {{ if products }} {{ products }} sections.
What were the changes between 1.2.2 & 1.2.0?

@AJSturrock
Copy link

Hi Cameron,

Jamie has normalised all the plugins to return {{ entries }} rather than {{ products }} etc.. in the dev version.

Thanks
Adam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment