Magento: remove break (br) tag from textarea
Posted by admin in Magento
After installing WYSIWYG editor to my magento site the <br /> tags were still added after each row in textareas. My main problem was the product description so I opened file /app/design/frontend/my_theme/my_theme/template/catalog/product/view/description.phtml and found line:
<?php echo $this->helper(’catalog/output’)->productAttribute($this->getProduct(), nl2br($this->getProduct()->getDescription()), ‘description’) ?>
and replaced it with:
<?php echo $this->helper(’catalog/output’)->productAttribute($this->getProduct(), $this->getProduct()->getDescription(), ‘description’) ?>
Basically I removed the nl2br() function which inserts the <br /> tags to the description text. You can do the same where ever the breaks are messing up your design view…
Magento: how to change image resolution?
Posted by admin in Magento
Magento resizes and sets image resolution to 75 by default. It was a big problem for me so I had to change that.
To reset image resize resolution open file /lib/Varien/Image/Adapter/Gd2.php and find (line 80):
call_user_func($this->_getCallback(’output’), $this->_imageHandler, $fileName);
and replace it with:
if (IMAGETYPE_JPEG === $this->_fileType)call_user_func($this->_getCallback(’output’), $this->_imageHandler, $fileName,100);
else
call_user_func($this->_getCallback(’output’), $this->_imageHandler, $fileName);
For this change to take the effect you need to reset your cache. In your administration go to System -> Cache Management and Clear Image Cache and Refresh All Cache!
Note: Currently I’m using Magento v.1.3.0.


