Created
October 9, 2018 17:42
-
-
Save gorkamu/c8dd87eddccee2f91b29202525c043a8 to your computer and use it in GitHub Desktop.
Extended Woocommerce Variation Class
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
<?php | |
class Woo_WC_Product_Variable extends WC_Product_Variable { | |
public function get_all_variations() { | |
$available_variations = array(); | |
foreach($this->get_children() as $child_id){ | |
$variation = wc_get_product($child_id); | |
$available_variations[] = $this->get_available_variation($variation); | |
} | |
return array_values(array_filter($available_variations)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment