Reality | Real Estate Wordpress Theme

Contents

1. Custom Related Properties

2. Create property in database

3. How to add new currency

4. Import demo data fail

5. How to change icon for property's type

6. Why currency converter not working

7. How to add new or change option for sq feet to sq Hectares

8. How to add new fields property

9. How to make customization in child theme

10. How to translate language Reality theme

11. List of font icon class name

12. Google map show text developer only

13. How to get google map api key

14. How to custom button schedule visit

15. Noted: Other tips

16. How to Update new version theme & plugins

17. This project has no billing account - google api

1. Custom Related Properties

Question : Now on a property for sale, shows as related properties, properties for rent

Related Properties default show property same type with current property 

If you want show Related Properties same status you can follow custom code 

go to location file 

+ plugins\iwproperty\includes\class\property.class.php line 469 

http://prntscr.com/oiqbbi

remove old code 

function get_related( $args = array() ) {
        $limit_item_related = iwp_option('limit_item_related');
        $id = $this->get_id();
        $type = $this->get_type();
        $default_args = array(
            'posts_per_page' => $limit_item_related,
            'post_type' => 'iwp_property',
            'post_status' => 'publish',
            'post__not_in' => array($id),
        );
        if($type){
            $default_args['tax_query'] = array(array(
                'taxonomy' => 'iwp_type',
                'field'    => 'term_id',
                'terms'    => $type->term_id
            ));
        }
        $args = wp_parse_args($args, $default_args);
        $properties = new WP_Query( $args );
        return $properties;
    }

add new code 

function get_related( $args = array() ) {
        $limit_item_related = iwp_option('limit_item_related');
        $id = $this->get_id();
        $type = $this->get_type();
        $status = $this->get_status_obj();
        $default_args = array(
            'posts_per_page' => $limit_item_related,
            'post_type' => 'iwp_property',
            'post_status' => 'publish',
            'post__not_in' => array($id),
        );
        if($type){
            $default_args['tax_query'][] = array(array(
                'taxonomy' => 'iwp_type',
                'field'    => 'term_id',
                'terms'    => $type->term_id
            ));
        }
        if($status){
            $default_args['tax_query'][] = array(array(
                'taxonomy' => 'iwp_status',
                'field'    => 'term_id',
                'terms'    => $status->term_id
            ));
        }
        $args = wp_parse_args($args, $default_args);
        $properties = new WP_Query( $args );
        return $properties;
    }

2. Create property in database

https://gist.github.com/moometric/77bcd016a9445e349b981276a1072e8d

class new_listing {
  
  public $propertyData;
  
function __construct($propertyData = NULL) {
    $this->propertyData = $propertyData;
}

function Listing_CreateNewListing() {
  
$post_arr = array(
    'post_title'    => $this->propertyData['Address'],
    'post_content' => $this->propertyData['en_desc'],
    'post_status'  => 'publish',
    'post_type' => 'iwp_property',
    'post_author'  => get_current_user_id(),
    'meta_input'   => array(
        '_iwp_expiry' => strtotime($this->propertyData['ExpirationDate']),
        '_iwp_featured' => 0,
        '_iwp_price' => $this->propertyData['AskedSoldPrice'],
        '_iwp_property_id' => propertyData['listingid'],
        '_iwp_bedrooms' => $this->propertyData['Bedrooms'],
        '_iwp_bathrooms' => $this->propertyData['Bathrooms'],
        '_iwp_garages' => $this->propertyData['Garage'],
        '_iwp_area_size' => $this->propertyData['LivingAreaImperial'],
        '_iwp_land_size' => $this->propertyData['LotAreaImperial'],
        '_iwp_year_built' => $this->propertyData['YearBuilt'],
        '_iwp_address' => $this->propertyData['Address'],
        '_iwp_zip' => $this->propertyData['PostalCode'],
        '_iwp_longitude' => $this->propertyData['Lng'],
        '_iwp_latitude' => $this->propertyData['Lat'],
        '_iwp_map' => $this->propertyData['Lng'].','.$this->propertyData['Lat'].',14',
        '_iwp_contact_infomation' => 'hide',
        '_iwp_admin_review' => 2,
    ),
);
$this->postId = wp_insert_post($post_arr, true);

if (is_wp_error($this->postId)) {

foreach ($this->postId->error_data as $key => $value) {
echo "$key - $value";

}
}

return $this;
}
}

