Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author daverod

    (@daverod)

    Hi DarrylR,

    Let me check with my developer to find out what kind of effort is required here. I think a writeup on how to do that would be helpful, since the last owner didn’t have that.

    Longer term, we probably want to have something that gives you a full form capability–adding fields of your choice and so on. That’s where we’re heading, but let me see what I can get you now.

    Plugin Author daverod

    (@daverod)

    Here’s what my developer said:

    There is no way to do it without changing the plugin’s code. I don’t like to write about how to alter the core, but here it goes:

    Add the new feature to the $re_features global variable

    Open the privatefunctions.php file and look for $re_features = array. Then add entries for the new features. The numeric index of each feature is important; that’s the value that gets stored in the database.

    After I added a new Tennis Court feature, the array looks like the example below:

    $re_features = array (1 => __('Pool', "greatrealestate"),
                2 => __('Waterfront', "greatrealestate"),
                3 => __('Golf', "greatrealestate"),
                4 => __('Condo', "greatrealestate"),
                5 => __('Townhome', "greatrealestate"),
                6 => __( 'Tennis Court', 'greatrealestate' ),
            );

    To make things easier later, lets define a constant to store the numeric index of the new feature:

    define ( ‘DARRYLR_GRE_FEATURE_TENNIS_COURT’, 6 );
    Update template to show the new feature

    You have to update both theme/great-real-estate/listing-excerpt.php and theme/great-real-estate/listing-page-content.php and add the following code:

    if ( get_listing_hasfeature( DARRYLR_GRE_FEATURE_TENNIS_COURT ) ) {
        $third_line_attributes[] = __( 'Tennis Court', 'greatrealestate' );
    }

    after

    if ( $has_town_home ) {
        $third_line_attributes[] = __( 'Townhome', 'greatrealestate' );
    }

    The results

    By now you should be able to see something like the screenshots below:

    https://cloud.githubusercontent.com/assets/45068/10166294/f84d6cf4-6688-11e5-8f12-dbac9e96f22f.png

    https://cloud.githubusercontent.com/assets/45068/10166307/03770e6e-6689-11e5-978b-675c084da9f2.png

    Thread Starter DarrylR

    (@darrylr-1)

    Ah, thanks for the detailed instructions. Please let me know when you’ve added this capability to the UI.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do you add/customize Features?’ is closed to new replies.