- Posts: 251
- Thank you received: 2
Images of variant not loaded
I set two CHARACTERISTICS: Colors and Size. So I manage the variants and turn on some colors.
Now I load for each color a picture about that particular color, but in frontend when I choose that color the images do not load...
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
This is the link of page where I have the problem. Try to change "Colore" from "Verde" to "Beige". It should change the pics but it doesn't works.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
The images change when changing the characteristics on that page when we change the characteristics values dropdowns.
Please Log in or Create an account to join the conversation.
I solved a part of the problem, but when I choose a variant the picture becomes big. Before now I solved this via css but now it no more work
Please Log in or Create an account to join the conversation.
<?php
if(!empty($this->element->variants)){
foreach($this->element->variants as $variant){
$variant_name = array();
if(!empty($variant->characteristics)){
foreach($variant->characteristics as $k => $ch){
$variant_name[]=$ch->characteristic_id;
}
}
$variant_name = implode('_',$variant_name);
if(!empty($variant->images)){
?>
<div id="hikashop_product_image_<?php echo $variant_name;?>" style="display:none;">
<div id="hikashop_main_image_div_<?php echo $variant_name;?>" >
<?php
$image = reset($variant->images);
if(!$this->config->get('thumbnail')){
echo '<img src="'.$this->image->uploadFolder_url.$image->file_path.'" alt="'.$image->file_name.'" id="hikashop_main_image_'.$variant_name.'" style="margin-right:8px;margin-bottom:8px;display:block;vertical-align:top;float:left;padding:4px;border:1px solid #666666;" />';
}else{
$style='';
if(count($variant->images)>1){
$height = $this->config->get('thumbnail_y');
if(!empty($height)){
$style=' style="height:'.($height+5).'px;"';
}
} ?>
<div class="hikashop_product_main_image_thumb" id="hikashop_main_image_thumb_div_<?php echo $variant_name;?>" <?php echo $style;?>>
<?php echo $this->image->display($image->file_path,true,$image->file_name,'id="hikashop_main_image_'.$variant_name.'" style="margin-right:8px;margin-bottom:8px;display:block;vertical-align:top;float:left;padding:4px;border:1px solid #666666;"','id="hikashop_main_image_'.$variant_name.'_link"'); ?>
</div>
<?php
}
if(count($variant->images)>1){
?>
</div><div id="hikashop_small_image_div_<?php echo $variant_name;?>"><?php
foreach($variant->images as $image){
echo $this->image->display($image->file_path,'hikashop_main_image_'.$variant_name,$image->file_name,'class="hikashop_child_image"');
}
}
?>
</div>
</div>
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
For the big image when changing the characteristics, that's because you need to set the height on it when displaying it, like the JS does automatically when you go on a small image after that.
Please Log in or Create an account to join the conversation.
For the big image when changing the characteristics, that's because you need to set the height on it when displaying it, like the JS does automatically when you go on a small image after that.
How can I set the height?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Thank you!
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
This is an example page
www.stylover.com/index.php?option=com_co...rada&catid=2:current
Thank you!
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.