new new_listing($propertyData[])

3. How to add new currency

If you want add new currency to our theme. 

You can copy my code and custom it for new currency 

'EUR' => [
'code' => 'EUR',
'title' => 'Euro',
'symbol' => '€ ',
'precision' => 2,
'thousandSeparator' => '.',
'decimalSeparator' => ',',
'symbolPlacement' => 'before'
],

Then copy your code to location file : wp-content\plugins\iwproperty\includes\class\currency.class.php

line 68

http://prntscr.com/k89a6v


4. Import demo data fail

Active Theme and Required Plugins. You go to Theme Options > Import Demo

http://prntscr.com/jlgrc2

http://prntscr.com/jlgrja

http://prntscr.com/jlgxf2

After the demo data has been imported successfully.

You can go to Settings > Permalink Settings and save in here http://prntscr.com/jlgyk1

+ If you don’t import demo data successful. You can follow my guide: 

You need reset all using this plugin and then import demo data again: https://wordpress.org/plugins/wordpress-reset/

You can try it

1/ if you install theme in localhost. You can go to php.ini and set

max_execution_time=5500

max_input_time=5600

memory_limit=1280M

post_max_size=256M

upload_max_filesize=756M

max_file_uploads=20

allow_url_fopen=On

2/ set this in the config.php file

define(‘WP_MEMORY_LIMIT’, ‘500M’);

set_time_limit(800);

5. How to change icon for property's type

To add the icon for property's type, please go to Wp-admin: Properties -> Types -> Check all your properties types then edit them

add the icon class http://prntscr.com/jt5p1k

You can choose our class custom icon in here: 

reality-icon-for-sale
reality-icon-for-rent
reality-icon-furniture
reality-icon-maps
reality-icon-crane
reality-icon-bathroom
reality-icon-bedroom
reality-icon-build-in
reality-icon-city
reality-icon-certification
reality-icon-condo
reality-icon-elevator
reality-icon-tree-and-fence
reality-icon-floors
reality-icon-garage
reality-icon-industrial
reality-icon-land
reality-icon-park
reality-icon-retail
reality-icon-shop-building
reality-icon-area
reality-icon-swimming-pool
reality-icon-townhomes
reality-icon-villa
reality-icon-all_types
reality-icon-appartments
reality-icon-sofa

See demo icon : http://prntscr.com/li2tmj

or you can choose icon class fontawesome example: fa fa-bath 

http://prntscr.com/jth4vk

http://prntscr.com/jth4qm

http://prntscr.com/jth4l9

6. Why currency converter not working

#1/ You can check setting API Exchange Rate

http://prntscr.com/l4d36w

#2/ If currency converter continue not working , maybe cronjob currency converter not working. 

You can deactive plugin iwproperty and active it again, the cronjob will reactive 

Or you can install plugin cronjob scheduler and check it 


https://wordpress.org/plugins/cronjob-scheduler/

and check cronjob 

iwp_get_currency_exchange

http://prntscr.com/l4d1px

7. How to add new or change option for sq feet to sq Hectares

Is it possible to change the option for sq feet to sq Hectares as that will be easier and I don't need sq feet.

You can use my custom code 

Go to location file and copy my code 

+ wp-contentpluginsiwpropertyincludesadminsetting.class.php  line 500

array(
    'name' => __( 'Property measurement unit', 'iwproperty' ),
    'id'   => 'measurement_unit',
    'type' => 'select',
    'std' => 'sqft',
    'options' => array(
        'sqft' => __('Square Feet - ft²', 'iwproperty'),
        'sqmt' => __('Square Meters - m²', 'iwproperty'),
        'sqha' => __('Square Hectares - ha', 'iwproperty'),
    ),
),

+ wp-contentpluginsiwpropertyincludeshelper.function.php  line 1256

