Display sku in single product page – with variations
-
I am using this code to make our site display SKUs on a product page and it works great:
add_action( ‘woocommerce_single_product_summary’, ‘dev_designs_show_sku’, 5 );
function dev_designs_show_sku(){
global $product;
echo ‘SKU: ‘ . $product->get_sku();
}Our only issue is that we have products with variations and when a customer selects a variant from the drop down, the displayed SKU remains the parent SKU – it doesn’t display the selected variant SKU.
Does anyone have any advice on this?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Display sku in single product page – with variations’ is closed to new replies.