- Posts: 101
- Thank you received: 10
Auto hide weight, width, height and length
- Impression eStudio
- Topic Author
- Offline
- Premium Member
Less
More
4 years 2 months ago - 4 years 2 months ago #139054
by Impression eStudio
Auto hide weight, width, height and length was created by Impression eStudio
Hi,
I think it would be nice to have the product info weight, width, height and length to be automatically hidden when there is no value (zero value) to them.
They should work the same as for example the manufacturer.
There are some products that have known values for weight, width, height and length but there are others that don't have.
So there is no need to show something like: Dimensions 0.00cm x 0.00cm x 0.00cm
For example, for the EShop version 3.3.1 in the file "components/com_eshop/themes/default/views/product/default.php"
the code that controls if the weight should be displayed could be changed from:
to
or
Also the code for the dimensions can change from:
to:
and the code:
to:
Thanks
I think it would be nice to have the product info weight, width, height and length to be automatically hidden when there is no value (zero value) to them.
They should work the same as for example the manufacturer.
There are some products that have known values for weight, width, height and length but there are others that don't have.
So there is no need to show something like: Dimensions 0.00cm x 0.00cm x 0.00cm
For example, for the EShop version 3.3.1 in the file "components/com_eshop/themes/default/views/product/default.php"
the code that controls if the weight should be displayed could be changed from:
Code:
if (EshopHelper::getConfigValue('show_product_weight'))
Code:
if (EshopHelper::getConfigValue('show_product_weight') && $this->item->product_weight>0)
Code:
if (EshopHelper::getConfigValue('show_product_weight') && !empty($this->item->product_weight) && $this->item->product_weight>0)
Also the code for the dimensions can change from:
Code:
if (EshopHelper::getConfigValue('show_product_dimensions'))
Code:
if (EshopHelper::getConfigValue('show_product_dimensions') && ((!empty($this->item->product_length) && $this->item->product_length>0) || (!empty($this->item->product_width) && $this->item->product_width>0) || (!empty($this->item->product_height) && $this->item->product_height>0)))
and the code:
Code:
<?php echo number_format($eshopLength->convert($this->item->product_length, $productLengthId, $lengthId), 2).EshopHelper::getLengthUnit($lengthId, JFactory::getLanguage()->getTag()) . ' x ' . number_format($eshopLength->convert($this->item->product_width, $productLengthId, $lengthId), 2).EshopHelper::getLengthUnit($lengthId, JFactory::getLanguage()->getTag()) . ' x ' . number_format($eshopLength->convert($this->item->product_height, $productLengthId, $lengthId), 2).EshopHelper::getLengthUnit($lengthId, JFactory::getLanguage()->getTag()); ?>
Code:
<?php
if (!empty($this->item->product_length) && $this->item->product_length>0)
{
echo number_format($eshopLength->convert($this->item->product_length, $productLengthId, $lengthId), 2).EshopHelper::getLengthUnit($lengthId, JFactory::getLanguage()->getTag());
}
if (!empty($this->item->product_length) && $this->item->product_length>0 && !empty($this->item->product_width) && $this->item->product_width>0)
{
echo ' x ';
}
if (!empty($this->item->product_width) && $this->item->product_width>0)
{
echo number_format($eshopLength->convert($this->item->product_width, $productLengthId, $lengthId), 2).EshopHelper::getLengthUnit($lengthId, JFactory::getLanguage()->getTag());
}
if ((!empty($this->item->product_length) && $this->item->product_length>0) || (!empty($this->item->product_width) && $this->item->product_width>0 && !empty($this->item->product_height) && $this->item->product_height>0))
{
echo ' x ';
}
if (!empty($this->item->product_height) && $this->item->product_height>0)
{
echo number_format($eshopLength->convert($this->item->product_height, $productLengthId, $lengthId), 2).EshopHelper::getLengthUnit($lengthId, JFactory::getLanguage()->getTag());
}
?>
Thanks
Last edit: 4 years 2 months ago by Impression eStudio. Reason: Add an example for the code chnage
Please Log in or Create an account to join the conversation.
- Giang Dinh Truong
- Offline
- Administrator
3 years 9 months ago #142255
by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Auto hide weight, width, height and length
Thank you!
This was already implemented in the latest version 3.3.2 of EShop.
Sincerely, Giang
This was already implemented in the latest version 3.3.2 of EShop.
Sincerely, Giang
Please Log in or Create an account to join the conversation.
Moderators: Giang Dinh Truong
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.