function iwp_get_measurement_unit_text($measurement_unit = null){
    if($measurement_unit === null){
        $measurement_unit = iwp_option('measurement_unit', 'sqft');
    }
    if($measurement_unit == 'sqmt') {
        $unit_text = _x('m²', 'Measurement unit text', 'iwproperty');
    }elseif($measurement_unit == 'sqft'){
        $unit_text = _x('ft²', 'Measurement unit text', 'iwproperty');
    }else{
        $unit_text = _x('ha', 'Measurement unit text', 'iwproperty');
    }
    return $unit_text;
}

+ wp-contentpluginsiwpropertyincludesclassproperty.class.php line 1547 

'measurement_unit' => array(
    'name' => __( 'Measurement unit', 'iwproperty' ),
    'id'   => IWP_PREFIX.'measurement_unit',
    'type' => 'select',
    'std' => 'sqft',
    'options' => array(
        'sqft' => __('Square Feet - ft²', 'iwproperty'),
        'sqmt' => __('Square Meters - m²', 'iwproperty'),
        'sqha' => __('Square Hectares - ha', 'iwproperty'),
    ),
),

8. How to add new fields property

If you want add new field you can add custom code in location file : "wp-content\themes\reality-child\function.php" 

Note: You need use child theme because after update new version, all custom code in folder themes\reality will remove.

function iwp_property_fields_custom( $group_fields ) {
 $group_fields['details']['fields'][] = array(
 'name' => 'xxx1',  // change name you want
 'placeholder' => 'xxx1',  //change placeholderyou want
 'id' => '_iwp_xxx', // change id
 'type' => 'number',  // choose number or text
 'allow_compare' => '1',
 'allow_required' => '1',
 'allow_disabled' => '1',
 'allow_package_disable' => '1',
 );
 return $group_fields;
}
add_filter( 'iwp_property_fields', 'iwp_property_fields_custom' );

http://prntscr.com/joupua

http://prntscr.com/joupyr

http://prntscr.com/jouqc1

Create custom template in child theme: 

http://prntscr.com/k1ivu1

Copy file description.php, description-style2.php, description-style3.php to location : "wp-content\themes\reality-child\iwproperty\property-details\" 

And go to location file : "wp-content\themes\reality-child\iwproperty\property-details\description.php"

 remove code in line 97 add custom code to file : 

And go to location file : "wp-content\themes\reality-child\iwproperty\property-details\description-style2.php"

 remove code in line 75 add custom code to file : 

And go to location file : "wp-content\themes\reality-child\iwproperty\property-details\description-style3.php"

 remove code in line 139 add custom code to file : 

<?php endif;
   if ( get_post_meta( $property->get_id(), '_iwp_xxx', true ) ) : ?>
      <div class="iwp-item">
          <span><?php esc_html_e( 'xxx', 'iwproperty' ); ?>:</span> <?php echo get_post_meta( $property->get_id(), '_iwp_xxx', true ); ?>
      </div>
<?php endif; ?>


*** Create Mutil Fields ***

You can create mutil fields , see my custom code: 

function iwp_property_fields_custom( $group_fields ) {
 $group_fields['details']['fields'][] = array(
 'name' => 'xxx1',  // change name you want
 'placeholder' => 'xxx1',  //change placeholderyou want
 'id' => '_iwp_xxx', // change id
 'type' => 'number',  // choose number or text
 'allow_compare' => '1',
 'allow_required' => '1',
 'allow_disabled' => '1',
 'allow_package_disable' => '1',
 );
  $group_fields['details']['fields'][] = array(
 'name' => 'xxx2',  // change name you want
 'placeholder' => 'xxx2',  //change placeholderyou want
 'id' => '_iwp_xxx2', // change id
 'type' => 'number',  // choose number or text
 'allow_compare' => '1',
 'allow_required' => '1',
 'allow_disabled' => '1',
 'allow_package_disable' => '1',
 );
  $group_fields['details']['fields'][] = array(
 'name' => 'xxx3',  // change name you want
 'placeholder' => 'xxx3',  //change placeholderyou want
 'id' => '_iwp_xxx3', // change id
 'type' => 'number',  // choose number or text
 'allow_compare' => '1',
 'allow_required' => '1',
 'allow_disabled' => '1',
 'allow_package_disable' => '1',
 );
 return $group_fields;
}
add_filter( 'iwp_property_fields', 'iwp_property_fields_custom' );

