Skip to main content

Dimensions don't show when there are variants :-(

More
13 years 11 months ago - 13 years 11 months ago #70734 by ianspeed
Dimensions don't show when I have a variant without dimensions???

Have some love spoons in different wood, they all have the same dimension and weight, because they are setup with variant: Beech, yew and Oak the main product dimensions don't display.

Any way around this?

Thanks

Ian
Last edit: 13 years 11 months ago by ianspeed.

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

More
13 years 11 months ago - 13 years 11 months ago #70888 by Xavier
Hi,

This problem has been corrected, and will be in the next release.

You can correct it by replacing the code in "yourSite\administrator\component\com_hikashop\classes\product.php":
Code:
if(isset($variant->product_weight) && $variant->product_weight==0){ unset($variant->product_weight_unit); } if(isset($variant->product_length) && isset($variant->product_height) && isset($variant->product_width) && $variant->product_length==0 && $variant->product_height==0 && $variant->product_width==0){ unset($variant->product_dimension_unit); }
By:
Code:
if(isset($variant->product_weight) && $variant->product_weight==0){ $variant->product_weight_unit=$element->product_weight_unit; } if(isset($variant->product_length) && isset($variant->product_height) && isset($variant->product_width) && $variant->product_length==0 && $variant->product_height==0 && $variant->product_width==0){ $variant->product_dimension_unit=$element->product_dimension_unit; }

Then in the view "product / show" in HikaShop > Display > Views, replace the foreach starting by:
Code:
foreach (get_object_vars($this->element->main) as $name=>$value) {
By:
Code:
foreach (get_object_vars($this->element->main) as $name=>$value) { if(!is_array($name)&&!is_object($name)){ $required = false; foreach ($this->element->variants as $variant) { if(!empty($variant->$name) && (!is_numeric($variant->$name) || $variant->$name>0)){ $required = true; break; } } if($required){ foreach ($this->element->variants as $k=>$variant) { if(empty($variant->$name) || (is_numeric($variant->$name) && $variant->$name==0.0)){ if($name=='product_quantity' && $this->element->$name==-1){ continue; } $this->element->variants[$k]->$name=$this->element->main->$name; } } } } }

And in the view "product / show_block_dimension" add the lines at the top of the file (after the "<?php tag"):
Code:
if($this->element->product_weight==0 && $this->element->main->product_weight>0 ){ $this->element->product_weight = $this->element->main->product_weight; } if($this->element->product_width==0 && $this->element->main->product_width>0 ){ $this->element->product_width = $this->element->main->product_width; } if($this->element->product_height==0 && $this->element->main->product_height>0 ){ $this->element->product_height = $this->element->main->product_height; } if($this->element->product_length==0 && $this->element->main->product_length>0 ){ $this->element->product_length = $this->element->main->product_length; }
Last edit: 13 years 11 months ago by Xavier.
The following user(s) said Thank You: ianspeed

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

More
13 years 11 months ago #70889 by ianspeed
Thanks Xavier,
When is the next release roughly? Might be worth waiting if I tell my customer it'll be sorted shortly :-)?

Also is there anyway to display product thumbnails in the search results...

Many thanks

Ian

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

More
13 years 11 months ago #70948 by nicolas
We're hoping to release it before the end of the month.

If you want to display thumbnails on search results, you should not use the joomla search system, which can't handle that, but instead uses HikaShop filters:
www.hikashop.com/en/support/documentatio...-filter-listing.html
We have an example of such search module at the bottom of our demo website.
The following user(s) said Thank You: ianspeed

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

Time to create page: 0.215 seconds
Powered by Kunena Forum