Changeset 2975143
- Timestamp:
- 10/05/2023 10:43:00 AM (2 years ago)
- Location:
- bonus-plus-wp/trunk
- Files:
-
- 5 edited
-
README.md (modified) (2 diffs)
-
bonus-plus-wp.php (modified) (3 diffs)
-
functions.php (modified) (1 diff)
-
inc/WooProductCatExport.php (modified) (8 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bonus-plus-wp/trunk/README.md
r2886810 r2975143 6 6 * Requires at least: 4.0 7 7 * Tested up to: 6.1.1 8 * Stable tag: 2. 48 * Stable tag: 2.5 9 9 * Requires PHP: 7.1 10 10 * License: GPLv2 or later … … 93 93 # Changelog 94 94 95 ## 2.5 96 - исправлена проблема с экспортом товаров и категорий https://github.com/evgrezanov/bonus-plus-wp/issues/28 97 - отображение начисленных бонусов на страннице товара, корзины 98 - обновление начисленных бонусов при оплате заказа 99 95 100 ## 2.4 96 101 - добавлены настройки для вывода различного текста и ссылок для различных типов пользователей -
bonus-plus-wp/trunk/bonus-plus-wp.php
r2886810 r2975143 15 15 * WP requires at least: 5.0 16 16 * Tested up to: 6.1.1 17 * Version: 2. 417 * Version: 2.5 18 18 */ 19 19 namespace BPWP; … … 28 28 public static function init() 29 29 { 30 define('BPWP_PLUGIN_VERSION', '2. 4');30 define('BPWP_PLUGIN_VERSION', '2.5'); 31 31 32 32 require_once __DIR__ . '/functions.php'; … … 76 76 require_once __DIR__ . '/inc/ClientProfile.php'; 77 77 require_once __DIR__ . '/inc/WooProductCatExport.php'; 78 } 78 require_once __DIR__ . '/inc/ApiHelper.php'; 79 require_once __DIR__ . '/inc/CustomerBalance.php'; 80 } 79 81 80 82 /** -
bonus-plus-wp/trunk/functions.php
r2577633 r2975143 35 35 36 36 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') { 37 59 $args = array( 38 60 'method' => $type, -
bonus-plus-wp/trunk/inc/WooProductCatExport.php
r2605055 r2975143 32 32 { 33 33 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'; 35 35 // set default values 36 36 self::$lastExport['message'] = empty(self::$lastExport['message']) ? __('Экспорт еще не производился','bonus-plus-wp') : self::$lastExport['message']; … … 119 119 $parent = $term->parent == 0 ? 0 : $term->parent; 120 120 $catId = $term->term_id; 121 122 if ($parent == 0) { 121 123 $product_cat = [ 122 'id' => $catId, 123 'pid' => $parent, 124 'id' => (string)$catId, 124 125 'n' => $term->name, 125 126 'g' => true, 126 127 ]; 128 } else { 129 $product_cat = [ 130 'id' => (string)$catId, 131 'pid' => (string)$parent, 132 'n' => $term->name, 133 'g' => true, 134 ]; 135 } 136 127 137 $product_cats[] = $product_cat; 128 138 // проверим есть ли у категории потомки … … 219 229 if ($product->is_type('simple') && $productCat >= 0){ 220 230 $productList[] = [ 221 'id' => $productId,222 'pid' => $productCat,231 'id' => (string)$productId, 232 'pid' => (string)$productCat, 223 233 'n' => $productName, 224 234 'g' => false, … … 233 243 234 244 $var = wc_get_product($variationId); 235 $variationName = $var->get_formatted_name(); 245 246 // TODO: убрать из названия <span class="description"></span> 247 $variationName = $var->get_name(); 236 248 237 249 $productList[] = [ 238 'id' => $variationId,239 'pid' => $productCat,250 'id' => (string)$variationId, 251 'pid' => (string)$productCat, 240 252 'n' => $variationName, 241 253 'g' => false, … … 268 280 public static function bpwp_api_products_cats_export($product = []) 269 281 { 270 271 282 if (empty($product)) { 272 283 $product_cat = apply_filters('bpwp_filter_export_product_cat', self::bpwp_api_product_cat_data_prepare()); … … 286 297 } 287 298 288 289 299 /** 290 300 * Описание передаваемых параметров https://bonusplus.pro/api/Help/ResourceModel?modelName=ProductImport … … 298 308 ]; 299 309 300 if (empty(self::$lastExport['message'])){ 310 // TODO: Исправить проверку. По другому признаку. 311 if (self::$lastExport['message'] == 'Экспорт еще не производился'){ 301 312 $export = bpwp_api_request( 302 313 'product/import', … … 306 317 307 318 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' )); 309 320 self::$lastExport['message'] = $export['message']; 310 321 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 ); 311 329 } 312 330 } -
bonus-plus-wp/trunk/readme.txt
r2886810 r2975143 5 5 Requires at least: 4.0 6 6 Tested up to: 6.1.1 7 Stable tag: 2. 47 Stable tag: 2.5 8 8 Requires PHP: 7.1 9 9 License: GPLv2 or later … … 93 93 == Changelog == 94 94 95 = 2.5 = 96 - исправлена проблема с экспортом товаров и категорий https://github.com/evgrezanov/bonus-plus-wp/issues/28 97 - отображение начисленных бонусов на страннице товара, корзины 98 - обновление начисленных бонусов при оплате заказа 99 95 100 = 2.4 = 96 101 - добавлены настройки для вывода различного текста и ссылок для различных типов пользователей
Note: See TracChangeset
for help on using the changeset viewer.