the new field does not appear in compare page,

You can go to Properties Settings > Fields > Compare Fields

http://prntscr.com/k1v62y




9. How to make customization in child theme

If you need customize template in our plugin Property you can follow our guide:

You can go to child theme create new folder iwproperty

Then you copy file you want to edit from "wp-content\plugins\iwproperty\templates" to folder "wp-content\themes\reality-child\iwproperty" then edit on it.

Example:

When you want edit file \plugins\iwproperty\templates\login.php

You need copy this file to folder wp-content\themes\reality-child\iwproperty\login.php and edit on this.

When you want edit file \plugins\iwproperty\templates\parts\alert.php

You need copy this file to folder wp-content\themes\reality-child\iwproperty\parts\alert.php and edit on this.

Notice: Please just copy files you want to make change on it. Not copy all file.

Best regards,
duongca
Inwave Support Team

10. How to translate language Reality theme

Step 1: Go to Plugins / Add new  

Search plugin loco translate and install  plugin

http://prntscr.com/gv02z7

Step 2:  Go to Loco translate > Home > InWave Property

http://prntscr.com/jnew0t

Step 3:  Create New language http://prntscr.com/jnew9c

Select Language you want  http://prntscr.com/jnewhi

Choose Language you need translate http://prntscr.com/jnewrp

Search text you need translate  http://prntscr.com/jnexmt

After translate  http://prntscr.com/jneyi0

Note: You need select location file to Other. 

If you used location file author, after update plugin all translate text will remove. 

https://prnt.sc/jnewhi

11. List of font icon class name

Hello,

I provide list of font icon class name. You can use it for property type

reality-icon-for-sale
reality-icon-for-rent
reality-icon-furniture
reality-icon-maps
reality-icon-crane
reality-icon-bathroom
reality-icon-bedroom
reality-icon-build-in
reality-icon-city
reality-icon-certification
reality-icon-condo
reality-icon-elevator
reality-icon-tree-and-fence
reality-icon-floors
reality-icon-garage
reality-icon-industrial
reality-icon-land
reality-icon-park
reality-icon-retail
reality-icon-shop-building
reality-icon-area
reality-icon-swimming-pool
reality-icon-townhomes
reality-icon-villa
reality-icon-all_types
reality-icon-appartments
reality-icon-sofa

12. Google map show text developer only

Because now google need user register billing if you want use google api key. After register billing you can use free google api key with limit request

With the launch of Google Maps Platform, we’ve introduced changes to our products, pricing, and support to provide you with greater flexibility, transparency, and control. This guide explains how these changes may impact you and what steps you need to take. You can also read our blog for additional context.

As of June 11, 2018, you must enable billing with a credit card and have a valid API key for all of your projects. This will give you the ability to scale easily with less downtime and fewer performance issues. In addition, we’ve simplified our 18 individual APIs into three products: Maps, Routes, and Places.

In June 2016 we announced that we would stop supporting keyless usage, meaning any request that doesn’t include an API key or Client ID. This went into effect on June 11 2018, and keyless access is no longer supported. Keyless calls to the Maps JavaScript API and Street View API will return low-resolution maps watermarked with “for development purposes only.” Keyless calls to any of the following APIs will return an error: Maps Static API (including Static Street View), Directions API, Distance Matrix API, Geocoding API, Geolocation API, Places API, Roads API, and Time Zone API.

To avoid a service interruption to your projects, please visit our Get Started page to enable a billing account and generate an API key. Once you generate and secure an API key, make sure to update your application with the new API key.

https://cloud.google.com/maps-platform/user-guide/

https://cloud.google.com/maps-platform/pricing/sheet/?hl=en

13. How to get google map api key

You can go to https://console.developers.google.com and register api key 

Remember enable API and services like my screenshot (remember verify your domain with api key)

http://prntscr.com/jtj6ra

http://prntscr.com/jtj3un

And you copy google api key to

+ Properties > Settings > Display Settings > Map Settings > Google API Key

http://prntscr.com/jtj5nz

+ Theme Options > Map 

