Home Forums WoodMart – Premium Template add a text inside meta data

This topic contains 1 reply, has 2 voices, and was last updated by Artem Temos Artem Temos 5 days, 5 hours ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #215986

    saka
    Customer

    Hello,

    I want to post an attribute just over the SKU in product single page.

    I use below code and it post the data.
    If i put 41, It is under tags. https://prnt.sc/tsm96x
    If i put 39, It is above the line. Like : https://prnt.sc/tsm58t

    I want to show it just between SKU and the line made by the div.
    Is it possible?

    add_action( 'woocommerce_single_product_summary', 'show_model_name', 41 );
    function show_model_name(){
        global $product;
        $taxonomy = 'pa_model-adi';
        $value = $product->get_attribute( $taxonomy );
        if ( $value ) {
            $label = get_taxonomy( $taxonomy )->labels->singular_name;
            echo '<p><span style="color:#333"><b>' . $label . ': </b></span>' . $value . '</p>';
        }
    }
    #216137

    Hello,

    All metadata in WooCommerce are a part of one function and it is not possible to add some information between them with PHP hooks. Sorry, but we can’t change this in our theme scope.

    Kind Regards

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

You must be logged in to reply to this topic.