Your account expired support, please renew to get your support.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4517
    rand0m
    Support Expired

    Greetings,

    I’m trying to implement in shop product loop additional code, which displays below title product SKU. Somehow it doesn’t work. Changes are made in child theme.

    Code

    // Add SKU and custom text to product list
    function display_sku_and_custom_text_in_product_list() {
        global $product;
    
        // Check if the product has a SKU
        $sku = $product->get_sku();
    
        // Display SKU
        if ($sku) {
            echo '<div class="product-sku">SKU: ' . esc_html($sku) . '</div>';
        }
    
        // Display custom text
        echo '<div class="custom-text">Test</div>';
    }
    add_action('woocommerce_before_shop_loop_item_title', 'display_sku_and_custom_text_in_product_list', 10);
    #4526

    Dear mate,

    Unfortunately, this is not an option built into the theme at the moment. It requires customization and would cost you an extra fee.

    Thanks.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.