The small images of Magento's (1.9.0.1.) built in new products widget are blurry. I am using the default rwd theme and it does not seem to happen to other widgets such as recently viewed products.
It also displays on multiple rows instead of alongside each other.
Sorry I can't post pictures yet
Thanks!
I found a solution:
The image resizing is the 'new.phtml' file, but the theme RWD does not have this file.
Copy the file app/design/frontend/base/default/template/catalog/product/new.phtml
to app/design/frontend/rwd/default/template/catalog/product/ and change the size in line 35.
Old:
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135) ?>" width="135" height="135"
New:
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(272) ?>" width="272" height="272"
I changed to 272 to not get blurred.
This worked for me on magento 1.9.2:
Edit this file (if there isnĀ“t this file, copy from base/default theme):
app/design/frontend/rwd/default/template/catalog/product/new.phtml
And then replace the < a > tag with this code at line 35:
<?php $_imgSize=300; ?>
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($_imgSize) ?>" width="<?php echo $_imgSize ?>" height="<?php echo $_imgSize ?>" alt="<?php echo $this->escapeHtml($_product->getName()) ?>" />
Allright I found a solution:
I had to modify a line in new_grid.phtml in app/design/frontend/[rwd]/default/template/catalog/product/widget/new/content
Change the 85 to 210 in this line:
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(210) ?>" alt="<?php echo $this->stripTags($_product->getName(), null, true) ?>" />
Related
http://www.rattanfurnitureuk.co.uk/sept2015/rattan-corner-sets.html
I have deleted the cache on the service but the images are still rendering blurry.
The images should be sharp and at 276 x 276px
In your Magento admin navigate to:
System > Configuration > Catalog > Product Image
Update the Small Image Width field to 276px. Then flush image cache and refresh full page cache.
Go to following location and open list.phtml file.
app\design\frontend\yourpackage\yourtheme\template\catalog\product\
and find the following line
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
In this code check
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135"
Try changing resize(135) and height and width also in above mentioned line.
Update:
You have following html in your site.
<a class="product-image" title="Maze Rattan - Winchester Square Corner Group" href="http://www.rattanfurnitureuk.co.uk/sept2015/rattan-corner-sets/maze-rattan-winchester-square-corner-group.html">
<img width="135" height="135" alt="Maze Rattan - Winchester Square Corner Group" src="http://www.rattanfurnitureuk.co.uk/sept2015/media/catalog/product/cache/1/small_image/135x/9df78eab33525d08d6e5fb8d27136e95/3/1/3198.jpg">
</a>
Check what is there in <img tag.
Due to some problems product images in cache folder turned empty (file is there but empty).Magneto loads product images from cache folder only.
For example: http://example.com/media/catalog/product/cache/54/small_image/295x295/9df78eab33525d08d6e5fb8d27136e95/b/r/br7462vi_1.png
here br7462vi_1.png turned empty.(0 bytes).
but http://example.com/media/catalog/product/b/r/br7462vi_1.png works fine.
How can I stop magento loading product images from cache?
No need to worry. Simply Login to admin panel.
Goto Admin ->System ->Cache management click on Flush Catalog Images Cache
And also flush all magento cache.
Now all image urls should work.
If you have still problem then just give 777 permission on media/catalog/product directory.
I hope it works.
Replace this from list.phtml and all your custome template where you want to load from main media folder
<img id="product-collection-image-<?php echo $_product->getId(); ?>"
src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(236,193); ?>"
alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
With This Code:
<img width="236" height="193" id="product-collection-image-<?php echo $_product->getId(); ?>"
src="<?php echo Mage::getModel('catalog/product_media_config')->getMediaUrl( $_product->getSmallImage()); ?>"
alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
it only for grid mode you can change for list mode also and product details page medai.pthml file only change on this file src tag src="<?php echo Mage::getModel('catalog/product_media_config')->getMediaUrl( $_product->getSmallImage()); ?>"
Reference: How to remove the cache url for product images in magento
I would like to turn all intro images on the blog layout to links to the articles just as read more does.
Found this post here:
Joomla 3.1 intro image as read more link
The solution here is to replace the code in default_item.php from this:
<img
<?php if ($images->image_intro_caption):
echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/>
To this:
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>"><img
<?php if ($images->image_intro_caption):
echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/> </a>
Followed the instructions, added an override folder in my template, copied default_item.php to it and made the change to the code. Nothing happened. I then tried to change the same lines in the component folder just to see if the problem was with the template override, nothing.
Is there another way of doing this?
Thanks in advance,
Guy.
default_item.php is only used as part of the featured articles view. If you are using the blog view, then the files appear under com_content/views/category/
The image itself is generated under com_content/views/category/blog_item.php on line 35
<?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>
Change this to (via your template override)
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>">
<?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>
</a>
I'm using Mgto 1702 with hellowired template. I have various stores that follow the subfolder method (www.domaian.com/store). The header image logo and the Alt text file is in its folder. When you visit www.domain.com/store1 or /store2, etc the right logo appears on the home site header. When I click on any link to change pages (for example, a product page) the header shows correctly but NOT the image.
The header.phtml file includes an If that asks if it's the Home page (getIsHomePage()):?> but that doesn't really matter. I placed the code outside the If clause and the problem persists. I added a "trick" echo clause to follow the behaviour in all cases. The text appears but not the JPG.
Any suggestions?
Thanks
<?php // if ($this->getIsHomePage()):?>
<h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></h1>
<?php /*else:?>
<strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" />
<?php endif */?>
please remove the condition as shown above in the header.phtml page to get the same header in all the pages.
I want to call the image that loads into the larger view area of the magento product page.
In the product view page, I have more view images when clicked, it shows the image in the larger view, not in default pop up window. I want to call the full size image of whatever the image is loaded in the larger view area. Can someone tell me how do I do it?
I did some search and found
echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(163, 100);
But this gets only the image which was there by default. I want to be able to call any image that comes in the larger view area.
try this code
$this->helper('catalog/image')->init($_product, 'image')
this will get you the image on product view page.
ok I think this might save ur trouble. ITs Damn easy
Lets say ur main image area is <img id="main-image" src="main-image.jpg" />
<?php foreach ($this->getGalleryImages() as $_image): ?>
<li>
<a class="grouped_elements" href="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile())->constrainOnly(TRUE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(260,null) ?>"
title="<?php echo $this->htmlEscape($_image->getLabel()) ?>" rel="group1">
<img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->constrainOnly(TRUE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(70,null) ?>"
width="70" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" />
</a>
</li>
<script type="text/javascript">
//<![CDATA[
jQuery("a.grouped_elements").click(function(){
$('#main-image').attr('src', this.attr('href'));
});
//]]>
</script>
Hope this should help ...
I think u must check the file
app\design\frontend\base\default\template\catalog\product\view
& its declared as in the
<block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>
this file gives u the Main Image & also the Gallery Images. of course u'll get only enabled images.
so What I understand from the subsequent comments. u need these images in a fancybox. there has to be a slideshow thing previou next etc. right??
ok Here it is what u can do. Create a new file under
app\design\frontend\base\default\template\catalog\product\view\fancy.media.phtml
(or u can use ur theme folder instead of base/default)
in ur catalog.xml add this block under
<block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>
<block type="catalog/product_view_media" name="fancy.media" template="catalog/product/view/fancy.media.phtml"/>
now in media.phtml u'll get all the images & there URLs. code the fancybox & pass the image url to it. &
& yeah don't forget to call this block in ur product page i.e.
app\design\frontend\base\default\template\catalog\product\view.phtml
by echo $this->getChilHtml('fancy.media')
I hope this must solve problem
UPDATE:
try this in fancy.media.phtml:
<?php foreach ($this->getGalleryImages() as $_image): ?>
<li>
<a class="grouped_elements" href="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile())->constrainOnly(TRUE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(260,null) ?>"
title="<?php echo $this->htmlEscape($_image->getLabel()) ?>" rel="group1">
<img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->constrainOnly(TRUE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(70,null) ?>"
width="70" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" />
</a>
</li>
<?php endforeach; ?>
<script type="text/javascript">
//<![CDATA[
$("a.grouped_elements").fancybox();
//]]>
</script>
Please refer to the Docs of fancybox, fancybox how to
I think ur requirement is if somebody clicks on the More-views on product page it must get open in fancybox. Right?? so u can place this code in media.phtml also. no need to create a new file & no need to edit the catalog.xml.
If u make this working then feel free to accept my answer.
I got the desired result by adding a button on media.phtml
<a class="fullscreen" href="#image" onclick="document.getElementById('image').style.width='100%'; return false; " > <img src="<?php echo $this->getSkinUrl('images/zoom_full.jpg') ?>" alt="<?php echo $this->__('Full Screen') ?>" title="<?php echo $this->__('Full Screen') ?>" /></a>
<script type="text/javascript"> j(document).ready(function() {
j(".fullscreen").fancybox({ 'transitionIn': 'fade', 'transitionOut':
'none', 'overlayColor': '#fff', 'overlayOpacity':1,
'hideOnOverlayClick':false }); </script>