Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //cd wp-content\plugins\business-ru-sync-product > text: all_sync.php
- $_SERVER["REMOTE_ADDR"] = '127.0.0.1';
- $base = dirname(__DIR__);
- include_once dirname(dirname($base))."/wp-load.php";
- include_once plugin_dir_path( __FILE__ ) . 'sync.php';
- /**
- * Синхронизация всех продуктов
- *
- */
- function all_sync()
- {
- $products = wc_get_products(['limit'=>-1]);
- $sync_product = new SyncBusinessRu();
- foreach ($products as $product ){
- if($product->get_type() == "simple"){
- if($sync_product->sync_api_product($product)){
- update_field("sync_business_ru", 1, $product->get_id() ); //синхронизируем sync_business_ru
- }
- }
- }
- }
- all_sync();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement