Hey!
We have a webshop for medical products, and there it is very important to show the SKU for all products. As far as I could see, it is not shown by default, so I added this snippet:
add_action('woocommerce_single_product_summary', 'display_product_sku_and_gtin');
function display_product_sku_and_gtin() {
global $product;
if ($product->get_sku()){
echo 'Artikelnummer: ' .$product->get_sku();
}
}
This is working great for normal products, but when I have a page with variants (see this one: Link it always just shows the SKU of the main product (FG 001-1-1) instead of the one of the variants (e.g. for 010 it would be FG 001-G-010). Is there a way how I could set it up that for variants it is showing the variants-SKU?
Thanks in advance!