prunesplease
prunesplease

Reputation: 11

Woocommerce output variable sku's

I would like to know how to output woocommerce variable sku's. By default woocommerce should be able to change the sku if product variations are clicked but that function doesn't seem to work.

Any help would be grateful.

I know how to output the parent sku

$product->get_sku()

Upvotes: 0

Views: 1847

Answers (1)

user2541153
user2541153

Reputation: 471

you could use $available_variations = $product->get_available_variations(); which will create an array of all the variations. Then use a forloop to loop through the array to get each sku.

thanks

Upvotes: 1

Related Questions