From 76759b11e3233809a0ced8be5d936c0fc29dc2e9 Mon Sep 17 00:00:00 2001 From: ThemeLexus Date: Mon, 30 Sep 2019 10:37:36 +0700 Subject: [PATCH 1/8] uapte --- inc/property/class-opalestate-shortcodes.php | 43 ++++++++++++++++---- templates/shortcodes/properties.php | 29 ++++++++++--- 2 files changed, 59 insertions(+), 13 deletions(-) diff --git a/inc/property/class-opalestate-shortcodes.php b/inc/property/class-opalestate-shortcodes.php index 1357bb78..fbb0029e 100755 --- a/inc/property/class-opalestate-shortcodes.php +++ b/inc/property/class-opalestate-shortcodes.php @@ -67,19 +67,48 @@ class OpalEstate_Shortcodes { */ public function search_properties_form ( $atts=[] ) { - $atts = is_array( $atts ) ? $atts : []; + $atts = is_array( $atts ) ? $atts : []; + $layout = 'collapse-advanced'; + + $default = array( + 'hidden_labels' => true, + 'display_more_options' => true, + 'nobutton' => false, + 'layout' => $layout + ); - $atts['hidden_labels'] = true; + $atts = array_merge( $default, $atts ); - return opalestate_load_template_path( 'search-box/collapse-advanced', $atts ); + return opalestate_load_template_path( 'search-box/'.$layout, $atts ); } - public function properties() { - return opalestate_load_template_path( 'shortcodes/properties' ); + /** + * Display all properties follow user when logined + */ + public function properties( $atts=[] ) { + + $atts = is_array( $atts ) ? $atts : []; + + $default = array ( + 'posts_per_page' => 10, + 'show_pagination' => true, + 'column' => apply_filters( 'opalestate_properties_column_row', 3 ), + 'layout' => 'content-property-grid-v2' + ); + + $atts = array_merge( $default, $atts ); + + return opalestate_load_template_path( 'shortcodes/properties', $atts ); } - public function search_properties_result() { - return opalestate_load_template_path( 'shortcodes/search-properties-result' ); + /** + * [opalestate_search_properties_result] Display all properties follow user when logined + */ + public function search_properties_result( $atts=[] ) { + + $atts = is_array( $atts ) ? $atts : []; + + return opalestate_load_template_path( 'shortcodes/search-properties-result', $atts ); } /** diff --git a/templates/shortcodes/properties.php b/templates/shortcodes/properties.php index 635a16a5..19be584d 100644 --- a/templates/shortcodes/properties.php +++ b/templates/shortcodes/properties.php @@ -1,22 +1,39 @@ -1, + 'posts_per_page' => $posts_per_page, ]; $query = Opalestate_Query::get_property_query( $args ); $class = 'column-item'; +$clscol = floor( 12 / $column ); + ?>
have_posts() ): ?> - have_posts() ) : $query->the_post(); ?> -
- -
- +
+ have_posts() ) : $query->the_post(); ?> + +
+ +
+ +
+ + max_num_pages > 1 && $show_pagination ): ?> +
max_num_pages ); ?>
+ + From 65d06225d538ea14133ae5eb5f2984e3670d581b Mon Sep 17 00:00:00 2001 From: ThemeLexus Date: Mon, 30 Sep 2019 10:45:28 +0700 Subject: [PATCH 2/8] uapte --- inc/property/class-opalestate-shortcodes.php | 11 +++++++++-- readme.txt | 1 + templates/shortcodes/properties.php | 8 +++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/inc/property/class-opalestate-shortcodes.php b/inc/property/class-opalestate-shortcodes.php index fbb0029e..7f9d88d2 100755 --- a/inc/property/class-opalestate-shortcodes.php +++ b/inc/property/class-opalestate-shortcodes.php @@ -90,10 +90,17 @@ class OpalEstate_Shortcodes { $atts = is_array( $atts ) ? $atts : []; $default = array ( - 'posts_per_page' => 10, + 'posts_per_page' => 9, 'show_pagination' => true, 'column' => apply_filters( 'opalestate_properties_column_row', 3 ), - 'layout' => 'content-property-grid-v2' + 'layout' => 'content-property-grid-v2', + 'showmode' => '', + 'categories' => null, + 'types' => null, + 'labels' => null, + 'cities' => null, + 'statuses' => null, + ); $atts = array_merge( $default, $atts ); diff --git a/readme.txt b/readme.txt index fa4a2604..9329470f 100755 --- a/readme.txt +++ b/readme.txt @@ -96,6 +96,7 @@ The plugin will not make you disappointed with ease of use, friendly & flexible - [opalestate_ajax_map_quick_search] => Ajax Search Map Properties - [opalestate_register_form] => Register User Form - [opalestate_login_form] => Login Form + - [opalestate_properties] => Display list of property estate in grid with pagination = Elementor Widgets = diff --git a/templates/shortcodes/properties.php b/templates/shortcodes/properties.php index 19be584d..e7da2fac 100644 --- a/templates/shortcodes/properties.php +++ b/templates/shortcodes/properties.php @@ -1,7 +1,13 @@ $posts_per_page, + 'posts_per_page' => $posts_per_page, + 'showmode' => $showmode, + 'categories' => $categories, + 'types' => $types, + 'labels' => $labels, + 'cities' => $cities, + 'statuses' => $statuses, ]; $query = Opalestate_Query::get_property_query( $args ); From 2ccc8611b60872a33a43e1a87a2b0db6cf8a357d Mon Sep 17 00:00:00 2001 From: ThemeLexus Date: Mon, 30 Sep 2019 11:11:35 +0700 Subject: [PATCH 3/8] uapte --- inc/property/class-opalestate-shortcodes.php | 63 ++++++++++++++++--- .../opalestate-split-maps-search.php | 39 ++---------- templates/shortcodes/search-properties-v.php | 5 -- templates/shortcodes/search-split-maps.php | 31 +++++++++ 4 files changed, 93 insertions(+), 45 deletions(-) delete mode 100755 templates/shortcodes/search-properties-v.php create mode 100755 templates/shortcodes/search-split-maps.php diff --git a/inc/property/class-opalestate-shortcodes.php b/inc/property/class-opalestate-shortcodes.php index 7f9d88d2..97df9f04 100755 --- a/inc/property/class-opalestate-shortcodes.php +++ b/inc/property/class-opalestate-shortcodes.php @@ -23,6 +23,17 @@ if ( ! defined( 'ABSPATH' ) ) { */ class OpalEstate_Shortcodes { + /** + * Get instance of this object + */ + public static function get_instance(){ + static $_instance; + if( !$_instance ){ + $_instance = new OpalEstate_Shortcodes(); + } + return $_instance; + } + /** * Static $shortcodes */ @@ -39,7 +50,7 @@ class OpalEstate_Shortcodes { 'properties' => [ 'code' => 'properties', 'label' => esc_html__( 'Properties', 'opalestate-pro' ) ], 'search_properties_result' => [ 'code' => 'search_properties_result', 'label' => esc_html__( 'Search Properties Result', 'opalestate-pro' ) ], 'search_properties' => [ 'code' => 'search_properties', 'label' => esc_html__( 'Search Properties', 'opalestate-pro' ) ], - 'search_properties_v' => [ 'code' => 'search_properties_v', 'label' => esc_html__( 'Search Properties Vertical', 'opalestate-pro' ) ], + 'search_split_maps' => [ 'code' => 'search_split_maps', 'label' => esc_html__( 'Search Split Maps', 'opalestate-pro' ) ], 'search_map_properties' => [ 'code' => 'search_map_properties', 'label' => esc_html__( 'Search Map Properties', 'opalestate-pro' ) ], 'ajax_map_search' => [ 'code' => 'ajax_map_search', 'label' => esc_html__( 'Ajax Search Map Properties', 'opalestate-pro' ) ], @@ -58,6 +69,9 @@ class OpalEstate_Shortcodes { } + /** + * Display all properties follow user when logined + */ public function shortcode_button() { } @@ -114,8 +128,20 @@ class OpalEstate_Shortcodes { public function search_properties_result( $atts=[] ) { $atts = is_array( $atts ) ? $atts : []; + + $default = array( + 'style' => null, + 'style_list' => null, + 'column' => null, + ); - return opalestate_load_template_path( 'shortcodes/search-properties-result', $atts ); + $atts = array_merge( $default, $atts ); + + $html = '
'; + $html .= opalestate_load_template_path( 'shortcodes/ajax-map-search-result', $atts ); + $html .= '
'; + + return $html; } /** @@ -135,25 +161,46 @@ class OpalEstate_Shortcodes { /** * Render search property page with vertical form and map */ - public function search_properties_v() { - return opalestate_load_template_path( 'shortcodes/search-properties-v', [ 'loop' => '' ] ); + public function search_split_maps( $atts=[] ) { + + $atts = is_array( $atts ) ? $atts : []; + + $default = array( + 'search_form' => 'simple-city', + 'paged' => 1 + ); + + $atts = array_merge( $default, $atts ); + + return opalestate_load_template_path( 'shortcodes/search-split-maps', $atts ); } + /** + * Render search property page with vertical form and map + */ public function search_map_properties() { return opalestate_load_template_path( 'shortcodes/search-map-properties', [ 'loop' => '' ] ); } + /** + * Render search property page with vertical form and map + */ public function ajax_map_search() { wp_enqueue_script( 'sticky-kit', OPALESTATE_PLUGIN_URL . 'assets/js/jquery.sticky-kit.min.js' ); return opalestate_load_template_path( 'shortcodes/ajax-map-search', [ 'loop' => '' ] ); } + /** + * Render search property page with vertical form and map + */ public function ajax_map_quick_search() { return opalestate_load_template_path( 'shortcodes/ajax-map-quick-search', [ 'loop' => '' ] ); } - /* register form show up */ + /* + * Register form show up + */ public function register_form( $atts = [] ) { $atts = shortcode_atts( [ 'message' => '', @@ -164,7 +211,9 @@ class OpalEstate_Shortcodes { return opalestate_load_template_path( 'user/register-form', $atts ); } - /* sign in show up */ + /* + * sign in show up + */ public function login_form( $atts = [] ) { $atts = shortcode_atts( [ 'message' => '', @@ -177,4 +226,4 @@ class OpalEstate_Shortcodes { } -new OpalEstate_Shortcodes(); +OpalEstate_Shortcodes::get_instance(); \ No newline at end of file diff --git a/templates/elementor-templates/opalestate-split-maps-search.php b/templates/elementor-templates/opalestate-split-maps-search.php index 3e34fee7..ef74be28 100755 --- a/templates/elementor-templates/opalestate-split-maps-search.php +++ b/templates/elementor-templates/opalestate-split-maps-search.php @@ -1,37 +1,10 @@ 1, + 'search_form' => $settings['search_form'] +); ?> -
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
- true ] ); ?> -
- -
- 2 ] ); ?> -
-
-
-
-
-
+ \ No newline at end of file diff --git a/templates/shortcodes/search-properties-v.php b/templates/shortcodes/search-properties-v.php deleted file mode 100755 index eeca23af..00000000 --- a/templates/shortcodes/search-properties-v.php +++ /dev/null @@ -1,5 +0,0 @@ -
-
- -
-
diff --git a/templates/shortcodes/search-split-maps.php b/templates/shortcodes/search-split-maps.php new file mode 100755 index 00000000..d2ea7c8c --- /dev/null +++ b/templates/shortcodes/search-split-maps.php @@ -0,0 +1,31 @@ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true ] ); ?> +
+ +
+ 2 ] ); ?> +
+
+
+
+
+
From 83a120c1e28cf27c0de50dbc3f6064a3fa220bf6 Mon Sep 17 00:00:00 2001 From: ThemeLexus Date: Mon, 30 Sep 2019 11:22:15 +0700 Subject: [PATCH 4/8] uatpe --- inc/property/class-opalestate-shortcodes.php | 12 +++--------- readme.txt | 9 ++++----- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/inc/property/class-opalestate-shortcodes.php b/inc/property/class-opalestate-shortcodes.php index 97df9f04..0c1d1fdf 100755 --- a/inc/property/class-opalestate-shortcodes.php +++ b/inc/property/class-opalestate-shortcodes.php @@ -52,9 +52,9 @@ class OpalEstate_Shortcodes { 'search_properties' => [ 'code' => 'search_properties', 'label' => esc_html__( 'Search Properties', 'opalestate-pro' ) ], 'search_split_maps' => [ 'code' => 'search_split_maps', 'label' => esc_html__( 'Search Split Maps', 'opalestate-pro' ) ], - 'search_map_properties' => [ 'code' => 'search_map_properties', 'label' => esc_html__( 'Search Map Properties', 'opalestate-pro' ) ], - 'ajax_map_search' => [ 'code' => 'ajax_map_search', 'label' => esc_html__( 'Ajax Search Map Properties', 'opalestate-pro' ) ], - 'ajax_map_quick_search' => [ 'code' => 'ajax_map_quick_search', 'label' => esc_html__( 'Ajax Search Map Properties', 'opalestate-pro' ) ], + 'search_map_properties' => [ 'code' => 'search_map_properties', 'label' => esc_html__( 'Show Map + Search Box and Properties', 'opalestate-pro' ) ], + 'ajax_map_search' => [ 'code' => 'ajax_map_search', 'label' => esc_html__( 'Ajax Search Map Properties And Horizontal Search', 'opalestate-pro' ) ], + 'register_form' => [ 'code' => 'register_form', 'label' => esc_html__( 'Register User Form', 'opalestate-pro' ) ], 'login_form' => [ 'code' => 'login_form', 'label' => esc_html__( 'Login Form', 'opalestate-pro' ) ], ]; @@ -191,12 +191,6 @@ class OpalEstate_Shortcodes { return opalestate_load_template_path( 'shortcodes/ajax-map-search', [ 'loop' => '' ] ); } - /** - * Render search property page with vertical form and map - */ - public function ajax_map_quick_search() { - return opalestate_load_template_path( 'shortcodes/ajax-map-quick-search', [ 'loop' => '' ] ); - } /* * Register form show up diff --git a/readme.txt b/readme.txt index 9329470f..7af56698 100755 --- a/readme.txt +++ b/readme.txt @@ -89,11 +89,10 @@ The plugin will not make you disappointed with ease of use, friendly & flexible -=-=-=-=-=-=-=-=-=- Shortcodes -=-=-=-=-=-=-=-=-=- - [opalestate_search_properties] => Show Search Properties horizontal form - - [opalestate_search_properties_v] => Show Search Properties vertical form - - [opalestate_search_properties_result] => Show Search Results - - [opalestate_search_map_properties] => Show Search Map Properties - - [opalestate_ajax_map_search] => Ajax Search Map Properties - - [opalestate_ajax_map_quick_search] => Ajax Search Map Properties + - [opalestate_search_properties_result] => Show Collection Results Working with + - [opalestate_search_map_properties] => Show Map + Search Box and Properties + - [opalestate_search_split_maps] => Ajax Search Split Map With Collection + - [opalestate_ajax_map_search] => Ajax Search Map Properties And Horizontal Search - [opalestate_register_form] => Register User Form - [opalestate_login_form] => Login Form - [opalestate_properties] => Display list of property estate in grid with pagination From 9200311fdbf31be5f04d4be6355a99c5f5ae880c Mon Sep 17 00:00:00 2001 From: ThemeLexus Date: Mon, 30 Sep 2019 11:25:41 +0700 Subject: [PATCH 5/8] uatpe --- readme.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.txt b/readme.txt index 7af56698..6232f73e 100755 --- a/readme.txt +++ b/readme.txt @@ -97,6 +97,8 @@ The plugin will not make you disappointed with ease of use, friendly & flexible - [opalestate_login_form] => Login Form - [opalestate_properties] => Display list of property estate in grid with pagination + - [opalestate_search_agents] => Dislay Search box and agents collection + = Elementor Widgets = * Search: Property Form From d8a0462533b24503514a16f6f913cfe7a174c2ac Mon Sep 17 00:00:00 2001 From: ThemeLexus Date: Mon, 30 Sep 2019 13:04:39 +0700 Subject: [PATCH 6/8] uapte --- inc/agency/class-opalestate-agency-front.php | 24 ++++++++++++++++++++ templates/shortcodes/search-agencies.php | 4 ++++ 2 files changed, 28 insertions(+) create mode 100644 templates/shortcodes/search-agencies.php diff --git a/inc/agency/class-opalestate-agency-front.php b/inc/agency/class-opalestate-agency-front.php index 2b027d7f..16519320 100755 --- a/inc/agency/class-opalestate-agency-front.php +++ b/inc/agency/class-opalestate-agency-front.php @@ -308,7 +308,31 @@ class Opalestate_Agency_Front { * */ public function register_shortcodes() { + $this->shortcodes = [ + 'search_agencies' => [ 'code' => 'search_agencies', 'label' => esc_html__( 'Search Agencies', 'opalestate-pro' ) ], + ]; + foreach ( $this->shortcodes as $shortcode ) { + add_shortcode( 'opalestate_' . $shortcode['code'], [ $this, $shortcode['code'] ] ); + } + } + + /** + * + */ + public function search_agencies ( $atts=[] ) { + + $atts = is_array( $atts ) ? $atts : []; + $layout = 'search-agency-form'; + + $default = array( + 'current_uri' => null, + 'form' => $layout + ); + + $atts = array_merge( $default, $atts ); + + return opalestate_load_template_path( 'shortcodes/search-agencies' , $atts ); } /** diff --git a/templates/shortcodes/search-agencies.php b/templates/shortcodes/search-agencies.php new file mode 100644 index 00000000..75e3805b --- /dev/null +++ b/templates/shortcodes/search-agencies.php @@ -0,0 +1,4 @@ +
+ $current_uri ) ); ?> +
+ \ No newline at end of file From 1d8c6dd6f825ec0eac26f0ff4adc7f51896b98b8 Mon Sep 17 00:00:00 2001 From: ThemeLexus Date: Mon, 30 Sep 2019 16:28:04 +0700 Subject: [PATCH 7/8] uapte --- .DS_Store | Bin 12292 -> 12292 bytes inc/admin/property/class-property.php | 1 + inc/agency/class-opalestate-agency-front.php | 18 +++++ inc/agency/class-opalestate-agency-query.php | 2 +- inc/agent/class-opalestate-agent-front.php | 24 ++++++- inc/agent/class-opalestate-agent-query.php | 2 +- inc/class-opalestate-email.php | 67 +++++++++++++++--- inc/class-opalestate-enqueue.php | 11 ++- inc/email/class-opalesate-approve.php | 10 ++- .../class-opalestate-email-notifycation.php | 22 ++++-- inc/email/class-opalestate-new-submitted.php | 4 +- .../class-opalestate-request-viewing.php | 13 +++- opal-estate-pro.php | 2 +- readme.txt | 3 + .../opalestate-agent-collection.php | 2 +- templates/rating/opalestate-ratings.php | 3 + templates/shortcodes/agency-carousel.php | 37 ++++++++++ templates/shortcodes/agent-carousel.php | 37 ++++++++++ 18 files changed, 228 insertions(+), 30 deletions(-) create mode 100644 templates/shortcodes/agency-carousel.php create mode 100644 templates/shortcodes/agent-carousel.php diff --git a/.DS_Store b/.DS_Store index 8449ada3698a0df0c3af5a1818b94437a189d124..6614a507823b2cd96b971505fed8947543e7241f 100755 GIT binary patch delta 58 ucmZokXi3rVydHHVQIFxTKx?>R+-7w>YV`JArH|2 delta 58 tcmZokXi3r2IN^-ns2UFf5VPdW^%Q9Cji`254!*W diff --git a/inc/admin/property/class-property.php b/inc/admin/property/class-property.php index 17e904eb..77b90964 100755 --- a/inc/admin/property/class-property.php +++ b/inc/admin/property/class-property.php @@ -38,6 +38,7 @@ class Opalestate_Admin_Property { // add_action( 'transition_post_status', array( __CLASS__, 'save_post' ), 10, 3 ); } + /** * */ diff --git a/inc/agency/class-opalestate-agency-front.php b/inc/agency/class-opalestate-agency-front.php index 16519320..f0301859 100755 --- a/inc/agency/class-opalestate-agency-front.php +++ b/inc/agency/class-opalestate-agency-front.php @@ -310,11 +310,29 @@ class Opalestate_Agency_Front { public function register_shortcodes() { $this->shortcodes = [ 'search_agencies' => [ 'code' => 'search_agencies', 'label' => esc_html__( 'Search Agencies', 'opalestate-pro' ) ], + 'agency_carousel' => [ 'code' => 'agency_carousel', 'label' => esc_html__( 'Agency Carousel', 'opalestate-pro' ) ], ]; foreach ( $this->shortcodes as $shortcode ) { add_shortcode( 'opalestate_' . $shortcode['code'], [ $this, $shortcode['code'] ] ); } + } + + public function agency_carousel ( $atts ) { + + $atts = is_array( $atts ) ? $atts : []; + + $default = array( + 'current_uri' => null, + 'column' => 3, + 'limit' => 12, + 'paged' => 1, + 'onlyfeatured' => 0, + ); + + $atts = array_merge( $default, $atts ); + + return opalestate_load_template_path( 'shortcodes/agency-carousel' , $atts ); } /** diff --git a/inc/agency/class-opalestate-agency-query.php b/inc/agency/class-opalestate-agency-query.php index 068ce992..4dadfe4b 100755 --- a/inc/agency/class-opalestate-agency-query.php +++ b/inc/agency/class-opalestate-agency-query.php @@ -5,7 +5,7 @@ * @version $Id$ * @package $package$ * @author Opal Team - * @copyright Copyright (C) 2014 wpopal.com. All Rights Reserved. + * @copyright Copyright (C) 2019 wpopal.com. All Rights Reserved. * @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html * * @website http://www.wpopal.com diff --git a/inc/agent/class-opalestate-agent-front.php b/inc/agent/class-opalestate-agent-front.php index d26f5b75..b366b1f6 100755 --- a/inc/agent/class-opalestate-agent-front.php +++ b/inc/agent/class-opalestate-agent-front.php @@ -3,7 +3,7 @@ * Opalestate_Agent_Front * * @author Opal Team - * @copyright Copyright (C) 2014 wpopal.com. All Rights Reserved. + * @copyright Copyright (C) 2019 wpopal.com. All Rights Reserved. */ // Exit if accessed directly @@ -307,14 +307,34 @@ class Opalestate_Agent_Front { 'change_agent_profile' => [ 'code' => 'change_agent_profile', 'label' => esc_html__( 'Agent Profile', 'opalestate-pro' ) ], 'search_agents' => [ 'code' => 'search_agents', 'label' => esc_html__( 'Search Agents', 'opalestate-pro' ) ], + 'agent_carousel' => [ 'code' => 'agent_carousel', 'label' => esc_html__( 'Agent Carousel', 'opalestate-pro' ) ], ]; - foreach ( $this->shortcodes as $shortcode ) { + foreach ( $this->shortcodes as $shortcode ) { add_shortcode( 'opalestate_' . $shortcode['code'], [ $this, $shortcode['code'] ] ); } } + public function agent_carousel ( $atts ) { + + $atts = is_array( $atts ) ? $atts : []; + $layout = 'search-agency-form'; + + $default = array( + 'current_uri' => null, + 'column' => 4, + 'limit' => 12, + 'paged' => 1, + 'onlyfeatured' => 0, + 'form' => $layout + ); + + $atts = array_merge( $default, $atts ); + + return opalestate_load_template_path( 'shortcodes/agent-carousel' , $atts ); + } + public function archives_query( $query ) { if ( $query->is_main_query() && is_post_type_archive( 'opalestate_agent' ) ) { diff --git a/inc/agent/class-opalestate-agent-query.php b/inc/agent/class-opalestate-agent-query.php index 0258be50..4935b51d 100755 --- a/inc/agent/class-opalestate-agent-query.php +++ b/inc/agent/class-opalestate-agent-query.php @@ -5,7 +5,7 @@ * @version $Id$ * @package $package$ * @author Opal Team - * @copyright Copyright (C) 2014 wpopal.com. All Rights Reserved. + * @copyright Copyright (C) 2019 wpopal.com. All Rights Reserved. * @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html * * @website http://www.wpopal.com diff --git a/inc/class-opalestate-email.php b/inc/class-opalestate-email.php index 83da6c80..7628d466 100755 --- a/inc/class-opalestate-email.php +++ b/inc/class-opalestate-email.php @@ -5,7 +5,7 @@ * @version $Id$ * @package $package$ * @author Opal Team - * @copyright Copyright (C) 2014 wpopal.com. All Rights Reserved. + * @copyright Copyright (C) 2019 wpopal.com. All Rights Reserved. * @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html * * @website http://www.wpopal.com @@ -287,6 +287,9 @@ class Opalestate_Emails { ], + //------------------------------------------ + + [ 'name' => esc_html__( 'Notification For New Property Submission', 'opalestate-pro' ), 'desc' => '
', @@ -354,7 +357,32 @@ class Opalestate_Emails { 'desc' => esc_html__( 'Enter the email a user should receive when they make an initial payment request.', 'opalestate-pro' ), 'default' => OpalEstate_Send_Email_Approve::get_default_template(), ], + /// enquire contact template //// + [ + 'name' => esc_html__( 'Email Enquiry Contact Templates (Template Tags)', 'opalestate-pro' ), + 'desc' => $contact_list_tags . '

', + 'id' => 'opalestate_title_email_settings_6_1', + 'type' => 'title', + ], + [ + 'id' => 'enquiry_email_subject', + 'name' => esc_html__( 'Email Subject', 'opalestate-pro' ), + 'type' => 'text', + 'desc' => esc_html__( 'The email subject a user should receive when they make an initial property request.', 'opalestate-pro' ), + 'attributes' => [ + 'placeholder' => 'Your property at I Love WordPress is pending', + get_bloginfo( 'name' ), + 'rows' => 3, + ], + 'default' => esc_html__( 'You got a message', 'opalestate-pro' ), + ], + [ + 'id' => 'enquiry_email_body', + 'name' => esc_html__( 'Email Body', 'opalestate-pro' ), + 'type' => 'wysiwyg', + 'default' => OpalEstate_Send_Email_Notification::get_default_template( 'enquiry' ) + ], /// email contact template //// [ 'name' => esc_html__( 'Email Contact Templates (Template Tags)', 'opalestate-pro' ), @@ -362,7 +390,6 @@ class Opalestate_Emails { 'id' => 'opalestate_title_email_settings_6', 'type' => 'title', ], - [ 'id' => 'contact_email_subject', 'name' => esc_html__( 'Email Subject', 'opalestate-pro' ), @@ -380,15 +407,33 @@ class Opalestate_Emails { 'id' => 'contact_email_body', 'name' => esc_html__( 'Email Body', 'opalestate-pro' ), 'type' => 'wysiwyg', - 'desc' => trim( preg_replace( '/\t+/', '', "Hi {receive_name},
- You have got message from {name} with email {email}. Here is detail: -
-
- {message} -
-  
-
- This message was sent by {site_link} on {current_time}." ) ), + 'default' => OpalEstate_Send_Email_Notification::get_default_template() + ], + /// Email Request Review /// + [ + 'name' => esc_html__( 'Email Request Review Templates (Template Tags)', 'opalestate-pro' ), + 'desc' => $contact_list_tags . '

', + 'id' => 'opalestate_title_email_settings_7', + 'type' => 'title', + ], + [ + 'id' => 'request_review_email_subject', + 'name' => esc_html__( 'Email Subject', 'opalestate-pro' ), + 'type' => 'text', + 'desc' => esc_html__( 'The email subject a user should receive when they make an initial property request.', 'opalestate-pro' ), + 'attributes' => [ + 'placeholder' => 'Your property at I Love WordPress is pending', + get_bloginfo( 'name' ), + 'rows' => 3, + ], + 'default' =>esc_html__( 'You have a message request reviewing at: %s', 'opalestate-pro' ), + ], + + [ + 'id' => 'request_review_email_body', + 'name' => esc_html__( 'Email Body', 'opalestate-pro' ), + 'type' => 'wysiwyg', + 'default' => OpalEstate_Send_Email_Request_Reviewing::get_default_template() ], ] ), diff --git a/inc/class-opalestate-enqueue.php b/inc/class-opalestate-enqueue.php index bd4633f7..9c66857d 100755 --- a/inc/class-opalestate-enqueue.php +++ b/inc/class-opalestate-enqueue.php @@ -103,6 +103,7 @@ class OpalEstate_Enqueue { * Register and enqueue javascript, css library */ public function register_enqueue() { + wp_register_script( 'jquery-modernizr', OPALESTATE_PLUGIN_URL . '/assets/3rd/magnific-popup/jquery.magnific-popup.min.js', @@ -112,6 +113,7 @@ class OpalEstate_Enqueue { '4.4.3', true ); + wp_enqueue_script( 'jquery-magnific-popup' ); wp_register_script( 'jquery-sticky-kit', trailingslashit( OPALESTATE_PLUGIN_URL ) . 'assets/3rd/sticky/jquery.sticky-kit.min.js', [], null, true ); wp_enqueue_script( 'jquery-sticky-kit' ); @@ -124,6 +126,7 @@ class OpalEstate_Enqueue { wp_enqueue_script( 'jquery-toast' ); + wp_register_script( 'jquery-swiper', OPALESTATE_PLUGIN_URL . '/assets/3rd/swiper/js/swiper.min.js', @@ -132,8 +135,12 @@ class OpalEstate_Enqueue { ], '4.4.3', true - ); - + ); + + if( !defined("ELEMENTOR_VERSION") ) { + wp_enqueue_style( 'jquery-swiper', OPALESTATE_PLUGIN_URL . '/assets/3rd/swiper/css/swiper.min.css' ); + } + wp_enqueue_script( 'jquery-swiper' ); } diff --git a/inc/email/class-opalesate-approve.php b/inc/email/class-opalesate-approve.php index 00d73846..0f5f8441 100755 --- a/inc/email/class-opalesate-approve.php +++ b/inc/email/class-opalesate-approve.php @@ -28,7 +28,11 @@ class OpalEstate_Send_Email_Approve extends OpalEstate_Abstract_Email_Template { */ public function get_subject () { $propety_title = '' ; - return sprintf( esc_html__( 'New Property Listing Submitted: {property_name}', 'opalestate-pro' ), $propety_title ); + + $subject = sprintf( esc_html__( 'The Property Listing Approved: {property_name}', 'opalestate-pro' ), $propety_title ); + $subject = opalestate_options( 'approve_email_body' , $subject ); + + return $subject; } /** @@ -58,7 +62,9 @@ class OpalEstate_Send_Email_Approve extends OpalEstate_Abstract_Email_Template { * */ public function get_content_template() { - return opalestate_load_template_path( 'emails/request-reviewing' ); + + $content = opalestate_options( 'approve_email_body' , self::get_default_template() ); + return $content; } /** diff --git a/inc/email/class-opalestate-email-notifycation.php b/inc/email/class-opalestate-email-notifycation.php index 220a7d7d..b28eb837 100755 --- a/inc/email/class-opalestate-email-notifycation.php +++ b/inc/email/class-opalestate-email-notifycation.php @@ -31,11 +31,17 @@ class OpalEstate_Send_Email_Notification extends OpalEstate_Abstract_Email_Templ public function get_subject () { switch ( $this->type ) { case 'enquiry': + $subject = html_entity_decode( esc_html__('You got a message enquiry', 'opalestate-pro') ); + $subject = opalestate_options( 'enquiry_email_subject', $subject ); + break; default: + $subject = html_entity_decode( esc_html__('You got a message contact', 'opalestate-pro') ); + $subject = opalestate_options( 'contact_email_subject', $subject ); + break; } @@ -46,14 +52,12 @@ class OpalEstate_Send_Email_Notification extends OpalEstate_Abstract_Email_Templ * Send Email */ public function get_content_template() { - switch ( $this->type ) { case 'enquiry': - return opalestate_load_template_path( 'emails/enquiry' ); + return opalestate_options( 'enquiry_email_body', self::get_default_template( 'enquiry' ) ); break; - default: - return opalestate_load_template_path( 'emails/contact' ); + return opalestate_options( 'contact_email_body', self::get_default_template( ) ); break; } } @@ -70,5 +74,15 @@ class OpalEstate_Send_Email_Notification extends OpalEstate_Abstract_Email_Templ $this->args['email'] = $this->args['receiver_email']; return parent::get_body(); } + + /***/ + public static function get_default_template ( $type='contact' ) { + + if( $type == 'enquiry' ) { + return opalestate_load_template_path( 'emails/enquiry' ); + } + + return opalestate_load_template_path( 'emails/contact' ); + } } ?> \ No newline at end of file diff --git a/inc/email/class-opalestate-new-submitted.php b/inc/email/class-opalestate-new-submitted.php index 76cf91b6..efa4bfc4 100755 --- a/inc/email/class-opalestate-new-submitted.php +++ b/inc/email/class-opalestate-new-submitted.php @@ -62,8 +62,7 @@ class OpalEstate_Send_Email_New_Submitted extends OpalEstate_Abstract_Email_Temp */ public function get_content_template() { - $body = opalestate_get_option( 'newproperty_email_body', self::newproperty_email_body() ); - + $body = opalestate_get_option( 'newproperty_email_body', self::get_default_template() ); return $body; } @@ -103,7 +102,6 @@ class OpalEstate_Send_Email_New_Submitted extends OpalEstate_Abstract_Email_Temp * Send Email */ public function get_body() { - return parent::get_body(); } } diff --git a/inc/email/class-opalestate-request-viewing.php b/inc/email/class-opalestate-request-viewing.php index 99ee9356..8eda4242 100755 --- a/inc/email/class-opalestate-request-viewing.php +++ b/inc/email/class-opalestate-request-viewing.php @@ -29,14 +29,18 @@ class OpalEstate_Send_Email_Request_Reviewing extends OpalEstate_Abstract_Email_ public function get_subject() { $propety_title = ''; - return sprintf( esc_html__( 'You have a message request reviewing: %s at', 'opalestate-pro' ), $propety_title ); + $content = sprintf( esc_html__( 'You have a message request reviewing: %s at', 'opalestate-pro' ), $propety_title ); + $content = opalestate_options( 'request_review_email_subject', $content ); + + return $content; } /** * Send Email */ public function get_content_template() { - return opalestate_load_template_path( 'emails/request-reviewing' ); + $content = opalestate_options( 'request_review_email_body', self::get_default_template() ); + return $content; } /** @@ -65,4 +69,9 @@ class OpalEstate_Send_Email_Request_Reviewing extends OpalEstate_Abstract_Email_ return parent::get_body(); } + + public static function get_default_template() { + return opalestate_load_template_path( 'emails/request-reviewing' ); + } + } diff --git a/opal-estate-pro.php b/opal-estate-pro.php index f373bd10..5c5935e2 100755 --- a/opal-estate-pro.php +++ b/opal-estate-pro.php @@ -3,7 +3,7 @@ * Plugin Name: Opal Estate Pro * Plugin URI: http://www.wpopal.com/product/opal-estate-wordpress-plugin/ * Description: Opal Real Estate Plugin is an ideal solution and brilliant choice for you to set up a professional estate website. - * Version: 1.0.7 + * Version: 1.0.8 * Author: WPOPAL * Author URI: http://www.wpopal.com * Requires at least: 4.6 diff --git a/readme.txt b/readme.txt index 6232f73e..cfe1b184 100755 --- a/readme.txt +++ b/readme.txt @@ -99,6 +99,9 @@ The plugin will not make you disappointed with ease of use, friendly & flexible - [opalestate_search_agents] => Dislay Search box and agents collection + - [opalestate_agent_carousel] => Display List of Agent in carousel style + - [opalestate_agency_carousel] => Display List of Agency in carousel style + = Elementor Widgets = * Search: Property Form diff --git a/templates/elementor-templates/opalestate-agent-collection.php b/templates/elementor-templates/opalestate-agent-collection.php index 4453299e..4ff77659 100755 --- a/templates/elementor-templates/opalestate-agent-collection.php +++ b/templates/elementor-templates/opalestate-agent-collection.php @@ -39,7 +39,7 @@
have_posts() ): ?> -
+
> have_posts() ): $query->the_post(); ?>
diff --git a/templates/rating/opalestate-ratings.php b/templates/rating/opalestate-ratings.php index a0468f6c..44c2b5f7 100755 --- a/templates/rating/opalestate-ratings.php +++ b/templates/rating/opalestate-ratings.php @@ -36,6 +36,9 @@ switch ( $supports[ $post_type ]['post_type'] ) { break; } +if( !is_object($object) ) { + return; +} $cpt_feature = $supports[ $post_type ]['features_cpt']; $features = Opalestate_Rating_Helper::get_features( $cpt_feature ); diff --git a/templates/shortcodes/agency-carousel.php b/templates/shortcodes/agency-carousel.php new file mode 100644 index 00000000..86ae6ab5 --- /dev/null +++ b/templates/shortcodes/agency-carousel.php @@ -0,0 +1,37 @@ +$limit, 'paged' => $paged), $onlyfeatured ); +$item = $column; +$data = [ + 'slidesPerView' => $item, + 'spaceBetween' => 30, + 'slidesPerGroup' => $item, + 'loop' => false, +]; + +?> + + \ No newline at end of file diff --git a/templates/shortcodes/agent-carousel.php b/templates/shortcodes/agent-carousel.php new file mode 100644 index 00000000..d6b8a50e --- /dev/null +++ b/templates/shortcodes/agent-carousel.php @@ -0,0 +1,37 @@ +$limit, 'paged' => $paged), $onlyfeatured ); +$item = $column; +$data = [ + 'slidesPerView' => $item, + 'spaceBetween' => 30, + 'slidesPerGroup' => $item, + 'loop' => false, +]; + +?> + + \ No newline at end of file From 151ddaf5a672332760ed48eed75035927d90e9cf Mon Sep 17 00:00:00 2001 From: Hoang Huu Date: Mon, 30 Sep 2019 16:40:08 +0700 Subject: [PATCH 8/8] Update emails --- inc/template-hook-functions.php | 12 +++++++++++- inc/vendors/opalmembership/membership.php | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/inc/template-hook-functions.php b/inc/template-hook-functions.php index 8425c4f4..56bf6d48 100755 --- a/inc/template-hook-functions.php +++ b/inc/template-hook-functions.php @@ -219,7 +219,13 @@ add_action( 'opalestate_single_property_preview', 'opalestate_property_preview', function opalestate_property_request_viewing_button( $islink = false ) { $class = $islink ? 'btn-link' : 'btn btn-primary'; - echo ' + if ( ! is_user_logged_in() ) { + $class .= ' opalestate-need-login'; + } else { + $class .= ' opalestate-popup-button'; + } + + echo ' ' . esc_html__( 'Request Viewing', 'opalestate-pro' ) . ' '; @@ -254,6 +260,10 @@ add_action( 'opalestate_single_property_layout', 'opalestate_single_property_lay * Forms */ function opalestate_property_request_view_form() { + if ( ! is_user_logged_in() ) { + return; + } + if ( ! is_single_property() ) { return; } diff --git a/inc/vendors/opalmembership/membership.php b/inc/vendors/opalmembership/membership.php index 5796386b..e64fa2d4 100755 --- a/inc/vendors/opalmembership/membership.php +++ b/inc/vendors/opalmembership/membership.php @@ -89,7 +89,7 @@ class OpalEstate_Membership { add_action( 'opalmembership_dashboard_container_before', [ __CLASS__, 'check_membership_validation_message' ] ); // included logic functions - require_once( 'free-package.php' ); + // require_once( 'free-package.php' ); require_once( 'functions.php' ); add_action( 'opalmembership_current_package_summary_after', [ __CLASS__, 'render_membership_summary' ], 10, 2 );