Skip to Content

Welcome!

This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

This question has been flagged
As a moderator, you can either validate or reject this answer.
Accept Reject
55 Views

Issues:

When i want to filter commission type = cobroke-commission, after i filter, it only come out one result, but the correct result should be two.

Result:

So, i try to write the query out to check the query

We can write the query before returning it, and the key point is that we need to add (string) to the $query because it ensures the query is properly converted to a string before execution.


Write File:

In the written file, we can see that the query consists of three WHERE clauses, but the third one is for sales_type, which we did not include in the filters.

Back in the frontend view, we can see that the sales type is already auto-selected even before we make a selection.

This is because the XML field does not have a default value or a header specified.

So, solution is adding a header to the xml field like:


Revised frontend view

Now, when we filter again, it should not have any issues


The query will no longer include the WHERE clause for sales type


Summary:

Setting a header for the filter XML field is important to avoid an extra WHERE clause in the query. It also enhances user experience by making the filter dropdown more user-friendly, especially when a header like '--Select Sales Type--' is provided.

Avatar
Discard

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Related Posts Replies Views Activity
0
Feb 25
107
0
Feb 25
90
0
Jan 25
58
0
Jan 25
81
0
Mar 25
100