Code:
<?php
$_product = $this->getProduct();
$_helper = $this->helper('catalog/output');
$images = $this->getGalleryImages();
$tehurl = $_product->getProductUrl();
$suburl = substr($tehurl, strrpos($tehurl, "/") + 1);
$suburl = str_replace("-", "", $suburl);
?>
<div class="product-image-gallery">
<?php if (file_exists($_SERVER['DOCUMENT_ROOT']."/assets/front/saleimg/productview/tp-1x/".$suburl."-0.png")) { ?>
<div class="productslider">
<div class="view">
<ul>
<?php for ($x = 0; $x <= 2; $x++) { ?>
<li><img src="/assets/front/saleimg/productview/tp-1x/<?php echo $suburl."-".$x; ?>.png" srcset="/assets/front/saleimg/productview/tp-2x/<?php echo $suburl."-".$x; ?>.png 2x" /></li>
<?php } ?>
</ul>
</div>
</div>
<?php
}
elseif (file_exists($_SERVER['DOCUMENT_ROOT']."/assets/front/saleimg/productview/".$suburl.".jpg")) {
?>
<img src="/assets/front/saleimg/productview/<?php echo $suburl; ?>.jpg" srcset="/assets/front/saleimg/productview/<?php echo $suburl; ?>-2x.jpg 2x" />
<?php
}
elseif (count($images) > 0) {
$i = 0;
foreach ($this->getGalleryImages() as $_image):
if ($this->isGalleryImageVisible($_image)):
?>
<img id="image-<?php echo $i; ?>" src="<?php echo $this->getGalleryImageUrl($_image); ?>" />
<?php
endif;
$i++;
endforeach;
}
else {
?>
<!-- <?php
var_dump($_SERVER['DOCUMENT_ROOT']);
var_dump($_SERVER['DOCUMENT_ROOT']."/assets/front/saleimg/productview/tp-1x/".$suburl."-0.png");
$lame = $_SERVER['DOCUMENT_ROOT']."/assets/front/saleimg/productview/tp-1x/".$suburl."-0.png";
var_dump(file_exists($lame));
var_dump(file_exists($_SERVER['DOCUMENT_ROOT']."/assets/front/saleimg/productview/tp-1x/".$suburl."-0.png"));
var_dump(is_file($_SERVER['DOCUMENT_ROOT']."/assets/front/saleimg/productview/tp-1x/".$suburl."-0.png"));
var_dump(is_readable($_SERVER['DOCUMENT_ROOT']."/assets/front/saleimg/productview/tp-1x/".$suburl."-0.png"));
?> -->
<img src="/assets/front/saleimg/placeholders/productbottles.png" />
<?php } ?>
</div>
<?php echo $this->getChildHtml('after');