AEMexportervariable

The Woocommerce CSV Import AEM exporter variable class.

Defined (1)

The class is defined in the following location(s).

/export/products/variable.php  
  1. class variable extends simple implements productsInterface 
  2. public function __construct ($id, $fields, $writer) 
  3. parent::__construct( $id, $fields, $writer ); 
  4.  
  5. public function setProductType () { 
  6. $this->content[ 'product_type' ] = 'variation_master'; 
  7.  
  8. public function save () { 
  9. $this->writer->write( $this->getContent() ); 
  10. $this->children(); 
  11.  
  12.  
  13. public function children () 
  14. /** !1.0.1 added post_per_page-1 */ 
  15. $variation_ids = get_posts( array ( 
  16. 'posts_per_page' => -1,  
  17. 'post_type' => 'product_variation',  
  18. 'post_parent' => $this->id,  
  19. 'fields' => 'ids',  
  20. ) ); 
  21.  
  22. foreach ($variation_ids as $variation_id) { 
  23. $variation = new variation( $variation_id , $this->fields, $this->writer); 
  24. $variation->save();