Jump to content

Show product dimensions on product page


matl

Recommended Posts

Hello,

 

I would like to add the dimensions like width, heigth, depth and so on of a product to the different product pages.

I added via product preferences the values width (breite), heigth (Höhe) and depth (Tiefe). Now I would like to give these values automatically the value I imported with my .csv file. The value of width, heigth and depth is available in the transport section of the product, but it is not shown yet on the product page.

 

The question is, how could I show the different values on the product page, without, however to enter every value manually to the different products.

 

Is there a module for this or is it possible to enter a special value to the vaule of the preference to do this automatically for all products?

 

Thank's for your help

 

Kind regards

Tobias

post-1086149-0-94003000-1445292152_thumb.png

Link to comment
Share on other sites

  • 3 years later...

Hello @matl, on PrestaShop 1.7 you can add this block in your template (templates/catalog/_partials/product-details.tpl) :

{block name='product_dimensions'}
  {if $product.width > 0}
    <div class="product-width">
      <label class="label">{l s='Width' d='Shop.Theme.Catalog'} </label>
      <span>{sprintf("%.0f", $product.width)}&nbsp{Configuration::get('PS_DIMENSION_UNIT')}</span>
    </div>
  {/if}
  {if $product.height > 0}
    <div class="product-height">
      <label class="label">{l s='Height' d='Shop.Theme.Catalog'} </label>
      <span>{sprintf("%.0f", $product.height)}&nbsp{Configuration::get('PS_DIMENSION_UNIT')}</span>
    </div>
  {/if}
  {if $product.depth > 0}
    <div class="product-depth">
      <label class="label">{l s='Depth' d='Shop.Theme.Catalog'} </label>
      <span>{sprintf("%.0f", $product.depth)}&nbsp{Configuration::get('PS_DIMENSION_UNIT')}</span>
    </div>
  {/if}
  {if $product.weight > 0}
    <div class="product-weight">
      <label class="label">{l s='Weight' d='Shop.Theme.Catalog'} </label>
      <span>{sprintf("%.0f", $product.weight)}&nbsp{Configuration::get('PS_WEIGHT_UNIT')}</span>
    </div>
  {/if}
{/block}	

It will show width, height, depth and weight of the product if set (> 0).

Regards,

David.

  • Thanks 2
Link to comment
Share on other sites

  • 1 year later...

Thank-you David, i had the same needs...

But I would want to know if it's possible to get the same informations about weight,size... for each declination (variations of a product) when customer choose one various item product?

Best regards

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...