Created
October 9, 2018 17:43
-
-
Save gorkamu/8c805984c59c24023ec07f2d4a6171b5 to your computer and use it in GitHub Desktop.
This file contains 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
<? | |
add_action( 'wp', 'woo_get_variations_attributes' ); | |
function woo_get_variations_attributes() | |
{ | |
if(is_product()) { | |
global $product; | |
$product_obj = get_page_by_path($product, OBJECT, 'product'); | |
$product_id = $product_obj->ID; | |
$product = new Woo_WC_Product_Variable($product_id); | |
$variations = $product->get_all_variations(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment