How to get the Unit of measure label of product attributes like weight,Length etc in product detail page?

enter image description here

1 Answer 1


This settings comes from system configuration.

Weight: Stores -> Configurations -> Generale -> Locale Options -> Weight Unit

use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Store\Model\ScopeInterface;


 * @var ScopeConfigInterface
private $scopeConfig;

 * @param ScopeConfigInterface $scopeConfig
public function __construct(ScopeConfigInterface $scopeConfig)
    $this->scopeConfig = $scopeConfig;

Get value:

$weightUnit = $this->scopeConfig->getValue(

For dimension (width, length): here is the logic


($weightUnit === 'kgs') ? 'cm' : 'in'
  • How to get it from product detail page?
    – Mujahidh
    May 29, 2019 at 9:37
  • Check updated answer
    – Sohel Rana
    May 29, 2019 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.