Author Topic: Custom fields filters  (Read 947 times)

rasalghul

  • Beginner
  • *
  • Posts: 43
Custom fields filters
« 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



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

  • Global Moderator
  • Full Member
  • *
  • Posts: 1396
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Custom fields filters
« Reply #1 on: October 13, 2017, 06:54:05 am »
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.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

balai

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1321
Re: Custom fields filters
« Reply #2 on: October 13, 2017, 11:48:46 am »
Which is the template?

Ghost

  • Jr. Member
  • **
  • Posts: 404
Re: Custom fields filters
« Reply #3 on: October 13, 2017, 14:53:02 pm »
You can't do this without core hack or 3rd party custom filter extension.

rasalghul

  • Beginner
  • *
  • Posts: 43
Re: Custom fields filters
« Reply #4 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

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26741
  • Always on vacation
    • Jenkin Hill Internet
Re: Custom fields filters
« Reply #5 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

Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM3.2.14.9808 on Joomla 3.8.6 PHP 7.0.29

Testing VM3.2.14.9808 on J3.8.6

rasalghul

  • Beginner
  • *
  • Posts: 43
Re: Custom fields filters
« Reply #6 on: October 18, 2017, 04:39:11 am »
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

  • Jr. Member
  • **
  • Posts: 404
Re: Custom fields filters
« Reply #7 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.

rasalghul

  • Beginner
  • *
  • Posts: 43
Re: Custom fields filters
« Reply #8 on: October 30, 2017, 05:53:18 am »
THANKS!!!

asalomon

  • Beginner
  • *
  • Posts: 1
Re: Custom fields filters
« Reply #9 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 ...

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 2893
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Custom fields filters
« Reply #10 on: January 11, 2018, 21:29:14 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.