2 worded city names vs Single Ad refine search vs Search bar
Ovi, I think I flagged this issue before thinking it was related to CP but I've come to realize it's related to ClassiPost due to the City field listed in the Single Ad.
I have multiple 2 worded cities in the City custom field of the Ad form ("New Jersey,New York, etc.")
If the user uses the
City drop down in the header Search bar to search by city, he will get all the Ads attached to that city.
BUT
If the user clicks on the City within the Single Ad listings to refine the results based on that city, the search returns 0 results and here is why:
The native Header search bar replaces the blank spaces of the 2 worded city names by a +
2 worded City search bar vs single ad - success.jpg
The Single Ad city refine search does not work the same way and displays the following search string:
PHP Code:
https://website.com/ad-category/category-1/?cp_city=New%20York&sa=search&refine_search=yes
It's that %20 between New and York that's causing the issue
2 worded City search bar vs single ad - fail.jpg
THe code found in Functions.php
PHP Code:
<span class="ad-loop-city"><i class="fa fa-map-marker" style="color:#53bbfb"></i> <a href="<?php echo $category_link; ?>?<?php if ($classipost_meta == 'cp_city') echo $classipost_meta; else echo $classipost_meta.'[]'; ?>=<?php echo $custom_meta;?>&sa=search&refine_search=yes" title="<?php echo $custom_meta; ?>"> <?php echo $custom_meta; ?></a></span>
The only way for a 2 worded city name to work properly under both the header search bar AND the single ad listing is to set a dash-icon between both words (ex: New-York, New-Jersey, etc.) but that's not how New York or New Jersey is spelled out.
Can you provide a quick fix for this issue?