Archive for category Magento

Send email to CustomerService team from magento

$templateId = 1; # Transactional emails template
$mailSubject = 'your topic';
$sender = Array('name'  => Mage::getStoreConfig('trans_email/ident_support/name'),
'email' => Mage::getStoreConfig('trans_email/ident_support/email'));

$vars = Array('item'=>'item123', # your vars
'order'=>'order123');
$storeId = Mage::app()->getStore()->getId();
$translate  = Mage::getSingleton('core/translate');
Mage::getModel('core/email_template')
->setTemplateSubject($mailSubject)
->sendTransactional($templateId, $sender, $sender['email'], $sender['name'], $vars, $storeId);
$translate->setTranslateInline(true);

Tags: , ,

Converting price from one to another in magento

I found snippet here, but it seems it is broken as second parameter (target currency) is expected to be object

So correct would be


$targetCurrency = Mage::getModel('directory/currency')->load('EUR');
$price = round(Mage::helper('directory')->currencyConvert($priceToConvert, 'GBP', $targetCurrency), 2);

Tags: , ,

Fontis Recaptcha Magento Extension error solved

If you have problem with Fontis Recaptcha Magento Extension like below, read.

Invalid method Fontis_Recaptcha_Block_Review_Form::escapeHtml(Array
(
 [0] => Rating
)
)

Problem is that some of the methods in template are using non existing method. This only happend on product review form page.

edit app/design/frontend/default/default/template/fontis/recaptcha/form.phtml

Replace:

$this->escapeHtml(

with

$this->htmlEscape(

That’s it

Tags: , ,