Displaying Minimum Price by Tag or Custom Filter Value (e.g., Penthouse)
This functionality allows you to display the minimum price for any floor plan(s) in a Spaces asset that have been tagged with a specific custom filter value (e.g., penthouse, premium, affordable). It supports both base rent and total monthly lease price (TMLP).
Use Case
This functionality is suited for any clients who wish to highlight the lowest price available for a group of plans that share specific desired characteristics, as grouped by a particular SPACES tag. By the methods described below, the user can retrieve a handful of relevant characteristics & corresponding prices and display them as standalone text, rather than displaying all plans for the SPACES Asset via the regular Spaces shortcode. This is ideal for marketing “premium” tiers, limited offers, or special layouts on places other than the mail Apartments/Floor Plans page on the target website.
Preparation
Before minimum price can be displayed through this method, it is necessary to mark the relevant floor plans so they can be filtered by one of two means: by Floor Plan Custom Filter Class, or by SPACES Tag. If a custom filter or SPACES Tag with the desired attribute has already been set up previously, then proceed to the next section. If not, please see our documentation for setting up custom filters/SPACES Tags, and apply them to the relevant Floor Plan records.
Implementation Options
We provide two methods of implementation depending on your role:
Shortcode (For CMS Users)
Use the following shortcode in your CMS content blocks to display the minimum price for plans tagged with a custom filter value:
[spaces_custom_filtered_plan_price asset_id="9547" custom_filter_value="your-filter-value-here" include_required_monthly_fees="true" label="Label Text Here"]
Parameters:
asset_id(required): The ID of the SPACES Asset from which the pricing data is sourced. If not already known, this can be found in the CMS by one of two methods:- Navigate to SPACES > Assets, find the desired Asset in the list, and check the Shortcode column. The
asset_idparameter in the regular Spaces shortcode will have the correct value. - Navigate to the settings page for the desired SPACES Asset, and check the
postparameter of the url. For example, if the SPACES Asset settings page has the URLhttps://example.com/wp-admin/post.php?post=12345&action=edit, then the correct Asset ID would be 12345.
- Navigate to SPACES > Assets, find the desired Asset in the list, and check the Shortcode column. The
custom_filter_value(required): The name of either the SPACES Tag or the Floor Plan Custom Filter Class applied to the desired plans (e.g., penthouse, affordable).- For Floor Plan Custom Classes, the value should be the class itself with no leading full stop character ('.'). For example, to filter by a custom filter class of
attached-garage, the valueattached-garagewould be correct, but.detached-garagewould not. - For SPACES Tags, the value should be the slug for the Tag itself, prepended by the text
tag-; for example, to filter by a SPACES Tag with the slugrooftop-gardens, the required value would betag-rooftop-gardens.- Generally, slugs for SPACES tags consist of lowercase versions of their plain text with dashed instead of spaces; e.g. "Rooftop Gardens" ->
rooftop-gardens. If uncertain as to the exact value, the user may find it by navigating in the CMS to SPACES > SPACES Tags, and consulting the Slug column of the list for the desired Tag.
- Generally, slugs for SPACES tags consist of lowercase versions of their plain text with dashed instead of spaces; e.g. "Rooftop Gardens" ->
- For Floor Plan Custom Classes, the value should be the class itself with no leading full stop character ('.'). For example, to filter by a custom filter class of
label(optional): Add the desired text for the label that will precede the minimum price on the front end.- If omitted, Spaces will use the value supplied to the
custom_filter_valueparameter, but with capitalized initial letters for each alphanumeric section; for example:- Custom filter class
penthouse-> Label textPenthouse - Custom filter class
attached-garage-> Label textAttached-Garage - SPACES Tag
tag-townhome-> Label textTag-Townhome
- Custom filter class
-
Adding explicit Label text is strongly recommended for users filtering by a Custom Filter Class with more than one word/group of alphanumeric characters, or any SPACES Tag, as the latter will always have "Tag-" preceding its name.
- If omitted, Spaces will use the value supplied to the
include_required_monthly_fees(optional): Set totrueto include fees, such as parking, pets, etc. Omit or set tofalseto display base rent only.
Utility Method (For Developers)
Developers can use the utility method to return the minimum price for plans tagged with a given custom_filter_value, optionally including required monthly fees.
$price = \SPACES\Utility::get_minimum_price_for_floor_plan_by_custom_filter_value(
spaces_asset_id: $spaces_asset_id,
custom_filter_value: $custom_filter_value,
label: $label_text, // optional
include_required_monthly_fees: true // or false
Returns: A formatted string with the minimum rent for all matching floor plans.
Updated 11 days ago