Magento Category Page Image Resize

Share
Posted on March 22nd, 2013 | Posted by admin

You may want to increase the size of the images shown on the category pages of your Magento theme. To do so open list.phtml in

app/design/frontend/yourpackage/yourtheme/template/catalog/product/

. Search for the code below and edit the sizes listed.

<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(225, 225); ?>”
 width="225" height="225" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image'))
 ?>” title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>” />

How to open an image in the same product page of Magento

Share
Posted on March 20th, 2013 | Posted by admin

How to open an image in the same product page of Magento
No popup window with the image nor the single image alone in the same page.

If you want to replace the large image with the image displayed in the thumbnail when these are clicked, here are the steps to do it:

  1. Edit the file media.phtml that you will find in app/design/frontend/[YOUR TEMPLATE]/default/template/catalog/product/view/
  2. In the final line add a new one and copy/paste the following code:
    81 <script type="text/javascript">
    82 function imageReplace(newimageURL){
    83 document.getElementById("pimage").setAttribute('src', newimageURL);
    84 document.getElementById("pimage").style.width = '100%';
    85 }
    86 </script>
  3. Approximately, on line 62 you will find the following code:

Helpful image library functions in magento

Share
Posted on September 19th, 2012 | Posted by admin

Magento Wraps PHP Image Library Functions in its library with its own wrapper functions. Magento Provides the general adapter for image manipulation. This gives us the flexibility to use any PHP libraries like GD2, imagemagik etc.

Some of the common wrapper functions are

  1. crop
  2. resize
  3. rotate

You can make use of these functions in your custom code. To Utilise these functions we need to create an object of type Varien_Image with image name along with the path.

How to display Image Preview in Admin Form magento

Share
Posted on January 28th, 2012 | Posted by admin

Magento allows us to create custom form in admin panel by creating our own custom module. We can create almost any field in the admin form by creating a class that extends the base class Mage_Adminhtml_Block_Widget_Form. The _prepareForm method allows to define our form elements.
Sometimes we may need to upload a file in the adminform, the default file field doesn’t provide the image preview when we upload an image file. For this purpose we need to use image field type as shown in the below snippet

$fieldset->addField('filename', 'image', array(
'label' => Mage::helper('customform')->__('Image'),
'required' => false,
'name' => 'filename',
));

Product Image Preview, quick view image module in magento

Share
Posted on June 10th, 2011 | Posted by admin

This extension will install a wonderful and ready-to-use product image preview widget in your Magento store. This is an impressive script that allows your visitors to conveniently zoom out an product image that they want to view. Installation is very easy via FTP and no coding experience is required to have module up-and-running.
FEATURES

  1. Allow customers zoom out product images they want to view
  2. Allow admin to configure the following parameters: Image Preview size, Border Image Preview, Border Color for Image Preview, Text Image Preview, Text color
Page 1 of 212»