Hi!
Quick problem: how can I get link to the original file that was uploaded that is located in data folder not in cache/data?
<?php echo -?- ?>
Cheers!
Quick problem: how can I get link to the original file that was uploaded that is located in data folder not in cache/data?
<?php echo -?- ?>
Cheers!
Hi,
Depends where you want to use:
example: if product page (controller) you can use:
Depends where you want to use:
example: if product page (controller) you can use:
Code: Select all
$image = HTTP_IMAGE . $product_info['image'];
Thanks for your reply.
I need it for product.tpl, because changes I introduced in product.php only made it worse
How can I do that?
My problem is that I'm implementing zoom jquery plugin and I need 3 sizes for additional images (now there are two: thumb and popup). And I need original url for zoom image
I need it for product.tpl, because changes I introduced in product.php only made it worse

How can I do that?
My problem is that I'm implementing zoom jquery plugin and I need 3 sizes for additional images (now there are two: thumb and popup). And I need original url for zoom image

Hi,
in controller/catalog/product.php find
and change to :
in controller/catalog/product.php find
Code: Select all
if ($product_info['image']) {
$this->data['popup'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
} else {
$this->data['popup'] = '';
}
Code: Select all
if ($product_info['image']) {
$this->data['popup'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
$this->data['original_image'] = HTTP_IMAGE . $product_info['image'];
} else {
$this->data['popup'] = '';
$this->data['original_image'] ='';
}
Thanks! I'm getting closer 
However now it's showing me original image of product not additional original image.
And I put this into my product.tpl file:
It's possible that I need to change something here, but I have no idea what to add:

However now it's showing me original image of product not additional original image.
Code: Select all
if ($product_info['image']) {
$max_width = (int)315;
$max_height = (int)900;
$oldsize = getimagesize(DIR_IMAGE.$product_info['image']);
$scale = min($max_width/$oldsize[0], $max_height/$oldsize[1]);
$new_width = ceil($scale*$oldsize[0]);
$new_height = ceil($scale*$oldsize[1]);
$this->data['popup'] = $this->model_tool_image->resize($product_info['image'], $new_width , $new_height);
$this->data['original_image'] = HTTP_IMAGE . $product_info['image'];
} else {
$this->data['popup'] = '';
$this->data['original_image'] ='';
}
Code: Select all
<?php if ($images) { ?>
<div class="image-additional">
<?php foreach ($images as $image) { ?>
<a href="<?php echo $original_image ?>" title="<?php echo $heading_title; ?>" class="cloud-zoom-gallery" rel="useZoom: 'zoom', smallImage: '<?php echo $image['popup']; ?>' "><img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a>
<?php } ?>
</div>
<?php } ?>
Code: Select all
foreach ($results as $result) {
$this->data['images'][] = array(
'popup' => $this->model_tool_image->resize($result['image'], $new_width_pop , $new_height_pop),
'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height'))
);
Code: Select all
foreach ($results as $result) {
$this->data['images'][] = array(
'popup' => $this->model_tool_image->resize($result['image'], $new_width_pop , $new_height_pop),
'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height')),
'original' => HTTP_IMAGE . $result['image']
);
Thanks! It works perfectly.
I had to change this fragment, though.
I had to change this fragment, though.
Code: Select all
<?php if ($images) { ?>
<div class="image-additional">
<?php foreach ($images as $image) { ?>
<a href="<?php echo $image['original_image'] ?>" title="<?php echo $heading_title; ?>" class="cloud-zoom-gallery" rel="useZoom: 'zoom', smallImage: '<?php echo $image['popup']; ?>' "><img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a>
<?php } ?>
</div>
<?php } ?>
Who is online
Users browsing this forum: No registered users and 43 guests