Skip to content

Commit

Permalink
release 9.6 (#517)
Browse files Browse the repository at this point in the history
* bump version
* readme
* tests
* Описание категории #463
* remove hook wooms_product_save
* small fixes and improve categories sync
* fix wooms_assortment_sync  #510
* refactoring
* small fixes ProductStocks
  • Loading branch information
aiiddqd authored Oct 29, 2023
1 parent 167b07e commit b26645a
Show file tree
Hide file tree
Showing 30 changed files with 18,329 additions and 2,779 deletions.
7 changes: 5 additions & 2 deletions includes/CurrencyConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
*/
class CurrencyConverter
{

const OPTION_KEY = 'wooms_currency_converter_enable';

public static function init()
{
add_filter('wooms_product_price', [__CLASS__, 'chg_price'], 33, 4);
Expand Down Expand Up @@ -115,7 +118,7 @@ public static function get_currency_code_price_meta($price_meta = [])

public static function is_enable()
{
if (get_option('wooms_currency_converter_enable')) {
if (get_option(self::OPTION_KEY)) {
return true;
}

Expand All @@ -127,7 +130,7 @@ public static function is_enable()
*/
public static function add_settings()
{
$option_key = 'wooms_currency_converter_enable';
$option_key = self::OPTION_KEY;

register_setting('mss-settings', $option_key);
add_settings_field(
Expand Down
3 changes: 1 addition & 2 deletions includes/ProductAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ class ProductAttributes
*/
public static function init()
{
add_filter('wooms_product_save', array(__CLASS__, 'update_product'), 10, 2);
add_filter('wooms_product_update', array(__CLASS__, 'update_product'), 10, 2);

add_filter('wooms_attributes', array(__CLASS__, 'update_country'), 10, 3);
add_filter('wooms_attributes', array(__CLASS__, 'save_other_attributes'), 10, 3);
add_filter('wooms_allow_data_types_for_attributes', array(__CLASS__, 'add_text'), 10, 1);

add_action('admin_init', array(__CLASS__, 'add_settings'), 150);
}

Expand Down
16 changes: 2 additions & 14 deletions includes/ProductGallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,9 @@ class ProductGallery
public static function init()
{


// add_action('init', function(){
// if(!isset($_GET['dd'])){
// return;
// }

// self::download_images_by_id(12237);


// dd(0);
// });

add_action('gallery_images_download_schedule', [__CLASS__, 'download_images_from_metafield']);

add_filter('wooms_product_save', [__CLASS__, 'update_product'], 40, 3);
add_filter('wooms_product_update', [__CLASS__, 'update_product'], 40, 2);

add_action('admin_init', [__CLASS__, 'settings_init'], 70);

Expand Down Expand Up @@ -116,7 +104,7 @@ public static function render_state_info()
/**
* update_product
*/
public static function update_product($product, $data_api, $data)
public static function update_product($product, $data_api)
{

if (empty(get_option('woomss_gallery_sync_enabled'))) {
Expand Down
13 changes: 1 addition & 12 deletions includes/ProductGrouped.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,9 @@ class ProductGrouped extends AbstractWalker
public static function init()
{

// add_action('init', function () {
// if (!isset($_GET['dd'])) {
// return;
// }

// self::set_state('timestamp_start', 0);
// self::batch_handler();

// dd(0);
// });

add_action('wooms_bundle_walker_batch', [__CLASS__, 'batch_handler']);

add_filter('wooms_product_save', array(__CLASS__, 'update_product'), 40, 2);
add_filter('wooms_product_update', array(__CLASS__, 'update_product'), 40, 2);

add_action('wooms_main_walker_finish', array(__CLASS__, 'reset_after_main_walker_finish'));
add_action('wooms_wakler_variations_finish', array(__CLASS__, 'reset_after_main_walker_finish'));
Expand Down
5 changes: 3 additions & 2 deletions includes/ProductSingleSync.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}

/**
* Single Product Import
* Опция которая позволяет синхронизировать продукт по отдельности
*/
class ProductSingleSync
{
Expand Down Expand Up @@ -162,7 +162,8 @@ public static function update_variations($product_id = 0)
foreach ($data_api['rows'] as $item) {
$i++;

do_action('wooms_products_variations_item', $item);
\WooMS\ProductVariable::update_variation( $item );
// do_action('wooms_products_variations_item', $item);
}

self::set_state('offset', self::get_state('offset') + $i);
Expand Down
Loading

0 comments on commit b26645a

Please sign in to comment.