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

#   Affichage des dimensions

##

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

Less More

- Posts: 21
- Thank you received: 0
-
-

15 years 7 months ago -  15 years 7 months ago [\#12824](#12824) by [gab696](/forum/user/1837-gab696 "View gab696's Profile")  *[Affichage des dimensions](/forum/5-support-en-francais-french-support-/12824-affichage-des-dimensions#12824 "Bonjour, J'ai modifié le fichier show.php afin d'obtenir un affichage des dimensions de l'objet. Tout fonctionne parfaitement mais j'aimerais que ces dimensions s'affichent uniquement aux objets auquel j'indique une valeur autre que 0 Merci d'avance pour votre aide !  la partie modifiée:  element-&gt;product&#95;width).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;length).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;height).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt;   le fichier complet:   element)){ $app =&amp; JFactory::getApplication(); $app-&gt;enqueueMessage(JText::&#95;('PRODUCT&#95;NOT&#95;FOUND')); }else{ ?&gt;     element-&gt;product&#95;name; ?&gt;        element-&gt;images)){ $image = reset($this-&gt;element-&gt;images); if(!$this-&gt;config-&gt;get('thumbnail')){ echo 'file&#95;name.'&quot; id=&quot;hikashop&#95;main&#95;image&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot; /&gt;'; }else{ $height = $this-&gt;config-&gt;get('thumbnail&#95;y'); $style=''; if(count($this-&gt;element-&gt;images)&gt;1){ if(!empty($height)){ $style=' style=&quot;height:'.($height+5).'px;&quot;'; } } ?&gt; div class=&quot;hikashop&#95;product&#95;main&#95;image&#95;thumb&quot; id=&quot;hikashop&#95;main&#95;image&#95;thumb&#95;div&quot;  &gt; image-&gt;display($image-&gt;file&#95;path,true,$image-&gt;file&#95;name,'id=&quot;hikashop&#95;main&#95;image&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot;','id=&quot;hikashop&#95;main&#95;image&#95;link&quot;'); ?&gt;   element-&gt;images)&gt;1){ foreach($this-&gt;element-&gt;images as $image){ echo $this-&gt;image-&gt;display($image-&gt;file&#95;path,'hikashop&#95;main&#95;image',$image-&gt;file&#95;name,'class=&quot;hikashop&#95;child&#95;image&quot;'); } } } ?&gt;      params-&gt;get('show&#95;price')){ $this-&gt;row =&amp; $this-&gt;element; $this-&gt;setLayout('listing&#95;price'); echo $this-&gt;loadTemplate(); } ?&gt;   element-&gt;product&#95;code; ?&gt;  element-&gt;product&#95;weight) &amp;&amp; bccomp($this-&gt;element-&gt;product&#95;weight,0,3)){ ?&gt;  element-&gt;product&#95;weight.' '.JText::&#95;($this-&gt;element-&gt;product&#95;weight&#95;unit); ?&gt;  element-&gt;characteristics)){ ?&gt;characteristic-&gt;displayFE($this-&gt;element,$this-&gt;params); ?&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;length).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;height).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt;     php echo JHTML::&#95;('content.prepare',preg&#95;replace('##i','',$this-&gt;element-&gt;product&#95;description)); ?&gt;   element-&gt;product&#95;url)){ echo JText::sprintf('MANUFACTURER&#95;URL',''.$this-&gt;element-&gt;product&#95;url.''); } ?&gt;      nput type=&quot;hidden&quot; name=&quot;return&#95;url&quot; value=&quot;redirect&#95;url)));?&gt;&quot;/&gt;  element-&gt;variants)){ foreach($this-&gt;element-&gt;variants as $variant){ $variant&#95;name = array(); if(!empty($variant-&gt;characteristics)){ foreach($variant-&gt;characteristics as $k =&gt; $ch){ $variant&#95;name&#91;&#93;=$ch-&gt;characteristic&#95;id; } } $variant&#95;name = implode('&#95;',$variant&#95;name); if(!empty($variant-&gt;images)){ ?&gt;   images); if(!$this-&gt;config-&gt;get('thumbnail')){ echo 'file&#95;name.'&quot; id=&quot;hikashop&#95;main&#95;image&#95;'.$variant&#95;name.'&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot; /&gt;'; }else{ $style=''; if(count($variant-&gt;images)&gt;1){ $height = $this-&gt;config-&gt;get('thumbnail&#95;y'); if(!empty($height)){ $style=' style=&quot;height:'.($height+5).'px;&quot;'; } } ?&gt; div class=&quot;hikashop&#95;product&#95;main&#95;image&#95;thumb&quot; id=&quot;hikashop&#95;main&#95;image&#95;thumb&#95;div&#95;&quot; &gt; image-&gt;display($image-&gt;file&#95;path,true,$image-&gt;file&#95;name,'id=&quot;hikashop&#95;main&#95;image&#95;'.$variant&#95;name.'&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot;','id=&quot;hikashop&#95;main&#95;image&#95;'.$variant&#95;name.'&#95;link&quot;'); ?&gt;  images)&gt;1){ ?&gt; images as $image){ echo $this-&gt;image-&gt;display($image-&gt;file&#95;path,'hikashop&#95;main&#95;image&#95;'.$variant&#95;name,$image-&gt;file&#95;name,'class=&quot;hikashop&#95;child&#95;image&quot;'); } } ?&gt;     product&#95;contact)))){ echo false;'); } ?&gt;  product&#95;name;?&gt;   product&#95;code;?&gt;   params-&gt;get('show&#95;price')){ $this-&gt;row =&amp; $variant; $this-&gt;setLayout('listing&#95;price'); echo $this-&gt;loadTemplate(); } ?&gt;   row =&amp; $variant; $this-&gt;ajax = 'if(hikashopCheckChangeForm(&#92;'item&#92;',&#92;'hikashop&#95;product&#95;form&#92;')){ return hikashopModifyQuantity(&#92;''.$this-&gt;row-&gt;product&#95;id.'&#92;',field,1'.$form.'); } else { return false; }'; $this-&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); ?&gt;   php echo JHTML::&#95;('content.prepare',preg&#95;replace('##i','',$variant-&gt;product&#95;description));?&gt;   product&#95;weight) &amp;&amp; bccomp($variant-&gt;product&#95;weight,0,3)){ echo $variant-&gt;product&#95;weight.' '.JText::&#95;($variant-&gt;product&#95;weight&#95;unit); }?&gt;   product&#95;url)){ echo JText::sprintf('MANUFACTURER&#95;URL',''.$variant-&gt;product&#95;url.''); } ?&gt;   nput type=&quot;hidden&quot; name=&quot;product&#95;id&quot; value=&quot;product&#95;id; ?&gt;&quot; /&gt;  params-&gt;set('show&#95;price&#95;weight',0); ?&gt;  modules) &amp;&amp; is&#95;array($this-&gt;modules)){ jimport('joomla.application.module.helper'); foreach($this-&gt;modules as $module){ echo JModuleHelper::renderModule($module); } } ?&gt;   get('comments&#95;feature') == 'jcomments'){ $comments = HIKASHOP&#95;ROOT.'components'.DS.'com&#95;jcomments'.DS.'jcomments.php'; if (file&#95;exists($comments)) { require&#95;once($comments); echo JComments::showComments($this-&gt;element-&gt;product&#95;id, 'com&#95;hikashop', $this-&gt;element-&gt;product&#95;name); } }elseif($config-&gt;get('comments&#95;feature') == 'jomcomment'){ $comments = HIKASHOP&#95;ROOT.'plugins'.DS.'content'.DS.'jom&#95;comment&#95;bot.php'; if (file&#95;exists($comments)) { require&#95;once($comments); echo jomcomment($this-&gt;element-&gt;product&#95;id, 'com&#95;hikashop'); } } ?&gt;  ")* was created by *[gab696](/forum/user/1837-gab696 "View gab696's Profile")*

Bonjour,
J'ai modifié le fichier show.php afin d'obtenir un affichage des dimensions de l'objet.
Tout fonctionne parfaitement mais j'aimerais que ces dimensions s'affichent uniquement aux objets auquel j'indique une valeur autre que 0
Merci d'avance pour votre aide !

la partie modifiée:
&lt;span id="hikashop_product_volume_main" class="hikashop_product_volume_main"&gt;
&lt;?php echo JText::_('PRODUCT_WIDTH').': '.($this-&gt;element-&gt;product_width).' '.$this-&gt;element-&gt;product_dimension_unit; ?&gt;&lt;br /&gt;
&lt;?php echo JText::_('PRODUCT_LENGTH').': '.($this-&gt;element-&gt;product_length).' '.$this-&gt;element-&gt;product_dimension_unit; ?&gt;&lt;br /&gt;
&lt;?php echo JText::_('PRODUCT_HEIGHT').': '.($this-&gt;element-&gt;product_height).' '.$this-&gt;element-&gt;product_dimension_unit; ?&gt;&lt;/sup&gt;
&lt;/span&gt;

le fichier complet:
&lt;?php
/**
* @package HikaShop for Joomla!
* @version 1.4.8
* @author hikashop.com
* @copyright (C) 2010 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 [ www.gnu.org/licenses/gpl-3.0.html](http://www.gnu.org/licenses/gpl-3.0.html)
*/
defined('_JEXEC') or die('Restricted access');
?&gt;
&lt;div id="hikashop_product_&lt;?php echo $this-&gt;element-&gt;product_code; ?&gt;_page" class="hikashop_product_page"&gt;
&lt;?php if(empty($this-&gt;element)){
$app =&amp; JFactory::getApplication();
$app-&gt;enqueueMessage(JText::_('PRODUCT_NOT_FOUND'));
}else{
?&gt;
&lt;form action="&lt;?php echo hikashop::completeLink('product&amp;task=updatecart'); ?&gt;" method="post" name="hikashop_product_form" enctype="multipart/form-data"&gt;
&lt;div id="hikashop_product_top_part" class="hikashop_product_top_part"&gt;
&lt;h4&gt;
&lt;span id="hikashop_product_name_main" class="hikashop_product_name_main"&gt;
&lt;?php
echo $this-&gt;element-&gt;product_name;
?&gt;
&lt;/span&gt;

&lt;/h4&gt;
&lt;/div&gt;
&lt;div id="hikashop_product_left_part" class="hikashop_product_left_part"&gt;
&lt;div id="hikashop_product_image_main" &gt;
&lt;div id="hikashop_main_image_div"&gt;
&lt;?php
if(!empty($this-&gt;element-&gt;images)){
$image = reset($this-&gt;element-&gt;images);
if(!$this-&gt;config-&gt;get('thumbnail')){
echo '&lt;img src="'.$this-&gt;image-&gt;uploadFolder_url.$image-&gt;file_path.'" alt="'.$image-&gt;file_name.'" id="hikashop_main_image" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle" /&gt;';
}else{
$height = $this-&gt;config-&gt;get('thumbnail_y');
$style='';
if(count($this-&gt;element-&gt;images)&gt;1){
if(!empty($height)){
$style=' style="height:'.($height+5).'px;"';
}
} ?&gt;
&lt;div class="hikashop_product_main_image_thumb" id="hikashop_main_image_thumb_div" &lt;?php echo $style;?&gt; &gt;
&lt;?php echo $this-&gt;image-&gt;display($image-&gt;file_path,true,$image-&gt;file_name,'id="hikashop_main_image" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"','id="hikashop_main_image_link"'); ?&gt;
&lt;/div&gt;
&lt;?php }
?&gt;
&lt;/div&gt;&lt;div id="hikashop_small_image_div"&gt;&lt;?php
if(count($this-&gt;element-&gt;images)&gt;1){
foreach($this-&gt;element-&gt;images as $image){
echo $this-&gt;image-&gt;display($image-&gt;file_path,'hikashop_main_image',$image-&gt;file_name,'class="hikashop_child_image"');
}
}
}
?&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="hikashop_product_right_part" class="hikashop_product_right_part"&gt;
&lt;span id="hikashop_product_price_main" class="hikashop_product_price_main"&gt;
&lt;?php
if($this-&gt;params-&gt;get('show_price')){
$this-&gt;row =&amp; $this-&gt;element;
$this-&gt;setLayout('listing_price');
echo $this-&gt;loadTemplate();
}
?&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span id="hikashop_product_code_main" class="hikashop_product_code_main"&gt;
&lt;?php
echo $this-&gt;element-&gt;product_code;
?&gt;
&lt;/span&gt;
&lt;?php if(isset($this-&gt;element-&gt;product_weight) &amp;&amp; bccomp($this-&gt;element-&gt;product_weight,0,3)){ ?&gt;
&lt;span id="hikashop_product_weight_main" class="hikashop_product_weight_main"&gt;
&lt;?php echo JText::_('PRODUCT_WEIGHT').': '.$this-&gt;element-&gt;product_weight.' '.JText::_($this-&gt;element-&gt;product_weight_unit); ?&gt;&lt;br /&gt;
&lt;/span&gt;
&lt;?php
}
if(!empty($this-&gt;element-&gt;characteristics)){
?&gt;&lt;span id="hikashop_product_characteristics" class="hikashop_product_characteristics"&gt;&lt;?php
echo $this-&gt;characteristic-&gt;displayFE($this-&gt;element,$this-&gt;params);
?&gt;&lt;/span&gt;&lt;br /&gt;&lt;?php
}
$form = '';
?&gt;
&lt;?php
if(!$this-&gt;params-&gt;get('catalogue') &amp;&amp; ($this-&gt;config-&gt;get('display_add_to_cart_for_free_products') &#124;&#124; !empty($this-&gt;element-&gt;prices))){
if(!empty($this-&gt;itemFields)){
$form = ',\'hikashop_product_form\'';
if($this-&gt;config-&gt;get('redirect_url_after_add_cart','stay_if_cart')=='ask_user'){ ?&gt;
&lt;input type="hidden" name="popup" value="1"/&gt;
&lt;?php } ?&gt;
&lt;div id="hikashop_product_custom_item_info" class="hikashop_product_custom_item_info"&gt;
&lt;table width="100%"&gt;
&lt;?php
foreach($this-&gt;itemFields as $fieldName =&gt; $oneExtraField) { ?&gt;
&lt;tr class="hikashop_item_&lt;?php echo $oneExtraField-&gt;field_namekey;?&gt;_line"&gt;
&lt;td class="key"&gt;
&lt;span id="hikashop_product_custom_item_name_&lt;?php echo $oneExtraField-&gt;field_id;?&gt;" class="hikashop_product_custom_item_name"&gt;
&lt;?php echo $this-&gt;fieldsClass-&gt;getFieldName($oneExtraField);?&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;span id="hikashop_product_custom_item_value_&lt;?php echo $oneExtraField-&gt;field_id;?&gt;" class="hikashop_product_custom_item_value"&gt;
&lt;?php echo $this-&gt;fieldsClass-&gt;display($oneExtraField,null,'data[item]'); ?&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;?php
}?&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;?php }
} ?&gt;
&lt;span id="hikashop_product_quantity_main" class="hikashop_product_quantity_main"&gt;&lt;?php
$this-&gt;row =&amp; $this-&gt;element;
$this-&gt;ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\''.$this-&gt;row-&gt;product_id.'\',field,1'.$form.'); } else { return false; }';
$this-&gt;setLayout('quantity');
echo $this-&gt;loadTemplate();
?&gt;
&lt;/span&gt;
&lt;?php $contact = $this-&gt;config-&gt;get('product_contact',0); ?&gt;
&lt;div id="hikashop_product_contact_main" class="hikashop_product_contact_main"&gt;
&lt;?php
if(hikashop::level(1) &amp;&amp; ($contact==2 &#124;&#124; ($contact==1 &amp;&amp; !empty($this-&gt;element-&gt;product_contact)))){
$empty='';
$params = new JParameter($empty);
echo $this-&gt;cart-&gt;displayButton(JText::_('CONTACT_US_FOR_INFO'),'contact_us',$params,hikashop::completeLink('product&amp;task=contact&amp;cid='.$this-&gt;row-&gt;product_id),'window.location=\''.hikashop::completeLink('product&amp;task=contact&amp;cid='.$this-&gt;row-&gt;product_id).'\';return false;');
} ?&gt;
&lt;/div&gt;
&lt;?php if(!empty($this-&gt;fields)){?&gt;
&lt;div id="hikashop_product_custom_info" class="hikashop_product_custom_info"&gt;
&lt;h4&gt;&lt;?php echo JText::_('SPECIFICATIONS');?&gt;&lt;/h4&gt;
&lt;table width="100%"&gt;
&lt;?php
$this-&gt;fieldsClass-&gt;prefix = '';
foreach($this-&gt;fields as $fieldName =&gt; $oneExtraField) {
if(!empty($this-&gt;element-&gt;$fieldName)){ ?&gt;
&lt;tr class="hikashop_product_custom_&lt;?php echo $oneExtraField-&gt;field_namekey;?&gt;_line"&gt;
&lt;td class="key"&gt;
&lt;span id="hikashop_product_custom_name_&lt;?php echo $oneExtraField-&gt;field_id;?&gt;" class="hikashop_product_custom_name"&gt;
&lt;?php echo $this-&gt;fieldsClass-&gt;getFieldName($oneExtraField);?&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;span id="hikashop_product_custom_value_&lt;?php echo $oneExtraField-&gt;field_id;?&gt;" class="hikashop_product_custom_value"&gt;
&lt;?php echo $this-&gt;fieldsClass-&gt;show($oneExtraField,$this-&gt;element-&gt;$fieldName); ?&gt;
&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;?php }
}?&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;?php } ?&gt;
&lt;span id="hikashop_product_id_main" class="hikashop_product_id_main"&gt;
&lt;input type="hidden" name="product_id" value="&lt;?php echo $this-&gt;element-&gt;product_id; ?&gt;" /&gt;
&lt;/span&gt;
&lt;span id="hikashop_product_volume_main" class="hikashop_product_volume_main"&gt;
&lt;?php echo JText::_('PRODUCT_WIDTH').': '.($this-&gt;element-&gt;product_width).' '.$this-&gt;element-&gt;product_dimension_unit; ?&gt;&lt;br /&gt;
&lt;?php echo JText::_('PRODUCT_LENGTH').': '.($this-&gt;element-&gt;product_length).' '.$this-&gt;element-&gt;product_dimension_unit; ?&gt;&lt;br /&gt;
&lt;?php echo JText::_('PRODUCT_HEIGHT').': '.($this-&gt;element-&gt;product_height).' '.$this-&gt;element-&gt;product_dimension_unit; ?&gt;&lt;/sup&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div id="hikashop_product_bottom_part" class="hikashop_product_bottom_part"&gt;
&lt;span id="hikashop_product_description_main" class="hikashop_product_description_main"&gt;
&lt;?php echo JHTML::_('content.prepare',preg_replace('#&lt;hr *id="system-readmore" */&gt;#i','',$this-&gt;element-&gt;product_description)); ?&gt;
&lt;/span&gt;
&lt;span id="hikashop_product_url_main" class="hikashop_product_url_main"&gt;
&lt;?php
if(!empty($this-&gt;element-&gt;product_url)){
echo JText::sprintf('MANUFACTURER_URL','&lt;a href="'.$this-&gt;element-&gt;product_url.'" target="_blank"&gt;'.$this-&gt;element-&gt;product_url.'&lt;/a&gt;');
} ?&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;input type="hidden" name="add" value="1"/&gt;
&lt;input type="hidden" name="ctrl" value="product"/&gt;
&lt;input type="hidden" name="task" value="updatecart"/&gt;
&lt;input type="hidden" name="return_url" value="&lt;?php echo urlencode(base64_encode(urldecode($this-&gt;redirect_url)));?&gt;"/&gt;
&lt;/form&gt;
&lt;?php
if(!empty($this-&gt;element-&gt;variants)){
foreach($this-&gt;element-&gt;variants as $variant){
$variant_name = array();
if(!empty($variant-&gt;characteristics)){
foreach($variant-&gt;characteristics as $k =&gt; $ch){
$variant_name[]=$ch-&gt;characteristic_id;
}
}
$variant_name = implode('_',$variant_name);
if(!empty($variant-&gt;images)){
?&gt;
&lt;div id="hikashop_product_image_&lt;?php echo $variant_name;?&gt;" style="display:none;"&gt;
&lt;div id="hikashop_main_image_div_&lt;?php echo $variant_name;?&gt;" &gt;
&lt;?php
$image = reset($variant-&gt;images);
if(!$this-&gt;config-&gt;get('thumbnail')){
echo '&lt;img src="'.$this-&gt;image-&gt;uploadFolder_url.$image-&gt;file_path.'" alt="'.$image-&gt;file_name.'" id="hikashop_main_image_'.$variant_name.'" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle" /&gt;';
}else{
$style='';
if(count($variant-&gt;images)&gt;1){
$height = $this-&gt;config-&gt;get('thumbnail_y');
if(!empty($height)){
$style=' style="height:'.($height+5).'px;"';
}
} ?&gt;
&lt;div class="hikashop_product_main_image_thumb" id="hikashop_main_image_thumb_div_&lt;?php echo $variant_name;?&gt;" &lt;?php echo $style;?&gt;&gt;
&lt;?php echo $this-&gt;image-&gt;display($image-&gt;file_path,true,$image-&gt;file_name,'id="hikashop_main_image_'.$variant_name.'" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"','id="hikashop_main_image_'.$variant_name.'_link"'); ?&gt;
&lt;/div&gt;
&lt;?php
}
if(count($variant-&gt;images)&gt;1){
?&gt;
&lt;/div&gt;&lt;div id="hikashop_small_image_div_&lt;?php echo $variant_name;?&gt;"&gt;&lt;?php
foreach($variant-&gt;images as $image){
echo $this-&gt;image-&gt;display($image-&gt;file_path,'hikashop_main_image_'.$variant_name,$image-&gt;file_name,'class="hikashop_child_image"');
}
}
?&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;?php } ?&gt;
&lt;div id="hikashop_product_contact_&lt;?php echo $variant_name;?&gt;" style="display:none;"&gt;
&lt;?php
if(hikashop::level(1) &amp;&amp; ($contact==2 &#124;&#124; ($contact==1 &amp;&amp; !empty($variant-&gt;product_contact)))){
echo $this-&gt;cart-&gt;displayButton(JText::_('CONTACT_US'),'contact_us',@$this-&gt;params,hikashop::completeLink('product&amp;task=contact&amp;cid='.$variant-&gt;product_id),'window.location=\''.hikashop::completeLink('product&amp;task=contact&amp;cid='.$variant-&gt;product_id).'\';return false;');
}
?&gt;&lt;/div&gt;
&lt;div id="hikashop_product_name_&lt;?php echo $variant_name;?&gt;" style="display:none;"&gt;
&lt;?php echo $variant-&gt;product_name;?&gt;
&lt;/div&gt;
&lt;div id="hikashop_product_code_&lt;?php echo $variant_name;?&gt;" style="display:none;"&gt;
&lt;?php echo $variant-&gt;product_code;?&gt;
&lt;/div&gt;
&lt;div id="hikashop_product_price_&lt;?php echo $variant_name;?&gt;" style="display:none;"&gt;
&lt;?php
if($this-&gt;params-&gt;get('show_price')){
$this-&gt;row =&amp; $variant;
$this-&gt;setLayout('listing_price');
echo $this-&gt;loadTemplate();
}
?&gt;
&lt;/div&gt;
&lt;div id="hikashop_product_quantity_&lt;?php echo $variant_name;?&gt;" style="display:none;"&gt;
&lt;?php
$this-&gt;row =&amp; $variant;
$this-&gt;ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\''.$this-&gt;row-&gt;product_id.'\',field,1'.$form.'); } else { return false; }';
$this-&gt;setLayout('quantity');
echo $this-&gt;loadTemplate();
?&gt;
&lt;/div&gt;
&lt;div id="hikashop_product_description_&lt;?php echo $variant_name;?&gt;" style="display:none;"&gt;
&lt;?php echo JHTML::_('content.prepare',preg_replace('#&lt;hr *id="system-readmore" */&gt;#i','',$variant-&gt;product_description));?&gt;
&lt;/div&gt;
&lt;div id="hikashop_product_weight_&lt;?php echo $variant_name;?&gt;" style="display:none;"&gt;
&lt;?php
if(isset($variant-&gt;product_weight) &amp;&amp; bccomp($variant-&gt;product_weight,0,3)){
echo $variant-&gt;product_weight.' '.JText::_($variant-&gt;product_weight_unit);
}?&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;span id="hikashop_product_url_&lt;?php echo $variant_name;?&gt;" style="display:none;"&gt;
&lt;?php
if(!empty($variant-&gt;product_url)){
echo JText::sprintf('MANUFACTURER_URL','&lt;a href="'.$variant-&gt;product_url.'" target="_blank"&gt;'.$variant-&gt;product_url.'&lt;/a&gt;');
} ?&gt;
&lt;/span&gt;
&lt;span id="hikashop_product_id_&lt;?php echo $variant_name;?&gt;"&gt;
&lt;input type="hidden" name="product_id" value="&lt;?php echo $variant-&gt;product_id; ?&gt;" /&gt;
&lt;/span&gt;
&lt;?php
}
}
$this-&gt;params-&gt;set('show_price_weight',0);
?&gt;
&lt;div class="hikashop_submodules" id="hikashop_submodules" style="clear:both"&gt;
&lt;?php
if(!empty($this-&gt;modules) &amp;&amp; is_array($this-&gt;modules)){
jimport('joomla.application.module.helper');
foreach($this-&gt;modules as $module){
echo JModuleHelper::renderModule($module);
}
}
?&gt;
&lt;/div&gt;
&lt;div class="hikashop_external_comments" id="hikashop_external_comments" style="clear:both"&gt;
&lt;?php
$config =&amp; hikashop::config();
if($config-&gt;get('comments_feature') == 'jcomments'){
$comments = HIKASHOP_ROOT.'components'.DS.'com_jcomments'.DS.'jcomments.php';
if (file_exists($comments)) {
require_once($comments);
echo JComments::showComments($this-&gt;element-&gt;product_id, 'com_hikashop', $this-&gt;element-&gt;product_name);
}
}elseif($config-&gt;get('comments_feature') == 'jomcomment'){
$comments = HIKASHOP_ROOT.'plugins'.DS.'content'.DS.'jom_comment_bot.php';
if (file_exists($comments)) {
require_once($comments);
echo jomcomment($this-&gt;element-&gt;product_id, 'com_hikashop');
}
}
?&gt;
&lt;/div&gt;&lt;?php
}
?&gt;
&lt;/div&gt;

Last edit: 15 years 7 months ago by [gab696](/forum/user/1837-gab696 "View gab696's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vMTI4MjQtYWZmaWNoYWdlLWRlcy1kaW1lbnNpb25zP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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: 86322
- Thank you received: 14281
-
-

15 years 7 months ago [\#12843](#12843) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Affichage des dimensions](/forum/5-support-en-francais-french-support-/12824-affichage-des-dimensions#12843 "Bonjour, J'ai modifié le fichier show.php afin d'obtenir un affichage des dimensions de l'objet. Tout fonctionne parfaitement mais j'aimerais que ces dimensions s'affichent uniquement aux objets auquel j'indique une valeur autre que 0 Merci d'avance pour votre aide !  la partie modifiée:  element-&gt;product&#95;width).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;length).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;height).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt;   le fichier complet:   element)){ $app =&amp; JFactory::getApplication(); $app-&gt;enqueueMessage(JText::&#95;('PRODUCT&#95;NOT&#95;FOUND')); }else{ ?&gt;     element-&gt;product&#95;name; ?&gt;        element-&gt;images)){ $image = reset($this-&gt;element-&gt;images); if(!$this-&gt;config-&gt;get('thumbnail')){ echo 'file&#95;name.'&quot; id=&quot;hikashop&#95;main&#95;image&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot; /&gt;'; }else{ $height = $this-&gt;config-&gt;get('thumbnail&#95;y'); $style=''; if(count($this-&gt;element-&gt;images)&gt;1){ if(!empty($height)){ $style=' style=&quot;height:'.($height+5).'px;&quot;'; } } ?&gt; div class=&quot;hikashop&#95;product&#95;main&#95;image&#95;thumb&quot; id=&quot;hikashop&#95;main&#95;image&#95;thumb&#95;div&quot;  &gt; image-&gt;display($image-&gt;file&#95;path,true,$image-&gt;file&#95;name,'id=&quot;hikashop&#95;main&#95;image&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot;','id=&quot;hikashop&#95;main&#95;image&#95;link&quot;'); ?&gt;   element-&gt;images)&gt;1){ foreach($this-&gt;element-&gt;images as $image){ echo $this-&gt;image-&gt;display($image-&gt;file&#95;path,'hikashop&#95;main&#95;image',$image-&gt;file&#95;name,'class=&quot;hikashop&#95;child&#95;image&quot;'); } } } ?&gt;      params-&gt;get('show&#95;price')){ $this-&gt;row =&amp; $this-&gt;element; $this-&gt;setLayout('listing&#95;price'); echo $this-&gt;loadTemplate(); } ?&gt;   element-&gt;product&#95;code; ?&gt;  element-&gt;product&#95;weight) &amp;&amp; bccomp($this-&gt;element-&gt;product&#95;weight,0,3)){ ?&gt;  element-&gt;product&#95;weight.' '.JText::&#95;($this-&gt;element-&gt;product&#95;weight&#95;unit); ?&gt;  element-&gt;characteristics)){ ?&gt;characteristic-&gt;displayFE($this-&gt;element,$this-&gt;params); ?&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;length).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;height).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt;     php echo JHTML::&#95;('content.prepare',preg&#95;replace('##i','',$this-&gt;element-&gt;product&#95;description)); ?&gt;   element-&gt;product&#95;url)){ echo JText::sprintf('MANUFACTURER&#95;URL',''.$this-&gt;element-&gt;product&#95;url.''); } ?&gt;      nput type=&quot;hidden&quot; name=&quot;return&#95;url&quot; value=&quot;redirect&#95;url)));?&gt;&quot;/&gt;  element-&gt;variants)){ foreach($this-&gt;element-&gt;variants as $variant){ $variant&#95;name = array(); if(!empty($variant-&gt;characteristics)){ foreach($variant-&gt;characteristics as $k =&gt; $ch){ $variant&#95;name&#91;&#93;=$ch-&gt;characteristic&#95;id; } } $variant&#95;name = implode('&#95;',$variant&#95;name); if(!empty($variant-&gt;images)){ ?&gt;   images); if(!$this-&gt;config-&gt;get('thumbnail')){ echo 'file&#95;name.'&quot; id=&quot;hikashop&#95;main&#95;image&#95;'.$variant&#95;name.'&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot; /&gt;'; }else{ $style=''; if(count($variant-&gt;images)&gt;1){ $height = $this-&gt;config-&gt;get('thumbnail&#95;y'); if(!empty($height)){ $style=' style=&quot;height:'.($height+5).'px;&quot;'; } } ?&gt; div class=&quot;hikashop&#95;product&#95;main&#95;image&#95;thumb&quot; id=&quot;hikashop&#95;main&#95;image&#95;thumb&#95;div&#95;&quot; &gt; image-&gt;display($image-&gt;file&#95;path,true,$image-&gt;file&#95;name,'id=&quot;hikashop&#95;main&#95;image&#95;'.$variant&#95;name.'&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot;','id=&quot;hikashop&#95;main&#95;image&#95;'.$variant&#95;name.'&#95;link&quot;'); ?&gt;  images)&gt;1){ ?&gt; images as $image){ echo $this-&gt;image-&gt;display($image-&gt;file&#95;path,'hikashop&#95;main&#95;image&#95;'.$variant&#95;name,$image-&gt;file&#95;name,'class=&quot;hikashop&#95;child&#95;image&quot;'); } } ?&gt;     product&#95;contact)))){ echo false;'); } ?&gt;  product&#95;name;?&gt;   product&#95;code;?&gt;   params-&gt;get('show&#95;price')){ $this-&gt;row =&amp; $variant; $this-&gt;setLayout('listing&#95;price'); echo $this-&gt;loadTemplate(); } ?&gt;   row =&amp; $variant; $this-&gt;ajax = 'if(hikashopCheckChangeForm(&#92;'item&#92;',&#92;'hikashop&#95;product&#95;form&#92;')){ return hikashopModifyQuantity(&#92;''.$this-&gt;row-&gt;product&#95;id.'&#92;',field,1'.$form.'); } else { return false; }'; $this-&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); ?&gt;   php echo JHTML::&#95;('content.prepare',preg&#95;replace('##i','',$variant-&gt;product&#95;description));?&gt;   product&#95;weight) &amp;&amp; bccomp($variant-&gt;product&#95;weight,0,3)){ echo $variant-&gt;product&#95;weight.' '.JText::&#95;($variant-&gt;product&#95;weight&#95;unit); }?&gt;   product&#95;url)){ echo JText::sprintf('MANUFACTURER&#95;URL',''.$variant-&gt;product&#95;url.''); } ?&gt;   nput type=&quot;hidden&quot; name=&quot;product&#95;id&quot; value=&quot;product&#95;id; ?&gt;&quot; /&gt;  params-&gt;set('show&#95;price&#95;weight',0); ?&gt;  modules) &amp;&amp; is&#95;array($this-&gt;modules)){ jimport('joomla.application.module.helper'); foreach($this-&gt;modules as $module){ echo JModuleHelper::renderModule($module); } } ?&gt;   get('comments&#95;feature') == 'jcomments'){ $comments = HIKASHOP&#95;ROOT.'components'.DS.'com&#95;jcomments'.DS.'jcomments.php'; if (file&#95;exists($comments)) { require&#95;once($comments); echo JComments::showComments($this-&gt;element-&gt;product&#95;id, 'com&#95;hikashop', $this-&gt;element-&gt;product&#95;name); } }elseif($config-&gt;get('comments&#95;feature') == 'jomcomment'){ $comments = HIKASHOP&#95;ROOT.'plugins'.DS.'content'.DS.'jom&#95;comment&#95;bot.php'; if (file&#95;exists($comments)) { require&#95;once($comments); echo jomcomment($this-&gt;element-&gt;product&#95;id, 'com&#95;hikashop'); } } ?&gt;  ")*

Au lieu de : Code:

echo JText::_('PRODUCT_WIDTH').': '.($this-&gt;element-&gt;product_width).' '.$this-&gt;element-&gt;product_dimension_unit;

il faut écrire: Code:

if(!empty($this-&gt;element-&gt;product_width)) echo JText::_('PRODUCT_WIDTH').': '.($this-&gt;element-&gt;product_width).' '.$this-&gt;element-&gt;product_dimension_unit;

Aussi, je vous recommande de faire vos modifications via le menu Affichage-&gt;Vues en éditant le fichier show de la vue product. Cela vous évitera de perdre vos modifications quand vous mettrez à jour hikashop.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vMTI4MjQtYWZmaWNoYWdlLWRlcy1kaW1lbnNpb25zP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 21
- Thank you received: 0
-
-

15 years 7 months ago [\#12848](#12848) by [gab696](/forum/user/1837-gab696 "View gab696's Profile")  Replied by *[gab696](/forum/user/1837-gab696 "View gab696's Profile")* on topic *[Re: Affichage des dimensions](/forum/5-support-en-francais-french-support-/12824-affichage-des-dimensions#12848 "Bonjour, J'ai modifié le fichier show.php afin d'obtenir un affichage des dimensions de l'objet. Tout fonctionne parfaitement mais j'aimerais que ces dimensions s'affichent uniquement aux objets auquel j'indique une valeur autre que 0 Merci d'avance pour votre aide !  la partie modifiée:  element-&gt;product&#95;width).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;length).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;height).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt;   le fichier complet:   element)){ $app =&amp; JFactory::getApplication(); $app-&gt;enqueueMessage(JText::&#95;('PRODUCT&#95;NOT&#95;FOUND')); }else{ ?&gt;     element-&gt;product&#95;name; ?&gt;        element-&gt;images)){ $image = reset($this-&gt;element-&gt;images); if(!$this-&gt;config-&gt;get('thumbnail')){ echo 'file&#95;name.'&quot; id=&quot;hikashop&#95;main&#95;image&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot; /&gt;'; }else{ $height = $this-&gt;config-&gt;get('thumbnail&#95;y'); $style=''; if(count($this-&gt;element-&gt;images)&gt;1){ if(!empty($height)){ $style=' style=&quot;height:'.($height+5).'px;&quot;'; } } ?&gt; div class=&quot;hikashop&#95;product&#95;main&#95;image&#95;thumb&quot; id=&quot;hikashop&#95;main&#95;image&#95;thumb&#95;div&quot;  &gt; image-&gt;display($image-&gt;file&#95;path,true,$image-&gt;file&#95;name,'id=&quot;hikashop&#95;main&#95;image&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot;','id=&quot;hikashop&#95;main&#95;image&#95;link&quot;'); ?&gt;   element-&gt;images)&gt;1){ foreach($this-&gt;element-&gt;images as $image){ echo $this-&gt;image-&gt;display($image-&gt;file&#95;path,'hikashop&#95;main&#95;image',$image-&gt;file&#95;name,'class=&quot;hikashop&#95;child&#95;image&quot;'); } } } ?&gt;      params-&gt;get('show&#95;price')){ $this-&gt;row =&amp; $this-&gt;element; $this-&gt;setLayout('listing&#95;price'); echo $this-&gt;loadTemplate(); } ?&gt;   element-&gt;product&#95;code; ?&gt;  element-&gt;product&#95;weight) &amp;&amp; bccomp($this-&gt;element-&gt;product&#95;weight,0,3)){ ?&gt;  element-&gt;product&#95;weight.' '.JText::&#95;($this-&gt;element-&gt;product&#95;weight&#95;unit); ?&gt;  element-&gt;characteristics)){ ?&gt;characteristic-&gt;displayFE($this-&gt;element,$this-&gt;params); ?&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;length).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;height).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt;     php echo JHTML::&#95;('content.prepare',preg&#95;replace('##i','',$this-&gt;element-&gt;product&#95;description)); ?&gt;   element-&gt;product&#95;url)){ echo JText::sprintf('MANUFACTURER&#95;URL',''.$this-&gt;element-&gt;product&#95;url.''); } ?&gt;      nput type=&quot;hidden&quot; name=&quot;return&#95;url&quot; value=&quot;redirect&#95;url)));?&gt;&quot;/&gt;  element-&gt;variants)){ foreach($this-&gt;element-&gt;variants as $variant){ $variant&#95;name = array(); if(!empty($variant-&gt;characteristics)){ foreach($variant-&gt;characteristics as $k =&gt; $ch){ $variant&#95;name&#91;&#93;=$ch-&gt;characteristic&#95;id; } } $variant&#95;name = implode('&#95;',$variant&#95;name); if(!empty($variant-&gt;images)){ ?&gt;   images); if(!$this-&gt;config-&gt;get('thumbnail')){ echo 'file&#95;name.'&quot; id=&quot;hikashop&#95;main&#95;image&#95;'.$variant&#95;name.'&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot; /&gt;'; }else{ $style=''; if(count($variant-&gt;images)&gt;1){ $height = $this-&gt;config-&gt;get('thumbnail&#95;y'); if(!empty($height)){ $style=' style=&quot;height:'.($height+5).'px;&quot;'; } } ?&gt; div class=&quot;hikashop&#95;product&#95;main&#95;image&#95;thumb&quot; id=&quot;hikashop&#95;main&#95;image&#95;thumb&#95;div&#95;&quot; &gt; image-&gt;display($image-&gt;file&#95;path,true,$image-&gt;file&#95;name,'id=&quot;hikashop&#95;main&#95;image&#95;'.$variant&#95;name.'&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot;','id=&quot;hikashop&#95;main&#95;image&#95;'.$variant&#95;name.'&#95;link&quot;'); ?&gt;  images)&gt;1){ ?&gt; images as $image){ echo $this-&gt;image-&gt;display($image-&gt;file&#95;path,'hikashop&#95;main&#95;image&#95;'.$variant&#95;name,$image-&gt;file&#95;name,'class=&quot;hikashop&#95;child&#95;image&quot;'); } } ?&gt;     product&#95;contact)))){ echo false;'); } ?&gt;  product&#95;name;?&gt;   product&#95;code;?&gt;   params-&gt;get('show&#95;price')){ $this-&gt;row =&amp; $variant; $this-&gt;setLayout('listing&#95;price'); echo $this-&gt;loadTemplate(); } ?&gt;   row =&amp; $variant; $this-&gt;ajax = 'if(hikashopCheckChangeForm(&#92;'item&#92;',&#92;'hikashop&#95;product&#95;form&#92;')){ return hikashopModifyQuantity(&#92;''.$this-&gt;row-&gt;product&#95;id.'&#92;',field,1'.$form.'); } else { return false; }'; $this-&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); ?&gt;   php echo JHTML::&#95;('content.prepare',preg&#95;replace('##i','',$variant-&gt;product&#95;description));?&gt;   product&#95;weight) &amp;&amp; bccomp($variant-&gt;product&#95;weight,0,3)){ echo $variant-&gt;product&#95;weight.' '.JText::&#95;($variant-&gt;product&#95;weight&#95;unit); }?&gt;   product&#95;url)){ echo JText::sprintf('MANUFACTURER&#95;URL',''.$variant-&gt;product&#95;url.''); } ?&gt;   nput type=&quot;hidden&quot; name=&quot;product&#95;id&quot; value=&quot;product&#95;id; ?&gt;&quot; /&gt;  params-&gt;set('show&#95;price&#95;weight',0); ?&gt;  modules) &amp;&amp; is&#95;array($this-&gt;modules)){ jimport('joomla.application.module.helper'); foreach($this-&gt;modules as $module){ echo JModuleHelper::renderModule($module); } } ?&gt;   get('comments&#95;feature') == 'jcomments'){ $comments = HIKASHOP&#95;ROOT.'components'.DS.'com&#95;jcomments'.DS.'jcomments.php'; if (file&#95;exists($comments)) { require&#95;once($comments); echo JComments::showComments($this-&gt;element-&gt;product&#95;id, 'com&#95;hikashop', $this-&gt;element-&gt;product&#95;name); } }elseif($config-&gt;get('comments&#95;feature') == 'jomcomment'){ $comments = HIKASHOP&#95;ROOT.'plugins'.DS.'content'.DS.'jom&#95;comment&#95;bot.php'; if (file&#95;exists($comments)) { require&#95;once($comments); echo jomcomment($this-&gt;element-&gt;product&#95;id, 'com&#95;hikashop'); } } ?&gt;  ")*

Merci pour la rapidité !
je passes effectivement par le menu vues pour modifier le fichier show.php mais le code suivant ne donne pas le résultat escompté.

&lt;span id="hikashop_product_volume_main" class="hikashop_product_volume_main"&gt;
&lt;?php if(!empty($this-&gt;element-&gt;product_width)) echo JText::_('PRODUCT_WIDTH').': '.($this-&gt;element-&gt;product_width).' '.$this-&gt;element-&gt;product_dimension_unit; ?&gt;
&lt;?php if(!empty($this-&gt;element-&gt;product_length)) echo JText::_('PRODUCT_LENGTH').': '.($this-&gt;element-&gt;product_length).' '.$this-&gt;element-&gt;product_dimension_unit; ?&gt;
&lt;?php if(!empty($this-&gt;element-&gt;product_height)) echo JText::_('PRODUCT_HEIGHT').': '.($this-&gt;element-&gt;product_height).' '.$this-&gt;element-&gt;product_dimension_unit; ?&gt;
&lt;/span&gt;

Est-ce que ce code est juste ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vMTI4MjQtYWZmaWNoYWdlLWRlcy1kaW1lbnNpb25zP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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: 86322
- Thank you received: 14281
-
-

15 years 7 months ago [\#12870](#12870) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Affichage des dimensions](/forum/5-support-en-francais-french-support-/12824-affichage-des-dimensions#12870 "Bonjour, J'ai modifié le fichier show.php afin d'obtenir un affichage des dimensions de l'objet. Tout fonctionne parfaitement mais j'aimerais que ces dimensions s'affichent uniquement aux objets auquel j'indique une valeur autre que 0 Merci d'avance pour votre aide !  la partie modifiée:  element-&gt;product&#95;width).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;length).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;height).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt;   le fichier complet:   element)){ $app =&amp; JFactory::getApplication(); $app-&gt;enqueueMessage(JText::&#95;('PRODUCT&#95;NOT&#95;FOUND')); }else{ ?&gt;     element-&gt;product&#95;name; ?&gt;        element-&gt;images)){ $image = reset($this-&gt;element-&gt;images); if(!$this-&gt;config-&gt;get('thumbnail')){ echo 'file&#95;name.'&quot; id=&quot;hikashop&#95;main&#95;image&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot; /&gt;'; }else{ $height = $this-&gt;config-&gt;get('thumbnail&#95;y'); $style=''; if(count($this-&gt;element-&gt;images)&gt;1){ if(!empty($height)){ $style=' style=&quot;height:'.($height+5).'px;&quot;'; } } ?&gt; div class=&quot;hikashop&#95;product&#95;main&#95;image&#95;thumb&quot; id=&quot;hikashop&#95;main&#95;image&#95;thumb&#95;div&quot;  &gt; image-&gt;display($image-&gt;file&#95;path,true,$image-&gt;file&#95;name,'id=&quot;hikashop&#95;main&#95;image&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot;','id=&quot;hikashop&#95;main&#95;image&#95;link&quot;'); ?&gt;   element-&gt;images)&gt;1){ foreach($this-&gt;element-&gt;images as $image){ echo $this-&gt;image-&gt;display($image-&gt;file&#95;path,'hikashop&#95;main&#95;image',$image-&gt;file&#95;name,'class=&quot;hikashop&#95;child&#95;image&quot;'); } } } ?&gt;      params-&gt;get('show&#95;price')){ $this-&gt;row =&amp; $this-&gt;element; $this-&gt;setLayout('listing&#95;price'); echo $this-&gt;loadTemplate(); } ?&gt;   element-&gt;product&#95;code; ?&gt;  element-&gt;product&#95;weight) &amp;&amp; bccomp($this-&gt;element-&gt;product&#95;weight,0,3)){ ?&gt;  element-&gt;product&#95;weight.' '.JText::&#95;($this-&gt;element-&gt;product&#95;weight&#95;unit); ?&gt;  element-&gt;characteristics)){ ?&gt;characteristic-&gt;displayFE($this-&gt;element,$this-&gt;params); ?&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;length).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;height).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt;     php echo JHTML::&#95;('content.prepare',preg&#95;replace('##i','',$this-&gt;element-&gt;product&#95;description)); ?&gt;   element-&gt;product&#95;url)){ echo JText::sprintf('MANUFACTURER&#95;URL',''.$this-&gt;element-&gt;product&#95;url.''); } ?&gt;      nput type=&quot;hidden&quot; name=&quot;return&#95;url&quot; value=&quot;redirect&#95;url)));?&gt;&quot;/&gt;  element-&gt;variants)){ foreach($this-&gt;element-&gt;variants as $variant){ $variant&#95;name = array(); if(!empty($variant-&gt;characteristics)){ foreach($variant-&gt;characteristics as $k =&gt; $ch){ $variant&#95;name&#91;&#93;=$ch-&gt;characteristic&#95;id; } } $variant&#95;name = implode('&#95;',$variant&#95;name); if(!empty($variant-&gt;images)){ ?&gt;   images); if(!$this-&gt;config-&gt;get('thumbnail')){ echo 'file&#95;name.'&quot; id=&quot;hikashop&#95;main&#95;image&#95;'.$variant&#95;name.'&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot; /&gt;'; }else{ $style=''; if(count($variant-&gt;images)&gt;1){ $height = $this-&gt;config-&gt;get('thumbnail&#95;y'); if(!empty($height)){ $style=' style=&quot;height:'.($height+5).'px;&quot;'; } } ?&gt; div class=&quot;hikashop&#95;product&#95;main&#95;image&#95;thumb&quot; id=&quot;hikashop&#95;main&#95;image&#95;thumb&#95;div&#95;&quot; &gt; image-&gt;display($image-&gt;file&#95;path,true,$image-&gt;file&#95;name,'id=&quot;hikashop&#95;main&#95;image&#95;'.$variant&#95;name.'&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot;','id=&quot;hikashop&#95;main&#95;image&#95;'.$variant&#95;name.'&#95;link&quot;'); ?&gt;  images)&gt;1){ ?&gt; images as $image){ echo $this-&gt;image-&gt;display($image-&gt;file&#95;path,'hikashop&#95;main&#95;image&#95;'.$variant&#95;name,$image-&gt;file&#95;name,'class=&quot;hikashop&#95;child&#95;image&quot;'); } } ?&gt;     product&#95;contact)))){ echo false;'); } ?&gt;  product&#95;name;?&gt;   product&#95;code;?&gt;   params-&gt;get('show&#95;price')){ $this-&gt;row =&amp; $variant; $this-&gt;setLayout('listing&#95;price'); echo $this-&gt;loadTemplate(); } ?&gt;   row =&amp; $variant; $this-&gt;ajax = 'if(hikashopCheckChangeForm(&#92;'item&#92;',&#92;'hikashop&#95;product&#95;form&#92;')){ return hikashopModifyQuantity(&#92;''.$this-&gt;row-&gt;product&#95;id.'&#92;',field,1'.$form.'); } else { return false; }'; $this-&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); ?&gt;   php echo JHTML::&#95;('content.prepare',preg&#95;replace('##i','',$variant-&gt;product&#95;description));?&gt;   product&#95;weight) &amp;&amp; bccomp($variant-&gt;product&#95;weight,0,3)){ echo $variant-&gt;product&#95;weight.' '.JText::&#95;($variant-&gt;product&#95;weight&#95;unit); }?&gt;   product&#95;url)){ echo JText::sprintf('MANUFACTURER&#95;URL',''.$variant-&gt;product&#95;url.''); } ?&gt;   nput type=&quot;hidden&quot; name=&quot;product&#95;id&quot; value=&quot;product&#95;id; ?&gt;&quot; /&gt;  params-&gt;set('show&#95;price&#95;weight',0); ?&gt;  modules) &amp;&amp; is&#95;array($this-&gt;modules)){ jimport('joomla.application.module.helper'); foreach($this-&gt;modules as $module){ echo JModuleHelper::renderModule($module); } } ?&gt;   get('comments&#95;feature') == 'jcomments'){ $comments = HIKASHOP&#95;ROOT.'components'.DS.'com&#95;jcomments'.DS.'jcomments.php'; if (file&#95;exists($comments)) { require&#95;once($comments); echo JComments::showComments($this-&gt;element-&gt;product&#95;id, 'com&#95;hikashop', $this-&gt;element-&gt;product&#95;name); } }elseif($config-&gt;get('comments&#95;feature') == 'jomcomment'){ $comments = HIKASHOP&#95;ROOT.'plugins'.DS.'content'.DS.'jom&#95;comment&#95;bot.php'; if (file&#95;exists($comments)) { require&#95;once($comments); echo jomcomment($this-&gt;element-&gt;product&#95;id, 'com&#95;hikashop'); } } ?&gt;  ")*

Dans ce cas là, veuillez essayer avec: Code:

if(bccomp($this-&gt;element-&gt;product_width,0,5)) echo JText::_('PRODUCT_WIDTH').': '.($this-&gt;element-&gt;product_width).' '.$this-&gt;element-&gt;product_dimension_unit;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vMTI4MjQtYWZmaWNoYWdlLWRlcy1kaW1lbnNpb25zP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 21
- Thank you received: 0
-
-

15 years 7 months ago [\#12905](#12905) by [gab696](/forum/user/1837-gab696 "View gab696's Profile")  Replied by *[gab696](/forum/user/1837-gab696 "View gab696's Profile")* on topic *[Re: Affichage des dimensions](/forum/5-support-en-francais-french-support-/12824-affichage-des-dimensions#12905 "Bonjour, J'ai modifié le fichier show.php afin d'obtenir un affichage des dimensions de l'objet. Tout fonctionne parfaitement mais j'aimerais que ces dimensions s'affichent uniquement aux objets auquel j'indique une valeur autre que 0 Merci d'avance pour votre aide !  la partie modifiée:  element-&gt;product&#95;width).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;length).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;height).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt;   le fichier complet:   element)){ $app =&amp; JFactory::getApplication(); $app-&gt;enqueueMessage(JText::&#95;('PRODUCT&#95;NOT&#95;FOUND')); }else{ ?&gt;     element-&gt;product&#95;name; ?&gt;        element-&gt;images)){ $image = reset($this-&gt;element-&gt;images); if(!$this-&gt;config-&gt;get('thumbnail')){ echo 'file&#95;name.'&quot; id=&quot;hikashop&#95;main&#95;image&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot; /&gt;'; }else{ $height = $this-&gt;config-&gt;get('thumbnail&#95;y'); $style=''; if(count($this-&gt;element-&gt;images)&gt;1){ if(!empty($height)){ $style=' style=&quot;height:'.($height+5).'px;&quot;'; } } ?&gt; div class=&quot;hikashop&#95;product&#95;main&#95;image&#95;thumb&quot; id=&quot;hikashop&#95;main&#95;image&#95;thumb&#95;div&quot;  &gt; image-&gt;display($image-&gt;file&#95;path,true,$image-&gt;file&#95;name,'id=&quot;hikashop&#95;main&#95;image&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot;','id=&quot;hikashop&#95;main&#95;image&#95;link&quot;'); ?&gt;   element-&gt;images)&gt;1){ foreach($this-&gt;element-&gt;images as $image){ echo $this-&gt;image-&gt;display($image-&gt;file&#95;path,'hikashop&#95;main&#95;image',$image-&gt;file&#95;name,'class=&quot;hikashop&#95;child&#95;image&quot;'); } } } ?&gt;      params-&gt;get('show&#95;price')){ $this-&gt;row =&amp; $this-&gt;element; $this-&gt;setLayout('listing&#95;price'); echo $this-&gt;loadTemplate(); } ?&gt;   element-&gt;product&#95;code; ?&gt;  element-&gt;product&#95;weight) &amp;&amp; bccomp($this-&gt;element-&gt;product&#95;weight,0,3)){ ?&gt;  element-&gt;product&#95;weight.' '.JText::&#95;($this-&gt;element-&gt;product&#95;weight&#95;unit); ?&gt;  element-&gt;characteristics)){ ?&gt;characteristic-&gt;displayFE($this-&gt;element,$this-&gt;params); ?&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;length).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt; element-&gt;product&#95;height).' '.$this-&gt;element-&gt;product&#95;dimension&#95;unit; ?&gt;     php echo JHTML::&#95;('content.prepare',preg&#95;replace('##i','',$this-&gt;element-&gt;product&#95;description)); ?&gt;   element-&gt;product&#95;url)){ echo JText::sprintf('MANUFACTURER&#95;URL',''.$this-&gt;element-&gt;product&#95;url.''); } ?&gt;      nput type=&quot;hidden&quot; name=&quot;return&#95;url&quot; value=&quot;redirect&#95;url)));?&gt;&quot;/&gt;  element-&gt;variants)){ foreach($this-&gt;element-&gt;variants as $variant){ $variant&#95;name = array(); if(!empty($variant-&gt;characteristics)){ foreach($variant-&gt;characteristics as $k =&gt; $ch){ $variant&#95;name&#91;&#93;=$ch-&gt;characteristic&#95;id; } } $variant&#95;name = implode('&#95;',$variant&#95;name); if(!empty($variant-&gt;images)){ ?&gt;   images); if(!$this-&gt;config-&gt;get('thumbnail')){ echo 'file&#95;name.'&quot; id=&quot;hikashop&#95;main&#95;image&#95;'.$variant&#95;name.'&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot; /&gt;'; }else{ $style=''; if(count($variant-&gt;images)&gt;1){ $height = $this-&gt;config-&gt;get('thumbnail&#95;y'); if(!empty($height)){ $style=' style=&quot;height:'.($height+5).'px;&quot;'; } } ?&gt; div class=&quot;hikashop&#95;product&#95;main&#95;image&#95;thumb&quot; id=&quot;hikashop&#95;main&#95;image&#95;thumb&#95;div&#95;&quot; &gt; image-&gt;display($image-&gt;file&#95;path,true,$image-&gt;file&#95;name,'id=&quot;hikashop&#95;main&#95;image&#95;'.$variant&#95;name.'&quot; style=&quot;margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle&quot;','id=&quot;hikashop&#95;main&#95;image&#95;'.$variant&#95;name.'&#95;link&quot;'); ?&gt;  images)&gt;1){ ?&gt; images as $image){ echo $this-&gt;image-&gt;display($image-&gt;file&#95;path,'hikashop&#95;main&#95;image&#95;'.$variant&#95;name,$image-&gt;file&#95;name,'class=&quot;hikashop&#95;child&#95;image&quot;'); } } ?&gt;     product&#95;contact)))){ echo false;'); } ?&gt;  product&#95;name;?&gt;   product&#95;code;?&gt;   params-&gt;get('show&#95;price')){ $this-&gt;row =&amp; $variant; $this-&gt;setLayout('listing&#95;price'); echo $this-&gt;loadTemplate(); } ?&gt;   row =&amp; $variant; $this-&gt;ajax = 'if(hikashopCheckChangeForm(&#92;'item&#92;',&#92;'hikashop&#95;product&#95;form&#92;')){ return hikashopModifyQuantity(&#92;''.$this-&gt;row-&gt;product&#95;id.'&#92;',field,1'.$form.'); } else { return false; }'; $this-&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); ?&gt;   php echo JHTML::&#95;('content.prepare',preg&#95;replace('##i','',$variant-&gt;product&#95;description));?&gt;   product&#95;weight) &amp;&amp; bccomp($variant-&gt;product&#95;weight,0,3)){ echo $variant-&gt;product&#95;weight.' '.JText::&#95;($variant-&gt;product&#95;weight&#95;unit); }?&gt;   product&#95;url)){ echo JText::sprintf('MANUFACTURER&#95;URL',''.$variant-&gt;product&#95;url.''); } ?&gt;   nput type=&quot;hidden&quot; name=&quot;product&#95;id&quot; value=&quot;product&#95;id; ?&gt;&quot; /&gt;  params-&gt;set('show&#95;price&#95;weight',0); ?&gt;  modules) &amp;&amp; is&#95;array($this-&gt;modules)){ jimport('joomla.application.module.helper'); foreach($this-&gt;modules as $module){ echo JModuleHelper::renderModule($module); } } ?&gt;   get('comments&#95;feature') == 'jcomments'){ $comments = HIKASHOP&#95;ROOT.'components'.DS.'com&#95;jcomments'.DS.'jcomments.php'; if (file&#95;exists($comments)) { require&#95;once($comments); echo JComments::showComments($this-&gt;element-&gt;product&#95;id, 'com&#95;hikashop', $this-&gt;element-&gt;product&#95;name); } }elseif($config-&gt;get('comments&#95;feature') == 'jomcomment'){ $comments = HIKASHOP&#95;ROOT.'plugins'.DS.'content'.DS.'jom&#95;comment&#95;bot.php'; if (file&#95;exists($comments)) { require&#95;once($comments); echo jomcomment($this-&gt;element-&gt;product&#95;id, 'com&#95;hikashop'); } } ?&gt;  ")*

Super ! merci infiniment et bravo pour le support

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vMTI4MjQtYWZmaWNoYWdlLWRlcy1kaW1lbnNpb25zP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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.093 seconds

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