Skip Navigation

[Resolved] Something else seems to be broken which used to be working

This thread is resolved. Here is a description of the problem and solution.

Problem:

Custom PHP codes do not work any more, the filter function stop working again.

Solution:

It is a custom codes problem, see the solution here:

https://toolset.com/forums/topic/something-else-seems-to-be-broken-which-used-to-be-working/#post-1261823

Relevant Documentation:

This support ticket is created 5 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by chong-sumw 5 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#1261817

The style prob is fixed. thank you so much luo. I deleted the </div> some time ago because the html editor showed it as red color, therefore I thought it was redundant. I will add a comment to remind myself not to delete it again. Also the tag has to be moved after the [wpv-filter-end] tag (line 69), otherwise the html will be broken (see attached screen shot)

I was checking if the filter works probably. Sadly, something else seems to be broken which used to be working.

Filters with problems:
投資預算(field="wpcf-selling-price"), 利潤(field="wpcf-profit"), 面積(wpcf-store-size-sqft).

What problem:
the filters cannot correctly filter according to its value.

for example, when you choose the default option (which should return all results), it would only show 6 posts (out of 7), skipped the one with same value as others (selling price 280000).

then you choose selling price below $250,000, the form shows 6 posts too. there is only one post with selling price below $250,000 which is $150,000. it seems to me that the filter form behaves as if it shows results greater than the lower bound of the filter option. for example, for filter option of value 1-250,000 it shows posts with value greater than 1 instead of between 1 and 250,000.

To achieve the above range filter function, a custom code snippet has been added in toolset setting. please refer to the following link
https://toolset.com/forums/topic/custom-search-filter-price-range-dropdown/

Again, many thanks for your help.

#1261823

Hello,

Thanks for the details, it is a custom codes problem, I have done below modification in your website,

Dashboard-> Toolset-> Settings-> Custom code
Edit the item "toolset-custom-code", change line 28, from:

if(in_array($view_id == 536) {

To:

if(in_array($view_id, array(536, 1645)) ) {

Then this custom PHP function will be able to apply to both post views: 536, 1645

More help:
hidden link

#1261829

Thanks luo, but now the old "owner involvement 東主參與度" problem comes back again. The filter function stop working again.

#1261845

Thanks for the details, there might be some problem in those custom codes, I have change line 33 from:

unset($query_args['meta_query'][$k]);

To:

//unset($query_args['meta_query'][$k]);

This line will remove other custom field filters(東主參與度), in your case, you need to comment it out, please test again, check if it is fixed, thanks

#1261857

My issue is resolved now. your service is extremely helpful and efficient. Thank you!