Bug - Search results shows ALL listings are Featured
There is a BUG in the following code and or how "Charge for Items" is handled:
File: "vantage\includes\featured.php"
Code:
/**
* Figure out if the listing should be featured or not.
*
* @since 1.0.0
*
* @return bool True if it should be featured, otherwise false.
*/
function va_is_listing_featured() {
global $post;
if ( is_front_page() ) {
$addons = array( VA_ITEM_FEATURED_HOME );
} elseif ( is_tax() || is_archive() ) {
$addons = array( VA_ITEM_FEATURED_CAT );
} else {
$addons = array( VA_ITEM_FEATURED_HOME, VA_ITEM_FEATURED_CAT );
}
foreach ( $addons as $addon_type ) {
$addon = appthemes_get_addon_info( $addon_type );
$featured = get_post_meta( $post->ID, $addon['flag_key'], true );
if ( ! empty( $featured ) ) {
return true;
}
}
return false;
}
I have tested on both an upgraded data from Vantage 3.0.9 to Vantage 4.1.0 and fresh install of Vantage 4.1.0.
On doing a "Find" search ALL the listings returned show up as "Featured" when in fact none of the listings are set as featured.
As per this post:
https://forums.appthemes.com/help-us...54/#post407349
If you have "Charge for Items" set to OFF, any Listing created will be tagged as a "Featured" listing.
Under this use case, there is NO setting available to be able to turn ON/OFF the featured setting for the Listing.
Basically there is NO control to the admin to enable or disable the use of the "Featured" functionality.
The above mentioned code is checking if a listing has a featured flag assigned to it.
When you have "Charge for Items" set to OFF the function "appthemes_get_addon_info()" is not configured properly and does not return valid results within this code. Hence the function "va_is_listing_featured()" always returns "true" and ALL the listings are always displayed as "Featured".
Can you please pass onto AppTheme developers to have a look over it.