http://prntscr.com/kf7dxq

14. How to custom button schedule visit

You can go to location file : 

+ wp-content\themes\reality\blocks\user-login.php line 64 remove class 

menu-item

http://prntscr.com/klgahk

Then go to Theme Options > Header Options > active Show button schedule visit and add URL to button

http://prntscr.com/klgb96

15. Noted: Other tips

#1/ -Is it possible to use Google Maps in a way that it\'s language will be presented in the same language of the website?

You can readmore document : 

https://developers.google.com/maps/documentation/javascript/localization

You can go to file 

+ plugins\iwproperty\includes\front.class.php

line 206 

wp_register_script(\'google-maps\', \'https://maps.googleapis.com/maps/api/js?key=\'.$google_api_key.\'&libraries=places\', array(\'jquery\'), $js_version, true);

+ plugins\inwave-common\inc\shortcode.class.php

line 96

wp_register_script(\'google-maps\', \'https://maps.googleapis.com/maps/api/js?key=\'.$google_api.\'&libraries=places\', array(\'jquery\'), INWAVE_COMMON_VERSION, true);

and custom code like document 

<script src=\"https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&language=ja®ion=JP\"></script>

#2/ i go setting > Property expiry setting > Featured Property Duration > 30 Days
and test "Make Featured" from my account create order and i go test on WP-admin > Change order to complete > and my properties show on "Featured Property"and top when search property.

You can install plugin https://wordpress.org/plugins/cronjob-scheduler/

and check cronjob time in your site.

http://prntscr.com/ksj6xj

You can choose min time and setup it in your hosting. 


#3/ However I will want to know if we can fix the advanced search directly so that it is visible as soon as the user enters the site like this https://prnt.sc/kvbhi6. It will be easier and faster for the user who does not have time to click on the advanced search. 

Go to 

+ plugins\iwproperty\templates\parts\search-form.php remove text on line 64

disable-advanced

http://prntscr.com/l13nx8


#4/ How to  add the current property url to content email

you try add 

Property name: [_post_name]

URL link: [_post_url]

to Mail of Schedule a Tour/Appointment Schedule Contact Form

http://prntscr.com/kqt5g7

#5/ How to form Schedule A Tour send mail property  to agency , agent

add custom tag 

[_post_responsible_email]

to Mail 

http://prntscr.com/l2dp5n


#6/ Way to customize slugs more?

You can try use 3rd party plugin 

Plugin Custom Post type permalinks

https://wordpress.org/plugins/custom-post-type-permalinks/ https://prnt.sc/kbm6qa


#7/ How do I change the 3 colours on the pre-loader circle?

You can go to location file 

+ wp-content\themes\reality\style.css

and change color on line 791, 805, 819

http://prntscr.com/l4ccvl


#8/ IDX can\'t click popup 

https://inwave.ticksy.com//ticket/1830693/

http://forum.wpbeaverbuilder.com/support/q/optima-express-jquery-conflict/

add code to function.php

function remove_bb_bootstrap() {
  wp_dequeue_script(\'bootstrap\');
}
add_action( \'wp_enqueue_scripts\',\'remove_bb_bootstrap\',1000);

#ihf-main-container .modal-dialog {
 left: 0% !important;
}
#ihf-main-container div.modal{
left: 0% !important;
top: 0% !important;
}



16. How to Update new version theme & plugins

How to Update? 

You can follow my guide (remember backup all website before update)

Step 1: Go to FTP or Cpanel, delete old folder theme reality in :"wp-content\themes" http://prntscr.com/jnv2yy

Step 2 : Unzip file new version theme and upload new folder theme injob to :"wp-content\themes" in your hosting http://prntscr.com/jnv4eo

Step 3: Go to admin and update plugin  http://prntscr.com/gvw30h

http://prntscr.com/jnv4ws

You can see video in here https://hoak34-gmail.tinytake.com/sf/MjE0MzM0Ml82Njg2NTcy

Note. Backup your system before upgrading, if you custom code after update version, all custom code will clear 

17. This project has no billing account - google api

This project has no billing account - google api


https://prnt.sc/m2w5la

http://prntscr.com/m2wa5u