Author Topic: Hide category on load and list products based on dropdown selection?  (Read 343 times)

mailblade

  • Jr. Member
  • **
  • Posts: 85
  • A beginner
Good day all,

I would like to do the following: When the user clicks on the "Store" menu item, the "Store" will load as blank. There will then be a dropdown with 3 options, let's say they are "Warm,Cold and Dry". These 3 dropdown options are custom fields within VirtueMart.

So if the user selects "Warm", all products will be listed where the customfield value is = "Warm", and the rest will be hidden.

I was thinking to hide the products via Javascript and then go from there, though I'm not sure if I will need some PHP coding as well.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3402
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Hide category on load and list products based on dropdown selection?
« Reply #1 on: January 29, 2018, 17:09:57 pm »
I solution can be to display child categories "Warm,Cold and Dry" as dropdown with an overide, or disable child category render and display the categories options in a module.

mailblade

  • Jr. Member
  • **
  • Posts: 85
  • A beginner
Re: Hide category on load and list products based on dropdown selection?
« Reply #2 on: January 30, 2018, 14:38:56 pm »
Thanks for your reply.

I don't expect anyone to do it for me, just wanted some advice on what the easiest approach would be. I think category will be my best bet.