-
-
Save cdsaenz/8e5aa715e5f125a2074ee1562bfe8946 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