Include dimension letters L/W/H to WooCommerce formatted product dimensions output

前端 未结 3 2090
盖世英雄少女心
盖世英雄少女心 2021-01-06 23:40

I\'m trying to modify dimensions output that everywhere where get_dimensions() is called instead of default it would include letter of dimensio

3条回答
  •  时光说笑
    2021-01-07 00:08

    $dimensions = $product->get_dimensions();
    
    if ( !empty( $dimensions) ) {
    
    echo 'Height: ' . $product->get_height() . get_option( 'woocommerce_dimension_unit' );
    
    echo 'Width: ' . $product->get_width() . get_option( 'woocommerce_dimension_unit' );
    
    echo 'Length: ' . $product->get_length() . get_option( 'woocommerce_dimension_unit' );
    
    }
    

提交回复
热议问题