Dosn't work:(
Code: Select all
<file path="catalog/controller/product/product.php">
<operation error="log">
<search position="replace"><![CDATA[if ($product_info['image']) {
$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 {
$data['popup'] = '';
}]]></search>
<add><![CDATA[if ($product_info['image']) {
$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['popup'] = $this->model_tool_image->resize($product_info['image'], $new_width , $new_height);
$this['original_image'] = HTTP_IMAGE . $product_info['image'];
} else {
$this['popup'] = '';
$this['original_image'] ='';
}]]></add>
</operation>
</file>
<file path="catalog/view/theme/*/template/product/product_gallery.tpl">
<operation error="log">
<search position="replace"><![CDATA[<a class="thumbnail" href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>"> <img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a>]]></search>
<add><![<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>]]></add>
</operation>
</file>
With vqmod, you can only <search> for one line of code (not multiple lines as your example)
https://github.com/vqmod/vqmod/wiki/Scripting
https://github.com/vqmod/vqmod/wiki/Scripting
If i replace the code in files, i get 500 error
catalog/controller/product/product.php
replace with:
catalog/view/theme/*/template/product/product_gallery.tpl
replace with:
any idea?
catalog/controller/product/product.php
Code: Select all
if ($product_info['image']) {
$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 {
$data['popup'] = '';
}
Code: Select all
if ($product_info['image']) {
$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['popup'] = $this->model_tool_image->resize($product_info['image'], $new_width , $new_height);
$this['original_image'] = HTTP_IMAGE . $product_info['image'];
} else {
$this['popup'] = '';
$this['original_image'] ='';
}
Code: Select all
<a class="thumbnail" href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>"> <img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a>
Code: Select all
<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>
oh, sorry
catalog/controller/product/product.php
replace with:
catalog/view/theme/*/template/product/product_gallery.tpl
replace with:
catalog/controller/product/product.php
Code: Select all
if ($product_info['image']) {
$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 {
$data['popup'] = '';
}
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['popup'] = $this->model_tool_image->resize($product_info['image'], $new_width , $new_height);
$this['original_image'] = HTTP_IMAGE . $product_info['image'];
} else {
$this['popup'] = '';
$this['original_image'] ='';
}
Code: Select all
<a class="thumbnail" href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>"> <img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a>
Code: Select all
<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>
Change
$this['original_image'] (in 2 places) with $data['original_image']
Change
$this['popup'] with $data['popup']
$this['original_image'] (in 2 places) with $data['original_image']
Change
$this['popup'] with $data['popup']
Who is online
Users browsing this forum: No registered users and 5 guests