VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: rasalghul on October 13, 2017, 05:32:02 AM

Title: Custom fields filters
Post by: rasalghul on October 13, 2017, 05:32:02 AM
When using custom filters included in basic template custom fields do this kind of search...

Custom field a= Option 1
Custom field b= Option 2

(https://farm5.staticflickr.com/4490/37665738031_ded7d69578.jpg)

Search = Option 1 OR Option 2

But I need to change to a search like this

Search = Option 1 & Option 2

How can it be done?

I hope to be clear about my question
Title: Re: Custom fields filters
Post by: Jörgen on October 13, 2017, 06:54:05 AM
You don´t say much about versions
http://forum.virtuemart.net/index.php?topic=79799.0 (http://forum.virtuemart.net/index.php?topic=79799.0)

This could probably be solved using multi variant instead of only custom fields.

regards

Jörgen @ Kreativ Fotografi
Title: Re: Custom fields filters
Post by: balai on October 13, 2017, 11:48:46 AM
Which is the template?
Title: Re: Custom fields filters
Post by: Ghost on October 13, 2017, 14:53:02 PM
You can't do this without core hack or 3rd party custom filter extension.
Title: Re: Custom fields filters
Post by: rasalghul on October 13, 2017, 20:44:08 PM
Joomla 3.7.4
Virtuemart 3.2.2

A core hack?
What files do I need to edit?

The are custom fields for a lot of products not only one. The are generic characteristics for Tabletop games, like Number of players, theme, mechanics, etc
Title: Re: Custom fields filters
Post by: jenkinhill on October 13, 2017, 20:56:36 PM
Core hacks are never recommended. It means that every time you update VM you have to redo the hack. Use a plugin instead.

have a look at this:  https://breakdesigns.net/extensions/joomla/custom-filters

Title: Re: Custom fields filters
Post by: rasalghul on October 18, 2017, 04:39:11 AM
Quote from: jenkinhill on October 13, 2017, 20:56:36 PM
Core hacks are never recommended. It means that every time you update VM you have to redo the hack. Use a plugin instead.

have a look at this:  https://breakdesigns.net/extensions/joomla/custom-filters

I can do that... I only need to change that feature...

AND instead of OR conector un that filter.
Do you know wich file I have to edit?
Title: Re: Custom fields filters
Post by: Ghost on October 18, 2017, 09:35:16 AM
/administrator/components/com_virtuemart/models/product.php. But it's not as simple as changing OR to AND. You'll have to think of the full query to make filtering work properly.
Title: Re: Custom fields filters
Post by: rasalghul on October 30, 2017, 05:53:18 AM
THANKS!!!
Title: Re: Custom fields filters
Post by: asalomon on January 11, 2018, 19:16:09 PM
Hello everyone, I am using this same module but I want that instead of the custom fields appearing independently I want them to come out in a unified way. In my case I am with a project of vehicle parts I want the Brands to come out and then we select the brand that the Model of those brands can come out of.

Example:
I want to have two combo box:
   1) Brands (where all brands appear)
   2) Models (Where the models of the selected brand come out)

Each of them is a custom field

How can I do that, how can I modify it ...
Title: Re: Custom fields filters
Post by: Studio 42 on January 11, 2018, 21:29:14 PM
Quote from: asalomon on January 11, 2018, 19:16:09 PM
Hello everyone, I am using this same module but I want that instead of the custom fields appearing independently I want them to come out in a unified way. In my case I am with a project of vehicle parts I want the Brands to come out and then we select the brand that the Model of those brands can come out of.

Example:
I want to have two combo box:
   1) Brands (where all brands appear)
   2) Models (Where the models of the selected brand come out)

Each of them is a custom field

How can I do that, how can I modify it ...
If you want it step by step, you need to write own module. Or check with a developer, it's not a big deal, but i don't know if this module already exist.
Of course, i can do it, but other devs in the forum too.