Home Forums WoodMart support forum add a text inside meta data

add a text inside meta data

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

    roadlink
    Participant

    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

    Artem Temos
    Keymaster

    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)