Products - summary by custom field?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
kurashiki_ben
Forum Members
Forum Members
Posts: 86
Joined: Sun Jul 05, 2009 2:37 am

Re: Products - summary by custom field?

Post by kurashiki_ben »

manc wrote: i'm progessing here. just need a little help. does anyone know how to only call one product, by product id, as a summary template. i tried doing the following to call one id from the detail page, but use a detail template called result which is just a copied version of my default summary template:

{Products action='details' detailtemplate='result' productid='PRODUCT_ID'}

obviously the following does nothing:

{Products productid='PRODUCT_ID'}

any ideas?
Try
{Products action='default' category="yourcategory" summarytemplate="sometemplate" productid="1"}
==> summary of 1 product from a certain category

{Products action='default' category="yourcategory" summarytemplate="sometemplate"}
==> summary of all products in the category displayed
Last edited by kurashiki_ben on Thu Nov 05, 2009 9:25 am, edited 1 time in total.
User avatar
manc
Forum Members
Forum Members
Posts: 107
Joined: Wed Apr 01, 2009 12:59 pm

Re: Products - summary by custom field?

Post by manc »

i have taken quite a while building something and have finally done so.
i had to create a new table, store the variables i needed into this new table, do a search, output the product ID(s) i need and use it to call the product summary.
i then dropped the table so that the search results do not compile over time.
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Products - summary by custom field?

Post by jmcgin51 »

Going back to the original request, which was to provide a summary list of all products which match a certain custom field...

Thinking out loud, I think it could be done something like this:

{Products category='whatever' summarytemplate='a_value'}

then in the Summary Template

{foreach item from the resultset}
  {if $entry->fields.foo->value == 'a_value'}
    list the product
  {/if}
{/foreach}

This will cycle through the entire result set for the selected category, and will display only those products that have the desired customfield value.

This would not be very efficient, since the query would be returning potentially many more results than are ultimately desired, but in a smallish product list, I think it would work well.

Will try this in the next few days, I hope.
User avatar
manc
Forum Members
Forum Members
Posts: 107
Joined: Wed Apr 01, 2009 12:59 pm

Re: Products - summary by custom field?

Post by manc »

the MySQL I developed has been working for me, so am leaving it now - took a lot of time to develop it!
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Products - summary by custom field?

Post by jmcgin51 »

Just a note to followup, for anyone else looking for options:

my suggestion above (filtering the resultset via an IF statement in the summary template) works like a charm.

Again, this is not particularly efficient, and it would be nicer to be able to query directly based on custom fields, but in the interim, this solution could prove useful.

Manc - glad your custom coded solution suited your need!
Post Reply

Return to “Modules/Add-Ons”