Products Module - only show products with custum field checkbox tick

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
ukmgranger
Forum Members
Forum Members
Posts: 72
Joined: Wed Apr 04, 2007 9:54 am

Products Module - only show products with custum field checkbox tick

Post by ukmgranger »

Hi - again!

As the title says really,

I want to show a list of products, but only show the products that have got a custom field tickbox (with a tick in it).

For example - only show campsites that allow campfires.

Any ideas?
tyman00
Power Poster
Power Poster
Posts: 906
Joined: Tue Oct 24, 2006 5:59 pm

Re: Products Module - only show products with custum field checkbox tick

Post by tyman00 »

Use {get_template_vars} in your summary or hierarchy template to see what variables are available. To you in that mode. I think your checkbox should be there.

Then inside of your foreach loop you can do something like this:

Code: Select all

{if $checkboxVariable == "checkedValue}
Display product information
{/if}
That's a really rough draft on how to do it. But this could get you some great direction on where to go.

You can also check out Calguy's blog post on custom templating here: http://calguy1000.com/Blogs/12/60/basic ... kills.html

There is also good information here: http://forum.cmsmadesimple.org/index.ph ... 689.0.html

You can take the information from both articles and use it to work your way through your setup.
If all else fails, use a bigger hammer.
M@rtijn wrote: This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.
Peciura

Re: Products Module - only show products with custum field checkbox tick

Post by Peciura »

Could be easier if you set similar category "campfires"
tyman00
Power Poster
Power Poster
Posts: 906
Joined: Tue Oct 24, 2006 5:59 pm

Re: Products Module - only show products with custum field checkbox tick

Post by tyman00 »

That's actually a very good suggestion. It passed through my mind while I was responding and forgot to address it.

It will still allow for campfires to be selected with a checkbox and you can just the categorylist option to display all campsites that have that box checked.
If all else fails, use a bigger hammer.
M@rtijn wrote: This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.
Post Reply

Return to “Modules/Add-Ons”