*

Zig220

  • **
  • 20 posts
Advanced Search Question
« on: October 28, 2021, 07:50:13 PM »
I have created a custom field for "SIZE". This custom field ONLY applies to ONE of my categories.
My goal is to place this custom field in my main navigation and have it perform a search throughout the entire website for ONLY the size selected, and ONLY within the category it is assigned to. Attached is a copy of the code I have been trying to use. It works, but only if I am on a page within the specified category. In other words, the size field will not work if I am within another category that is not assigned to this custom field. I am hoping their is a quick edit to my code to fix this. Something that would allow me to specify the particular category to search within only. Thanks for any help.

*

Zig220

  • **
  • 20 posts
Re: Advanced Search Question
« Reply #1 on: October 28, 2021, 09:04:55 PM »
Maybe this will help clarify my question.... What would be the code I would need in order to search ONLY within a specific category no matter what previous searches or page the user is currently on?

What would be the PHP code equivalent to this statement....
SEARCH FOR  | SIZE: "12 METER" | ONLY WITHIN CATEGORY ID 96

*

MB Themes

Re: Advanced Search Question
« Reply #2 on: October 29, 2021, 08:12:22 AM »
@Zig220
I am not sure if I understand, but you can change category to #96 and then search, or?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Zig220

  • **
  • 20 posts
Re: Advanced Search Question
« Reply #3 on: October 29, 2021, 08:19:14 AM »
Maybe a live example will help. Please visit www.splashifieds.com and hover your mouse over the top "MAIN MENU"...then hover your mouse over "KITES". When you do, you will see a drop down select field towards the bottom. Its purpose is to allow users to click on a specific size, and have it return a results page showing only "KITES" that are the size selected. Currently, this drop only works if you are within the "KITES" category. I need it to work all the time.

*

MB Themes

Re: Advanced Search Question
« Reply #4 on: October 29, 2021, 10:08:35 AM »
@Zig220
You must update category setup for that field
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Zig220

  • **
  • 20 posts
Re: Advanced Search Question
« Reply #5 on: October 29, 2021, 05:18:10 PM »
@Zig220
You must update category setup for that field
I have no idea what that means.


*

Zig220

  • **
  • 20 posts
Re: Advanced Search Question
« Reply #6 on: October 29, 2021, 05:43:17 PM »
I am not sure how to make this any easier but here are a few more attempts...

-------------#1 Attempt----------------------

I have a category in my website which has an ID of 96
I want to allow users to search for specific size items within category 96.
I want to place my custom field for size on any page of my website.
When a user uses this custom size field, I only want it to display results obtained from category 96.
(this feature does currently work, but only if I am within a category 96 page)

-------------#2 Attempt----------------------

If a user selects "size 12" from my custom field, then only show items that are size 12 that exist within category 96.

-------------#3 Attempt----------------------

User wants to search for ONLY "SIZE 12" items.
User only wants to see size 12 results from the category "96"

-------------#4 Attempt----------------------

I am asking for a section of PHP code that will search for a user specified size, only within category 96


The goal is to allow users to search for a specific size, but only within category 96.
I am asking if anyone here can provide the php code that will help me achieve this goal.

« Last Edit: October 29, 2021, 05:46:00 PM by Zig220 »

*

MB Themes

Re: Advanced Search Question
« Reply #7 on: October 30, 2021, 06:22:20 PM »
I still think solution is simply enable that custom gield only for category #96
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Zig220

  • **
  • 20 posts
Re: Advanced Search Question
« Reply #8 on: October 30, 2021, 06:26:12 PM »
I still think solution is simply enable that custom gield only for category #96

It already has been. Here is a screen shot.....

*

MB Themes

Re: Advanced Search Question
« Reply #9 on: October 31, 2021, 08:50:26 AM »
@Zig220
Then this custom fields should be visible only and only under selected categories.
If not, it is bug.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Zig220

  • **
  • 20 posts
Re: Advanced Search Question
« Reply #10 on: November 01, 2021, 12:37:15 AM »
@Zig220
Then this custom fields should be visible only and only under selected categories.
If not, it is bug.

YES! This works exactly how you said it should. BUT!!!!!
I have hard coded this custom field into my navigation / menu. My entire goal is to have this custom drop down field display and work  on ALL pages of my website.  It currently works great if the user is within the category for that custom field. If they are not, it does not work.

This is why I am asking for a small chunk of code that will allow the drop down field to work on all pages of the website and not just the category it was assigned to in the admin.

 
« Last Edit: November 01, 2021, 12:38:47 AM by Zig220 »

*

MB Themes

Re: Advanced Search Question
« Reply #11 on: November 01, 2021, 01:08:34 PM »
Problem here is most probably in core.
Filter conditions are not applied if taht field is not added to category, you would have to do it manually
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots