Skip to content

Commit

Permalink
clear code
Browse files Browse the repository at this point in the history
  • Loading branch information
uptimizt committed Apr 5, 2020
1 parent 7b3cc5c commit 16e7d0b
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions inc/ProductsWalker.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
class ProductsWalker
{


public static $state_transient_key = 'wooms_products_walker_state';

public static $walker_hook_name = 'wooms_products_walker_batch';


Expand All @@ -22,15 +24,6 @@ class ProductsWalker
*/
public static function init()
{

add_action('init', function(){
if(isset($_GET['dd'])){
delete_transient('wooms_end_timestamp');

// self::add_schedule_hook();
var_dump(0); exit;
}
});
add_action('init', [__CLASS__, 'add_schedule_hook']);

//Main Walker
Expand All @@ -51,12 +44,9 @@ public static function init()

}


/**
* Load data and set product type simple
*
* @param $value
* @param $key
* @param $data
*/
public static function load_product($value)
{
Expand Down Expand Up @@ -104,6 +94,7 @@ public static function load_product($value)
* rename vars
*/
$data_api = $value;

/**
* Хук позволяет работать с методами WC_Product
* Сохраняет в БД все изменения за 1 раз
Expand All @@ -123,6 +114,7 @@ public static function load_product($value)
);
}


/**
* Update product from source data
*/
Expand Down Expand Up @@ -500,7 +492,6 @@ public static function stop_manually()
as_unschedule_all_actions(self::$walker_hook_name);
self::set_state('stop_manual', 1);
self::walker_finish();
// delete_transient( 'wooms_end_timestamp' );

wp_redirect(admin_url('admin.php?page=moysklad'));
exit;
Expand Down Expand Up @@ -557,6 +548,7 @@ public static function display_state()
<?php
}


/**
* User interface for manually actions
*/
Expand Down Expand Up @@ -606,6 +598,7 @@ public static function get_state($key = '')

}


/**
* set state data
*/
Expand Down

0 comments on commit 16e7d0b

Please sign in to comment.