🔞 ADULT: Changeset/ - Full Gallery 2025

Changeset 2975143


Ignore:
Timestamp:
10/05/2023 10:43:00 AM (2 years ago)
Author:
redmonkey73
Message:

2.5
Fixed the issue with exporting products and categories: https://github.com/evgrezanov/bonus-plus-wp/issues/28.
Display of accrued bonuses on the product page and in the shopping cart.
Updating accrued bonuses when paying for an order.

Location:
bonus-plus-wp/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • bonus-plus-wp/trunk/README.md

    r2886810 r2975143  
    66* Requires at least: 4.0
    77* Tested up to: 6.1.1
    8 * Stable tag: 2.4
     8* Stable tag: 2.5
    99* Requires PHP: 7.1
    1010* License: GPLv2 or later
     
    9393# Changelog
    9494
     95## 2.5
     96- исправлена проблема с экспортом товаров и категорий https://github.com/evgrezanov/bonus-plus-wp/issues/28
     97- отображение начисленных бонусов на страннице товара, корзины
     98- обновление начисленных бонусов при оплате заказа
     99
    95100## 2.4
    96101- добавлены настройки для вывода различного текста и ссылок для различных типов пользователей
  • bonus-plus-wp/trunk/bonus-plus-wp.php

    r2886810 r2975143  
    1515 * WP requires at least: 5.0
    1616 * Tested up to: 6.1.1
    17  * Version: 2.4
     17 * Version: 2.5
    1818 */
    1919namespace BPWP;
     
    2828    public static function init()
    2929    {
    30         define('BPWP_PLUGIN_VERSION', '2.4');
     30        define('BPWP_PLUGIN_VERSION', '2.5');
    3131
    3232        require_once __DIR__ . '/functions.php';
     
    7676        require_once __DIR__ . '/inc/ClientProfile.php';
    7777        require_once __DIR__ . '/inc/WooProductCatExport.php';
    78     }
     78        require_once __DIR__ . '/inc/ApiHelper.php';
     79        require_once __DIR__ . '/inc/CustomerBalance.php';
     80    }   
    7981
    8082    /**
  • bonus-plus-wp/trunk/functions.php

    r2577633 r2975143  
    3535
    3636    if ($type == 'POST') {
     37        $args = array(
     38            'method'      => $type,
     39            'headers'     => array(
     40                'Content-Type'  => 'application/json',
     41                'Authorization' => 'ApiKey ' . $token,
     42            ),
     43            'body'        => $params,
     44        );
     45    }
     46
     47    if ($type == 'PUT') {
     48        $args = array(
     49            'method'      => $type,
     50            'headers'     => array(
     51                'Content-Type'  => 'application/json',
     52                'Authorization' => 'ApiKey ' . $token,
     53            ),
     54            'body'        => $params,
     55        );
     56    }
     57
     58    if ($type == 'PATCH') {
    3759        $args = array(
    3860            'method'      => $type,
  • bonus-plus-wp/trunk/inc/WooProductCatExport.php

    r2605055 r2975143  
    3232    {
    3333        self::$lastExportOption = 'bpwp_last_products_export_date';
    34         self::$docUri = 'https://github.com/evgrezanov/bonus-plus-wp/wiki/Export-products-and-product-cat';
     34        self::$docUri = 'https://github.com/evgrezanov/bonus-plus-wp/wiki/%D0%AD%D0%BA%D1%81%D0%BF%D0%BE%D1%80%D1%82-%D0%BA%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D0%B9-%D0%B8-%D1%82%D0%BE%D0%B2%D0%B0%D1%80%D0%BE%D0%B2';
    3535        // set default values
    3636        self::$lastExport['message'] = empty(self::$lastExport['message']) ? __('Экспорт еще не производился','bonus-plus-wp') : self::$lastExport['message'];
     
    119119                $parent = $term->parent == 0 ? 0 : $term->parent;
    120120                $catId = $term->term_id;
     121
     122                if ($parent == 0) {
    121123                $product_cat = [
    122                     'id'  => $catId,
    123                     'pid' => $parent,
     124                    'id'  => (string)$catId,
    124125                    'n'   => $term->name,
    125126                    'g'   => true,
    126127                ];
     128                } else {
     129                    $product_cat = [
     130                        'id'  => (string)$catId,
     131                        'pid' => (string)$parent,
     132                        'n'   => $term->name,
     133                        'g'   => true,
     134                    ];
     135                }
     136
    127137                $product_cats[] = $product_cat;
    128138                // проверим есть ли у категории потомки
     
    219229                if ($product->is_type('simple') && $productCat >= 0){
    220230                    $productList[] = [
    221                         'id'  => $productId,
    222                         'pid' => $productCat,
     231                        'id'  => (string)$productId,
     232                        'pid' => (string)$productCat,
    223233                        'n'   => $productName,
    224234                        'g'   => false,
     
    233243           
    234244                        $var = wc_get_product($variationId);
    235                         $variationName = $var->get_formatted_name();
     245
     246                        // TODO: убрать из названия <span class="description"></span>
     247                        $variationName = $var->get_name();
    236248                       
    237249                        $productList[] = [
    238                             'id'  => $variationId,
    239                             'pid' => $productCat,
     250                            'id'  => (string)$variationId,
     251                            'pid' => (string)$productCat,
    240252                            'n'   => $variationName,
    241253                            'g'   => false,
     
    268280    public static function bpwp_api_products_cats_export($product = [])
    269281    {
    270 
    271282        if (empty($product)) {
    272283            $product_cat = apply_filters('bpwp_filter_export_product_cat', self::bpwp_api_product_cat_data_prepare());
     
    286297        }
    287298
    288    
    289299        /**
    290300         *  Описание передаваемых параметров https://bonusplus.pro/api/Help/ResourceModel?modelName=ProductImport
     
    298308        ];
    299309
    300         if (empty(self::$lastExport['message'])){
     310        // TODO: Исправить проверку. По другому признаку.
     311        if (self::$lastExport['message'] == 'Экспорт еще не производился'){
    301312            $export = bpwp_api_request(
    302313                'product/import',
     
    306317
    307318            if ($export){
    308                 add_option(self::$lastExportOption, date(DATE_ATOM, mktime(0, 0, 0, 7, 1, 2000)));
     319                update_option(self::$lastExportOption, current_time( 'd.m.Y H:i:s' ));
    309320                self::$lastExport['message'] = $export['message'];
    310321                self::$lastExport['class'] = $export['class'];
     322            } else {
     323                do_action(
     324                    'bpwp_logger_error',
     325                    $type = __CLASS__,
     326                    $title = __('Ошибка при экспорте категорий и товаров', 'bonus-plus-wp'),
     327                    $desc = $export,
     328                );
    311329            }
    312330        }
  • bonus-plus-wp/trunk/readme.txt

    r2886810 r2975143  
    55Requires at least: 4.0
    66Tested up to: 6.1.1
    7 Stable tag: 2.4
     7Stable tag: 2.5
    88Requires PHP: 7.1
    99License: GPLv2 or later
     
    9393== Changelog ==
    9494
     95= 2.5 =
     96- исправлена проблема с экспортом товаров и категорий https://github.com/evgrezanov/bonus-plus-wp/issues/28
     97- отображение начисленных бонусов на страннице товара, корзины
     98- обновление начисленных бонусов при оплате заказа
     99
    95100= 2.4 =
    96101- добавлены настройки для вывода различного текста и ссылок для различных типов пользователей
Note: See TracChangeset for help on using the changeset viewer.