[Skip to main content](#vessel-content)

#   Product show view - displaying height/width etc

##

- **[jasonm](/forum/user/712-jasonm "View jasonm's Profile")**
- [![jasonm's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/712-jasonm "View jasonm's Profile") Topic Author
- [ Offline](/forum/user/712-jasonm)

Less More

- Posts: 78
- Thank you received: 0
-
-

15 years 8 months ago [\#8606](#8606) by [jasonm](/forum/user/712-jasonm "View jasonm's Profile")  *[Product show view - displaying height/width etc](/forum/4-how-to/8606-product-show-view-displaying-height-width-etc#8606 "I have the following code  displaying the dimension on the product&#95;show view like this  What changes would I need to make to stop displaying these properties when their value is zero?")* was created by *[jasonm](/forum/user/712-jasonm "View jasonm's Profile")*

I have the following code Code:

&lt;table&gt; &lt;tr&gt;&lt;td&gt; &lt;span id="hikashop_product_height_main" class="hikashop_product_height_main"&gt; &lt;?php echo '&lt;strong&gt;Height:&amp;nbsp&lt;/strong&gt;&lt;/td&gt;&lt;td&gt; '.($this-&gt;element-&gt;product_height).' '.$this-&gt;element-&gt;product_dimension_unit; ?&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt; &lt;span id="hikashop_product_width_main" class="hikashop_product_width_main"&gt; &lt;?php echo '&lt;strong&gt;Width:&amp;nbsp&lt;/strong&gt;&lt;/td&gt;&lt;td&gt; '.($this-&gt;element-&gt;product_width).' '.$this-&gt;element-&gt;product_dimension_unit; ?&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt; &lt;span id="hikashop_product_length_main" class="hikashop_product_length_main"&gt; &lt;?php echo '&lt;strong&gt;Depth:&amp;nbsp&lt;/strong&gt;&lt;/td&gt;&lt;td&gt; '.($this-&gt;element-&gt;product_length).' '.$this-&gt;element-&gt;product_dimension_unit; ?&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&amp;nbsp&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt; &lt;span id="hikashop_product_length_main" class="hikashop_product_length_main"&gt; &lt;?php echo '&lt;strong&gt;Weight:&amp;nbsp&lt;/strong&gt;&lt;/td&gt;&lt;td&gt; '.($this-&gt;element-&gt;product_weight).' '.$this-&gt;element-&gt;product_weight_unit; ?&gt; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt;

displaying the dimension on the product_show view like this
[ ![&#91;img](http://www.hikashop.com/media/kunena/attachments/legacy/images/screenshot-20110219.jpg) ](http://www.hikashop.com/media/kunena/attachments/legacy/images/screenshot-20110219.jpg "&#91;img")

What changes would I need to make to stop displaying these properties when their value is zero?

- [ ![screenshot-20110219.jpg](/forum/attachment/558) ](/forum/attachment/558 "...t-20110219.jpg") [ ](/forum/attachment/558?download=1 "...t-20110219.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MDYtcHJvZHVjdC1zaG93LXZpZXctZGlzcGxheWluZy1oZWlnaHQtd2lkdGgtZXRjP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 8 months ago [\#8619](#8619) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Product show view - displaying height/width etc](/forum/4-how-to/8606-product-show-view-displaying-height-width-etc#8619 "I have the following code  displaying the dimension on the product&#95;show view like this  What changes would I need to make to stop displaying these properties when their value is zero?")*

For example, instead of :

echo '&lt;strong&gt;Height:&amp;nbsp&lt;/strong&gt;&lt;/td&gt;&lt;td&gt; '.($this-&gt;element-&gt;product_height).' '.$this-&gt;element-&gt;product_dimension_unit;

you should write:
if(bccomp($this-&gt;element-&gt;product_height,0,3)&gt;0){
echo '&lt;strong&gt;Height:&amp;nbsp&lt;/strong&gt;&lt;/td&gt;&lt;td&gt; '.($this-&gt;element-&gt;product_height).' '.$this-&gt;element-&gt;product_dimension_unit;
}

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MDYtcHJvZHVjdC1zaG93LXZpZXctZGlzcGxheWluZy1oZWlnaHQtd2lkdGgtZXRjP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jasonm](/forum/user/712-jasonm "View jasonm's Profile")**
- [![jasonm's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/712-jasonm "View jasonm's Profile") Topic Author
- [ Offline](/forum/user/712-jasonm)

Less More

- Posts: 78
- Thank you received: 0
-
-

15 years 8 months ago [\#8628](#8628) by [jasonm](/forum/user/712-jasonm "View jasonm's Profile")  Replied by *[jasonm](/forum/user/712-jasonm "View jasonm's Profile")* on topic *[Re: Product show view - displaying height/width etc](/forum/4-how-to/8606-product-show-view-displaying-height-width-etc#8628 "I have the following code  displaying the dimension on the product&#95;show view like this  What changes would I need to make to stop displaying these properties when their value is zero?")*

Perfect

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MDYtcHJvZHVjdC1zaG93LXZpZXctZGlzcGxheWluZy1oZWlnaHQtd2lkdGgtZXRjP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.052 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
