How to get the width of Product UoM in magento2
Ex: Weight : 100 cm
Thanks.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this community$product->getTsDimensionsLength();
$product->getTsDimensionsWidth();
$product->getTsDimensionsHeight();
or use this
$height = $_product->getResource()->getAttribute('ts_dimensions_height');
$Value = $height->getFrontend()->getValue($_product);
$width = $_product->getResource()->getAttribute('ts_dimensions_width');
$Value = $width->getFrontend()->getValue($_product);
$length = $_product->getResource()->getAttribute('ts_dimensions_length');
$Value = $length->getFrontend()->getValue($_product);
You can get these values like below code
<?php if($product->getWidth()): ?>
<b>Width:</b><?php echo $product->getWidth(); ?>
<?php endif; ?>
Or if you want to display these values in More Information tab then just update these attributes by go to Stores -> Attributes -> Product from left side menu.
Click on Attribute you want to display inside details page.
Now click on Storefront Properties tab from left sidebar, Set Yes on Visible on Catalog Pages on Storefront.
and Save Atribute and Clear cache