Skip to content

Commit

Permalink
release 9.8 (#523)
Browse files Browse the repository at this point in the history
* bump version
* transaction_query
* tests - refactroring
* fix: Перестала работать синхронизация на версии 9.6 #522
* readme
  • Loading branch information
aiiddqd authored Nov 27, 2023
1 parent 3cb8f21 commit 7e1b2ae
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 41 deletions.
2 changes: 1 addition & 1 deletion includes/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ public static function is_enable()
*/
public static function add_settings()
{
add_settings_section('wooms_section_orders', 'Заказы - передача в МойСклад', '', 'mss-settings');
add_settings_section('wooms_section_orders', 'Заказы', '', 'mss-settings');

$orders_sender_enable_key = 'wooms_orders_sender_enable';
register_setting('mss-settings', $orders_sender_enable_key);
Expand Down
8 changes: 3 additions & 5 deletions includes/ProductStocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,14 @@ public static function update_stock( $product, $data_api ) {
}

if ( empty( get_option( 'wooms_warehouse_count' ) ) ) {
$product->set_manage_stock( 'no' );
$product->set_manage_stock( true );
} else {
if ( $product->is_type( 'variable' ) ) {

//для вариативных товаров доступность определяется наличием вариаций
$product->set_manage_stock( 'no' );
$product->set_manage_stock( false );
} else {
$product->set_manage_stock( 'yes' );
$product->set_manage_stock( true );
}
}

Expand All @@ -227,8 +227,6 @@ public static function update_stock( $product, $data_api ) {
return $product;
}



/**
* restart walker after added tast to queue
*/
Expand Down
5 changes: 5 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ PHP 7.0

== Changelog ==

= 9.8 =
- Тест совместимости WooCommerce 8.3.1
- fix: Перестала работать синхронизация на версии 9.6 https://github.com/wpcraft-ru/wooms/issues/522


= 9.7 =
- Исправлено: похоже конвертация валюты сломалась... https://github.com/wpcraft-ru/wooms/issues/516
- Исправлено: улучшена работа с группами и категориями при наличии фильтрации https://github.com/wpcraft-ru/wooms/issues/520
Expand Down
3 changes: 3 additions & 0 deletions tests/includes/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
transaction_query( 'start' );

$can_start = wooms_can_start();

transaction_query('rollback');

return $can_start;

} );
Expand Down
30 changes: 29 additions & 1 deletion tests/includes/ProductStocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use function WooMS\Products\{get_product_id_by_uuid, process_rows};


test('assortment sync - base test - one product', function(){
test('остатки - должно указываться количество - не факт что работает', function(){
transaction_query('start');

$data = \WooMS\Tests\get_assortment();
Expand Down Expand Up @@ -37,7 +37,35 @@

});

test('assortment sync - base test - one product', function(){
transaction_query('start');

$data = \WooMS\Tests\get_assortment();

foreach($data['rows'] as $row){
if($row['id'] === 'e94c3184-7644-11ee-0a80-143f001044a3'){
break;
}
}

$product_id = wooms_get_product_id_by_uuid('e94c3184-7644-11ee-0a80-143f001044a3');

$product = wc_get_product($product_id);

$product = \WooMS\ProductStocks::update_stock($product, $row);

transaction_query('rollback');

if(empty($row['quantity'])){
throw new Error('$row[quantity] is empty');
}
if($row['quantity'] === $product->get_stock_quantity()){
return true;
}

return false;

});


test('assortment sync - base test', function(){
Expand Down
File renamed without changes.
33 changes: 0 additions & 33 deletions tests/tdd/t.php

This file was deleted.

2 changes: 1 addition & 1 deletion wooms.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* WC requires at least: 7.0
* WC tested up to: 7.2.2
*
* Version: 9.7
* Version: 9.8
*/

namespace WooMS;
Expand Down

0 comments on commit 7e1b2ae

Please sign in to comment.