Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Deprecated: WC_Product::get_dimensions error fix

add_action( 'woocommerce_single_product_summary', 'baba_spec', 35 );
 
function baba_spec() { 
    global $product;
    $dimensions = wc_format_dimensions($product->get_dimensions(false));
        if ( $product->has_dimensions() ) {
            $label = __( 'Dimensions: ', 'babasouktextdomain' );
            print '<span class="wpcf-field-name">' . $label . '</span>'; 
            echo '<span class="dimensions">' . $dimensions . '</span>';
        }
            print '</div>';
}
Source by gasolicious.com #
 
PREVIOUS NEXT
Tagged: #error #fix
ADD COMMENT
Topic
Name
8+2 =