Change the image code

  • Posts: 17
  • Thank you received: 0
5 years 11 months ago #291703

-- HikaShop version -- : 3.3.0
-- Joomla version -- : 3.8.6

Hi
I want to put the code below for the image.
Thank you

<!--- 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/

<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: 5 years 11 months ago by chavosh.

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

  • Posts: 81379
  • Thank you received: 13037
  • MODERATOR
5 years 11 months ago #291736

Hi,

Ok, but then what is your question exactly ?

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

  • Posts: 17
  • Thank you received: 0
5 years 11 months ago #291776

Hi
I want the pictures of the comparison part Like the filter section, read the download host.
Thank you

https://www.mehrazart.ir/index.php?option=com_hikashop&ctrl=product&task=compare&cid[]=156

https://www.mehrazart.ir/index.php?option=com_jamegafilter&amp;view=default&amp;id=1&amp;jalayout=default&amp;itemperrow=3&amp;itempercol=4&amp;fullpage=0&amp;sticky=1&amp;scrolltop=1&amp;autopage=0&amp;direction=sb-horizontal&amp;Itemid=471#sort=position&sortdir=desc&attr.category.value=15&page=1

Attachments:
Last edit: 5 years 11 months ago by chavosh.

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

  • Posts: 81379
  • Thank you received: 13037
  • MODERATOR
5 years 11 months ago #291801

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

The following user(s) said Thank You: chavosh

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

Time to create page: 0.069 seconds
Powered by Kunena Forum