VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: EvanGR on April 13, 2021, 14:47:46 PM

Title: Show products based on specific custom fields?
Post by: EvanGR on April 13, 2021, 14:47:46 PM
I want to show products which have specific custom fields value, e.g.:

Show all products where color === "blue".

Is this possible to do from the template/product page, or category page?

Do I need to change the VM core files?

Thanks
Title: Re: Show products based on specific custom fields?
Post by: Jörgen on April 13, 2021, 15:11:57 PM
Yes there are extensions for filtered search. Breakdesigns has a custom filter.

No core files need to be modified.

Jörgen @ Kreativ Fotografi
Title: Re: Show products based on specific custom fields?
Post by: pinochico on April 13, 2021, 21:45:31 PM
Or you can use our VirtueMart product Extended, where is option show all products with the same customfiled ID
Title: Re: Show products based on specific custom fields?
Post by: EvanGR on April 14, 2021, 09:33:24 AM
Thanks,

I actually want to include these products in existing product/category page, not access them via a search link (like the extensions you mentioned, which we own as well).
So I would definitely need to get my hands dirty in VM code.
Title: Re: Show products based on specific custom fields?
Post by: pinochico on April 14, 2021, 10:40:26 AM
Quotenot access them via a search link (like the extensions you mentioned, which we own as well).

Which search link do you mean?

Oh man, I add this only one module in admin to product detail by advanced module from regular labs into position in template, not use search link  ;D
But definitelly, you can change core code VM too :)
Title: Re: Show products based on specific custom fields?
Post by: balai on April 14, 2021, 13:33:24 PM
QuoteI actually want to include these products in existing product/category page, not access them via a search link (like the extensions you mentioned, which we own as well).

I think that you can create a new view in Custom Filters, to export the products in json or xml format.
It will require some coding but it is pretty straightforward. All the dirty job is done by Custom Filters and you just dictate the results format.