1

I cannot figure out why this is just showing the variable name and isn't pulling in my sku from woocommerce. Do I need a global variable?

screenshot

Change SKU to say part number on single product page

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );

add_action( 'woocommerce_single_product_summary', 'custom_woocommerce_template_single_meta', 40 );

function custom_woocommerce_template_single_meta(){
    ob_start();
    ?>
    <div class="product_meta">
            <p><span class="sku_wrapper">Part Number: <span class="sku">'.$product_sku.'</span></span></p>
        <p><span class="posted_in">Category: <a href="https://pozzetta.com/product-category/photomask-carriers/" rel="tag">'.$product_category.'</a></span></p>
    </div>
    <?php
    return;
}
LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
danp
  • 33
  • 3

0 Answers0