News:

Support the VirtueMart project and become a member

Main Menu

Custom fields filters

Started by rasalghul, October 13, 2017, 05:32:02 AM

Previous topic - Next topic

rasalghul

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



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

Jörgen

You don´t say much about versions
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
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

balai


Ghost

You can't do this without core hack or 3rd party custom filter extension.

rasalghul

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

jenkinhill

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

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

rasalghul

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?

Ghost

/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.


asalomon

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 ...

Studio 42

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.