- Posts: 17
- Thank you received: 0
Change the image code
8 years 5 months ago - 8 years 5 months ago #291703
by chavosh
Change the image code was created by chavosh
-- HikaShop version -- : 3.3.0
-- Joomla version -- : 3.8.6
Hi
I want to put the code below for the image.
Thank you
src="'.$img->url.'"
Change to
sub.domain.com/images/
-- Joomla version -- : 3.8.6
Hi
I want to put the code below for the image.
Thank you
Code:
<!--- image -->
<?php
if(!isset($element->alias))
$element->alias = '';
$link = hikashop_contentLink('product&task=show&cid='.$element->product_id.'&name='.$element->alias.$url_itemid,$element);
?>
<div class="compare_image">
<?php if(!empty($element->images)) {
$image = reset($element->images);
if(!$this->config->get('thumbnail')) {
echo '<img src="'.$this->image->uploadFolder_url.$image->file_path.'" alt="'.$image->file_name.'" id="hikashop_main_image" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle" />';
} else {
$height = $this->config->get('thumbnail_y');
$width = $this->config->get('thumbnail_x');
$style='';
if(count($element->images)>1){
if(!empty($height)){
$style=' style="height:'.($height+5).'px;"';
}
}
?>
<div class="hikashop_product_main_image_thumb" id="hikashop_main_image_thumb_div" <?php echo $style;?> >
<a href="<?php echo $link; ?>" title="<?php echo $this->escape($element->product_name); ?>">
<?php $image_options = array('default' => true,'forcesize'=>$this->config->get('image_force_size',true),'scale'=>$this->config->get('image_scale_mode','inside'));
$img = $this->image->getThumbnail(@$image->file_path, array('width' => $width, 'height' => $height), $image_options);
if($img->success) {
echo '<img class="hikashop_product_compare_image" title="'.$this->escape(@$image->file_description).'" alt="'.$this->escape(@$image->file_name).'" src="'.$img->url.'"/>';
} ?>
</a>
</div>
<?php }
}
?>
</div>
src="'.$img->url.'"
Change to
sub.domain.com/images/
Code:
<div class="hikashop_product hikashop_product_column_1 hikashop_product_row_1" style="width: <?php echo $col . '%'; ?>">
<div data-container="product-grid" class="hikashop_container product-item-info {?thumbnail}{:else} no-image {/thumbnail}">
<div class="product-item-details hikashop_subcontainer thumbnail">
<div class="hikashop_listing_img_title">
<div class="hikashop_product_image">
<div class="hikashop_product_image_subdiv">
<a tabindex="-1" class="product-item-photo" href="{url}" style="height: <?php echo $thumbnail_y; ?>px">
<img alt="{name|s}" src="<?php echo 'https://sub.domain.com/images/'; ?>{thumbnail}" class="product-image-photo">
</a>
</div>
Last edit: 8 years 5 months ago by chavosh.
Please Log in or Create an account to join the conversation.
8 years 5 months ago #291736
by nicolas
Replied by nicolas on topic Change the image code
Hi,
Ok, but then what is your question exactly ?
Ok, but then what is your question exactly ?
Please Log in or Create an account to join the conversation.
8 years 5 months ago - 8 years 5 months ago #291776
by chavosh
Replied by chavosh on topic Change the image code
Hi
I want the pictures of the comparison part Like the filter section, read the download host.
Thank you
I want the pictures of the comparison part Like the filter section, read the download host.
Thank you
Code:
https://www.mehrazart.ir/index.php?option=com_hikashop&ctrl=product&task=compare&cid[]=156
https://www.mehrazart.ir/index.php?option=com_jamegafilter&view=default&id=1&jalayout=default&itemperrow=3&itempercol=4&fullpage=0&sticky=1&scrolltop=1&autopage=0&direction=sb-horizontal&Itemid=471#sort=position&sortdir=desc&attr.category.value=15&page=1
Last edit: 8 years 5 months ago by chavosh.
Please Log in or Create an account to join the conversation.
8 years 5 months ago #291801
by nicolas
Replied by nicolas on topic Change the image code
Hi,
So if I understand correctly, you want to use the original image instead of the resized thumbnail on the comparison page of the products ?
In that case, it's quite easy.
You need to edit the file "compare" of the view "product" via the menu Display>Views and change the code:
$img->url
to:
$img->origin_url
So if I understand correctly, you want to use the original image instead of the resized thumbnail on the comparison page of the products ?
In that case, it's quite easy.
You need to edit the file "compare" of the view "product" via the menu Display>Views and change the code:
$img->url
to:
$img->origin_url
The following user(s) said Thank You: chavosh
Please Log in or Create an account to join the conversation.
Time to create page: 0.156 seconds