Changeset 2886810
- Timestamp:
- 03/25/2023 11:19:52 AM (3 years ago)
- Location:
- bonus-plus-wp
- Files:
-
- 39 added
- 2 deleted
- 4 edited
-
assets/screenshot-4.jpg (added)
-
assets/screenshot-5.png (added)
-
assets/scrrnshots-6.png (added)
-
tags/2.4 (added)
-
tags/2.4/LICENSE (added)
-
tags/2.4/README.md (added)
-
tags/2.4/assets (added)
-
tags/2.4/assets/account.js (added)
-
tags/2.4/assets/api (added)
-
tags/2.4/assets/api/request.js (added)
-
tags/2.4/assets/loader.css (added)
-
tags/2.4/assets/qrcodejs (added)
-
tags/2.4/assets/qrcodejs/qrcode.js (added)
-
tags/2.4/assets/qrcodejs/qrcode.min.js (added)
-
tags/2.4/assets/qrcodejs/script.js (added)
-
tags/2.4/assets/qrcodejs/style.css (added)
-
tags/2.4/bonus-plus-wp.php (added)
-
tags/2.4/functions.php (added)
-
tags/2.4/inc (added)
-
tags/2.4/inc/ClientProfile.php (added)
-
tags/2.4/inc/Logger.php (added)
-
tags/2.4/inc/MenuSettings.php (added)
-
tags/2.4/inc/WooAccount.php (added)
-
tags/2.4/inc/WooProductCatExport.php (added)
-
tags/2.4/readme.txt (added)
-
tags/2.4/templates (added)
-
tags/2.4/templates/client-account.php (added)
-
trunk/README.md (added)
-
trunk/assets/account.js (added)
-
trunk/assets/api (added)
-
trunk/assets/api/request.js (added)
-
trunk/assets/loader.css (added)
-
trunk/assets/verify-form (deleted)
-
trunk/bonus-plus-wp.php (modified) (3 diffs)
-
trunk/inc/ClientProfile.php (modified) (3 diffs)
-
trunk/inc/MenuSettings.php (modified) (3 diffs)
-
trunk/languages (deleted)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/screenshots (added)
-
trunk/screenshots/screenshot-1.jpg (added)
-
trunk/screenshots/screenshot-2.jpg (added)
-
trunk/screenshots/screenshot-3.jpg (added)
-
trunk/screenshots/screenshot-4.jpg (added)
-
trunk/screenshots/screenshot-5.png (added)
-
trunk/screenshots/scrrnshots-6.png (added)
Legend:
- Unmodified
- Added
- Removed
-
bonus-plus-wp/trunk/bonus-plus-wp.php
r2627045 r2886810 5 5 * Description: Интеграция WooCommerce и БонусПлюс. Для отображения данных пользователя используйте шорткод [bpwp_api_customer_bonus_card] 6 6 * Author: redmonkey73 7 * Author URI: http ://evgeniyrezanov.site7 * Author URI: https://github.com/evgrezanov/ 8 8 * Developer: redmonkey73 9 * Developer URI: http ://evgeniyrezanov.site9 * Developer URI: https://github.com/evgrezanov/ 10 10 * Text Domain: wp-bonus-plus 11 11 * Domain Path: /languages … … 14 14 * PHP requires at least: 7.0 15 15 * WP requires at least: 5.0 16 * Tested up to: 5.817 * Version: 2. 216 * Tested up to: 6.1.1 17 * Version: 2.4 18 18 */ 19 19 namespace BPWP; … … 28 28 public static function init() 29 29 { 30 define('BPWP_PLUGIN_VERSION', '2. 1');30 define('BPWP_PLUGIN_VERSION', '2.4'); 31 31 32 32 require_once __DIR__ . '/functions.php'; -
bonus-plus-wp/trunk/inc/ClientProfile.php
r2627045 r2886810 67 67 * Prepare customer data for display bonus card 68 68 * 69 * @return array 69 * @return array of properties of bonus cart 70 70 */ 71 71 public static function bpwp_api_prepare_customer_bonuses_data($customer_id = '') … … 91 91 92 92 } else { 93 93 94 // Если пользователь авторизован 94 95 $data = bpwp_api_get_customer_data(); … … 129 130 $url = apply_filters('bpwp_filter_goto_shop_url', $url); 130 131 131 // Возвращаем массив для бонусной карты132 $data['title'] = sprintf('%s %s', $allBonuses, __('бонусных рублей', 'bonus-plus-wp'));132 // Возвращаем массив для данных для виджета бонусной карты 133 $data['title'] = sprintf('%s %s', $allBonuses, __('бонусных ₽', 'bonus-plus-wp')); 133 134 $data['url'] = $url; 134 135 $data['desc'] = $desc; 135 136 $data['class'] = 'card3'; 137 138 // Проверим заполнены ли у порльзователя дата рождения и телефон 139 $user_id = get_current_user_id(); 140 $billing_birth_date = get_user_meta( $user_id, 'billing_birth_date', true ); 141 $billing_phone = get_user_meta(get_current_user_id(), 'billing_phone', true); 142 $bonus_plus = get_user_meta(get_current_user_id(), 'bonus-plus', true); 143 144 if ( empty( $billing_birth_date ) || empty($billing_phone) ) { 145 $data['title'] = __('ОШИБКА!', 'bonus-plus-wp'); 146 $data['url'] = get_option('bpwp_uri_customers_lk_billing_address'); 147 $data['desc'] = 'Добавьте дату рождения и/или номер телефона в личном кабинете'; 148 $data['class'] = 'card3'; 149 // или данные из Бонус+ пустые 150 } elseif (empty($bonus_plus)){ 151 $data['title'] = __('ОШИБКА!', 'bonus-plus-wp'); 152 $data['url'] = get_option('bpwp_msg_customers_not_verify_phone_number'); 153 $data['desc'] = 'Подтвердите номер телефона чтобы получать бонусы -->'; 154 $data['class'] = 'card3'; 155 // во всех остальных случаях 156 } else { 157 $data['title'] = sprintf('%s %s', $allBonuses, __('бонусных ₽', 'bonus-plus-wp')); 158 $data['url'] = $url; 159 $data['desc'] = $desc; 160 $data['class'] = 'card3'; 161 } 136 162 137 163 } -
bonus-plus-wp/trunk/inc/MenuSettings.php
r2576578 r2886810 161 161 add_settings_field( 162 162 $id = 'bpwp_msg_know_customers', 163 $title = __(' Идентифицированные пользователи', 'bonus-plus-wp'),163 $title = __('Текст для Идентифицированных пользователей', 'bonus-plus-wp'), 164 164 $callback = array(__CLASS__, 'display_msg_know_customers'), 165 165 $page = 'bpwp-settings', … … 170 170 add_settings_field( 171 171 $id = 'bpwp_msg_unknow_customers', 172 $title = __(' Неопознанные пользователи', 'bonus-plus-wp'),172 $title = __('Текст для неопознанных пользователей', 'bonus-plus-wp'), 173 173 $callback = array(__CLASS__, 'display_msg_unknow_customers'), 174 174 $page = 'bpwp-settings', 175 175 $section = 'bpwp_section_front_msgs' 176 176 ); 177 178 register_setting('bpwp-settings', 'bpwp_msg_customers_not_verify_phone_number'); 179 add_settings_field( 180 $id = 'bpwp_msg_customers_not_verify_phone_number', 181 $title = __('Ссылка для пользователей не верифицировавших номер телефона', 'bonus-plus-wp'), 182 $callback = array(__CLASS__, 'display_msg_customers_not_verify_phone_number'), 183 $page = 'bpwp-settings', 184 $section = 'bpwp_section_front_msgs' 185 ); 186 187 register_setting('bpwp-settings', 'bpwp_uri_customers_lk_billing_address'); 188 add_settings_field( 189 $id = 'bpwp_uri_customers_lk_billing_address', 190 $title = __('Ссылка для добавления телефона и даты рождения в ЛК', 'bonus-plus-wp'), 191 $callback = array(__CLASS__, 'display_uri_customers_lk_billing_address'), 192 $page = 'bpwp-settings', 193 $section = 'bpwp_section_front_msgs' 194 ); 177 195 178 196 register_setting('bpwp-settings', 'bpwp_uri_know_customers'); … … 233 251 } 234 252 253 /** 254 * display_msg_customers_not_verify_phone_number 255 * 256 * @return mixed 257 */ 258 public static function display_msg_customers_not_verify_phone_number() 259 { 260 printf( 261 '<input class="regular-text" type="text" name="bpwp_msg_customers_not_verify_phone_number" value="%s"/>', 262 esc_attr(get_option('bpwp_msg_customers_not_verify_phone_number')) 263 ); 264 265 printf( 266 '<p><small>%s</small></p>', 267 esc_html(__('Отобразится для пользователя который не верифицировал номер телефона в профиле', 'bonus-plus-wp')), 268 ); 269 } 270 271 /** 272 * display_uri_customers_lk_billing_address 273 * 274 * @return mixed 275 */ 276 public static function display_uri_customers_lk_billing_address() 277 { 278 printf( 279 '<input class="regular-text" type="text" name="bpwp_uri_customers_lk_billing_address" value="%s"/>', 280 esc_attr(get_option('bpwp_uri_customers_lk_billing_address')) 281 ); 282 283 printf( 284 '<p><small>%s</small></p>', 285 esc_html(__('Ссылка для заполнения биллинг адреса в ЛК пользователя', 'bonus-plus-wp')), 286 ); 287 } 288 235 289 /** 236 290 * display_uri_know_customers -
bonus-plus-wp/trunk/readme.txt
r2627045 r2886810 4 4 Tags: bonus, woocommerce, sync, integration 5 5 Requires at least: 4.0 6 Tested up to: 5.87 Stable tag: 2. 26 Tested up to: 6.1.1 7 Stable tag: 2.4 8 8 Requires PHP: 7.1 9 9 License: GPLv2 or later … … 93 93 == Changelog == 94 94 95 = 2.4 = 96 - добавлены настройки для вывода различного текста и ссылок для различных типов пользователей 97 95 98 = 2.1 = 96 99 - clear client meta after login
Note: See TracChangeset
for help on using the changeset viewer.