Page 2 of 2
Re: Products - summary by custom field?
Posted: Thu Nov 05, 2009 8:14 am
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
Re: Products - summary by custom field?
Posted: Mon Dec 07, 2009 2:59 pm
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.
Re: Products - summary by custom field?
Posted: Thu Jan 07, 2010 4:08 am
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.
Re: Products - summary by custom field?
Posted: Thu Jan 07, 2010 2:32 pm
by manc
the MySQL I developed has been working for me, so am leaving it now - took a lot of time to develop it!
Re: Products - summary by custom field?
Posted: Fri Jan 08, 2010 8:47 pm
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!