Created
          May 15, 2020 16:48 
        
      - 
      
- 
        Save piotrh/f455639e6d697d0a7b5234b8b34d228a to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // http:// url strony /wp-admin/admin-ajax.php?action=process_product | |
| add_action('wp_ajax_process_product', 'process_all_products'); | |
| function process_all_products() | |
| { | |
| $args = array( | |
| 'return' => 'ids' | |
| ); | |
| $products = wc_get_products($args); | |
| echo count($products).'<br/>'; | |
| foreach ($products as $productID) { | |
| $product = wc_get_product($productID); | |
| $available_variations = $product->get_available_variations(); | |
| foreach ($available_variations as $variation) { | |
| echo $variation['variation_id']."<br/>"; | |
| } | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment