Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Using different Attribute Set for each of the products (glasses &amp; clothing) is a very good idea for this sort of store. However, you can also try for a separate attribute mentioning the type of product (between <code>glasses</code> &amp; <code>clothing</code>). </p> <p>Regarding the image resizing, I have found a very easy to use script, whose code is as below:-</p> <pre><code>public function resizeImage($imageName, $width=NULL, $height=NULL, $imagePath=NULL) { $imagePath = str_replace("/", DS, $imagePath); $imagePathFull = Mage::getBaseDir('media') . DS . $imagePath . DS . $imageName; if ($width == NULL &amp;&amp; $height == NULL) { $width = 100; $height = 100; } $resizePath = $width . 'x' . $height; $resizePathFull = Mage::getBaseDir('media') . DS . $imagePath . DS . $resizePath . DS . $imageName; if (file_exists($imagePathFull) &amp;&amp; !file_exists($resizePathFull)) { $imageObj = new Varien_Image($imagePathFull); $imageObj-&gt;constrainOnly(TRUE); $imageObj-&gt;keepAspectRatio(TRUE); $imageObj-&gt;resize($width, $height); $imageObj-&gt;save($resizePathFull); } $imagePath = str_replace(DS, "/", $imagePath); return Mage::getBaseUrl("media") . $imagePath . "/" . $resizePath . "/" . $imageName; } </code></pre> <p>You will definitely need to do some tweaking regarding the different dimensions which you want to provide, but still it's a very good piece of code (<a href="http://blog.chapagain.com.np/magento-custom-function-to-resize-image-proportionally/" rel="nofollow">available here</a>), which has saved my back many-a-times. </p> <p>Hope it helps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload