Plugin Directory

Changeset 3033463


Ignore:
Timestamp:
02/09/2024 05:36:02 AM (2 years ago)
Author:
redmonkey73
Message:

Update to version 2.9 from GitHub

Location:
bonus-plus-wp
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • bonus-plus-wp/tags/2.9/assets/customer.js

    r3033150 r3033463  
    1616        }
    1717
    18         // if (typeof params['card_number'] != 'undefined' && params['card_number'] != null ){
    19         // }
    20        
    2118        // Регистрация
    2219        if (isElemetsExist){
     
    9592                beforeSend: function ( xhr ) {
    9693                    show(document.getElementById("loader"));           
    97                     hide(document.getElementById("bpwp-registration"));
    9894                    hide(document.getElementById("bpwp-verify-start"));
    9995                    hide(document.getElementById("bpmsg"));
     
    111107                    show(document.getElementById('bpmsg'));
    112108                    show(document.getElementById("bpwp-verify-end"));
    113                     hide(document.getElementById("bpwp-registration"));
    114109               
    115110                document.getElementById("bpwpSendOtp").addEventListener("click", function() {
  • bonus-plus-wp/tags/2.9/bonus-plus-wp.php

    r3033150 r3033463  
    1515 * WP requires at least: 6.0
    1616 * Tested up to: 6.4.2
    17  * Version: 2.8
     17 * Version: 2.9
    1818 */
    1919namespace BPWP;
     
    2828    public static function init()
    2929    {
    30         define('BPWP_PLUGIN_VERSION', '2.8');
     30        define('BPWP_PLUGIN_VERSION', '2.9');
    3131
    3232        require_once __DIR__ . '/functions.php';
  • bonus-plus-wp/tags/2.9/inc/ApiHelper.php

    r3033150 r3033463  
    118118                'quantity'  => $quantity
    119119            );
    120             do_action('logger', $items);
    121            
    122120        }
    123121
  • bonus-plus-wp/tags/2.9/inc/RestApiEndpoints.php

    r3033150 r3033463  
    117117        );
    118118       
    119         do_action('logger', $res);
    120 
    121119        // Если 204 - успех, создаем клиента: запрос POST /customer, phone обязательно
    122120        if ($res['code'] == 204) {
     
    126124            );
    127125           
    128             // TODO: Добавить запрос проверки существования пользвателя в б+
     126            // Код верный. Запрос проверки существования пользвателя в б+
     127            // Если такой номер существует, обновляем мета и редиректим
    129128            $get_customer = bpwp_api_request(
    130129                'customer',
     
    134133                'GET',
    135134            );
    136            
     135
    137136            if ($get_customer['code'] == 200) {
     137               
     138                update_user_meta($user_id, 'bonus-plus', $get_customer['request']);
    138139                $response = array(
    139                     'success' => false,
    140                     'message' => 'Ошибка. Пользователь уже существует!',
     140                    'success' => true,
     141                    'message' => 'Пользователь уже существует!',
     142                    'customer_created' => true, // проверим и редиректим на /my-account/bonus-plus/
    141143                );
    142144                wp_send_json($response);
    143145                wp_die();
    144146            }
    145 
     147           
    146148            $customer = bpwp_api_request(
    147149                'customer',
  • bonus-plus-wp/tags/2.9/inc/WooAccount.php

    r3033150 r3033463  
    258258            <!-- <div id="qrcode" style="display:none;"></div> -->
    259259
    260             <div id='bpwp-registration'>
     260            <div id='bpwp-registration' style="display:none;">
    261261                <p><?php echo __('Вы еще не зарегистрированы в программе лояльности', 'bonus-plus-wp') ?></p>
    262262            </div>
  • bonus-plus-wp/tags/2.9/readme.txt

    r3033150 r3033463  
    9393== Changelog ==
    9494
     95= 2.9 =
     96- линковка существующего клиента из б+ https://github.com/evgrezanov/bonus-plus-wp/issues/42
     97
    9598= 2.8 =
    9699- убрали поле "дата рождения" из личного кабинета https://github.com/evgrezanov/bonus-plus-wp/issues/58
  • bonus-plus-wp/trunk/assets/customer.js

    r3033150 r3033463  
    1616        }
    1717
    18         // if (typeof params['card_number'] != 'undefined' && params['card_number'] != null ){
    19         // }
    20        
    2118        // Регистрация
    2219        if (isElemetsExist){
     
    9592                beforeSend: function ( xhr ) {
    9693                    show(document.getElementById("loader"));           
    97                     hide(document.getElementById("bpwp-registration"));
    9894                    hide(document.getElementById("bpwp-verify-start"));
    9995                    hide(document.getElementById("bpmsg"));
     
    111107                    show(document.getElementById('bpmsg'));
    112108                    show(document.getElementById("bpwp-verify-end"));
    113                     hide(document.getElementById("bpwp-registration"));
    114109               
    115110                document.getElementById("bpwpSendOtp").addEventListener("click", function() {
  • bonus-plus-wp/trunk/bonus-plus-wp.php

    r3033150 r3033463  
    1515 * WP requires at least: 6.0
    1616 * Tested up to: 6.4.2
    17  * Version: 2.8
     17 * Version: 2.9
    1818 */
    1919namespace BPWP;
     
    2828    public static function init()
    2929    {
    30         define('BPWP_PLUGIN_VERSION', '2.8');
     30        define('BPWP_PLUGIN_VERSION', '2.9');
    3131
    3232        require_once __DIR__ . '/functions.php';
  • bonus-plus-wp/trunk/inc/ApiHelper.php

    r3033150 r3033463  
    118118                'quantity'  => $quantity
    119119            );
    120             do_action('logger', $items);
    121            
    122120        }
    123121
  • bonus-plus-wp/trunk/inc/RestApiEndpoints.php

    r3033150 r3033463  
    117117        );
    118118       
    119         do_action('logger', $res);
    120 
    121119        // Если 204 - успех, создаем клиента: запрос POST /customer, phone обязательно
    122120        if ($res['code'] == 204) {
     
    126124            );
    127125           
    128             // TODO: Добавить запрос проверки существования пользвателя в б+
     126            // Код верный. Запрос проверки существования пользвателя в б+
     127            // Если такой номер существует, обновляем мета и редиректим
    129128            $get_customer = bpwp_api_request(
    130129                'customer',
     
    134133                'GET',
    135134            );
    136            
     135
    137136            if ($get_customer['code'] == 200) {
     137               
     138                update_user_meta($user_id, 'bonus-plus', $get_customer['request']);
    138139                $response = array(
    139                     'success' => false,
    140                     'message' => 'Ошибка. Пользователь уже существует!',
     140                    'success' => true,
     141                    'message' => 'Пользователь уже существует!',
     142                    'customer_created' => true, // проверим и редиректим на /my-account/bonus-plus/
    141143                );
    142144                wp_send_json($response);
    143145                wp_die();
    144146            }
    145 
     147           
    146148            $customer = bpwp_api_request(
    147149                'customer',
  • bonus-plus-wp/trunk/inc/WooAccount.php

    r3033150 r3033463  
    258258            <!-- <div id="qrcode" style="display:none;"></div> -->
    259259
    260             <div id='bpwp-registration'>
     260            <div id='bpwp-registration' style="display:none;">
    261261                <p><?php echo __('Вы еще не зарегистрированы в программе лояльности', 'bonus-plus-wp') ?></p>
    262262            </div>
  • bonus-plus-wp/trunk/readme.txt

    r3033150 r3033463  
    9393== Changelog ==
    9494
     95= 2.9 =
     96- линковка существующего клиента из б+ https://github.com/evgrezanov/bonus-plus-wp/issues/42
     97
    9598= 2.8 =
    9699- убрали поле "дата рождения" из личного кабинета https://github.com/evgrezanov/bonus-plus-wp/issues/58
Note: See TracChangeset for help on using the changeset viewer.