"Charge for Listings" = NO, Create Listings only allows unlimited Categories
I am repeating this post hear as it was added in the
http://forums.appthemes.com/vantage-1-2-public-beta/
which is not directly accessible so other users may benefit.
If in Vantage Settings you set "Charge for Listings" = YES. You can limit the number of Categories the user can select within the Plan settings by setting a value in the "Categories Included" field.
If you select "Charge for Listings" = NO, there is NO option to limit the number of Categories the user can select when creating a listing, the only option available is INFINITE.
Is this design intentional ?
If I don't want to include any payment Plans or charge the user, I also don't want to allow the user the option to select UNLIMITED categories.
Can an option be included somewhere to limit the number of categories when "Charge for Listings" = NO ?
You can apply the following 2 simple code changes so that you can define how many categories a user can choose if you are using the "Charge for Listings" = YES setting:
In the "listing-form.php" file change the following number from 0 to your number of categories you want to allow:
PHP Code:
$plan = _va_get_last_plan_info( $listing->ID );
if ( false !== $plan ) {
$plan_data = va_get_plan_options( $plan['ID'] );
$included_categories = va_get_plan_included_categories( $plan['ID'] );
$categories_locked = current_user_can('administrator') ? false : true;
} else {
$included_categories = 0; //<-- change this value
$categories_locked = false;
}
In the "listing-purchase.php" file change the following number from 0 to your number of categories you want to allow:
PHP Code:
function va_get_plan_included_categories( $plan_id ) {
global $va_options;
$plan = va_get_plan_options( $plan_id );
if ( !isset( $plan['included_categories'] ) ) {
return 0; //<-- change this value
} else {
return $plan['included_categories'];
}
}
NOTE: Make sure the number is the same in both locations.
I am hoping a Vantage Settings option is added to allow the admin to specifically set this value.