Re: Dimensions added to Product Listing

  • Posts: 88
  • Thank you received: 0
13 years 1 week ago #33318

Hi Guys,

Is it possible to add the product dimensions (width x height) on the product description (listing_img_title ). It would need to look like 25 x 30 etc.

Thanks

Darren

Please Log in or Create an account to join the conversation.

  • Posts: 83025
  • Thank you received: 13405
  • MODERATOR
13 years 1 week ago #33336

Hi,

Yes, it's possible. You need to edit the file "listing_img_title" (provided that your listing layout type is div and that the item box layout is image and title which are the default values) of the view "product" via the menu Display->Views and add something like that:
<?php echo $this->row->product_width.' x '.$this->row->product_height; ?>

Please Log in or Create an account to join the conversation.

  • Posts: 88
  • Thank you received: 0
13 years 1 week ago #33346

Great, thanks Nicolas!

Please Log in or Create an account to join the conversation.

  • Posts: 359
  • Thank you received: 24
  • Hikaserial Standard Hikashop Business
4 years 5 months ago #321787

I now this is and old thread, but it still works :-)

But it shows like:
80.000 x 80.000

How can I let show like: 80 x 80 cm

And only on products where the fields aren't 0

Please Log in or Create an account to join the conversation.

  • Posts: 83025
  • Thank you received: 13405
  • MODERATOR
4 years 5 months ago #321800

Hi,

You can do like that:

<?php 
if($this->row->product_width > 0.0 && $this->row->product_height > 0.0) {
  echo (int)$this->row->product_width.' x '.(int)$this->row->product_height.' cm';
}
?>

Please Log in or Create an account to join the conversation.

  • Posts: 359
  • Thank you received: 24
  • Hikaserial Standard Hikashop Business
4 years 5 months ago #321804

I'm impressed, you always have a great answer and reply so quickly, thank you so much!

Please Log in or Create an account to join the conversation.

Time to create page: 0.069 seconds
Powered by Kunena Forum