Magento 1.9: Extensión Wishlist admin email, traducir a español y arreglar precios

Puede que nos interese conocer qué productos han añadido nuestros clientes a su wishlist. Para ello, existe una extensión (gratuita) que funciona con Magento 1.9, llamada Wishlist Admin Email.

Esta extensión funciona muy bien, pero tiene dos pegas:
1) Cuando envía el email de la wishlist, el precio que muestra en los productos es el precio SIN IMPUESTOS. Para corregirlo y que muestre el precio con impuestos, debemos editar el fichero app/design/frontend/base/default/template/me/wlae/email/items.phtml y modificar el cálculo del precio.

Reemplazar:

<?php echo $coreHelper->formatPrice($_product->getFinalPrice()); ?>

Por

<!-- modifico para que salga el precio con impuestos -->
<!--<?php echo $coreHelper->formatPrice($_product->getFinalPrice()); ?>-->
<?php 
$_priceIncludingTax = Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice());
echo $_priceIncludingTax;
?>

2) El email se envía en inglés. Aunque no es muy trascendente, puesto que solo el administrador recibe estos emails (y NO los reciben clientes) es interesante saber cómo traducir la plantilla.

Para añadir el fichero de traducciones, vamos a app/locale/es_ES y subimos el fichero con las traducciones (Me_Wlae.csv) con el siguiente contenido:

"Wishlist Admin Email","Wishlist Admin Email"
"Basic","Basico"
"Enable Extension","Habilitar extension"
"Enable Extension.","Deshabilitar extension."
"Yes","Si"
"No","No"
"Email Options","Opciones de email"
"Email Wishlist Items","Enviar items de wishlist"
"Send Only Newly Added","Enviar solo los nuevos"
"Send Entire Wishlist","Enviar wishlist completa"
"Please select to send only the recently added item, or the whole wishlist. In the second option the newly added item will be marked.","Por favor seleccione si enviar solo los items nuevos o la wishlist completa. En la segunda opcion se marcaran los productos nuevos."
"Send Emails To","Enviar emails a"
"Please enter the email address where notification will be sent.","Introduzca la direccion de email a la que llegaran las notificaciones."
"Send BCC Emails To","Enviar BCC a"
"Please enter the bcc copy email address where notification will be also sent.","Por favor introduce la direccion de email a la que se enviara copia de la notificacion."
"Email Sender","Email Sender"
"Please select the email sender from store email addresses.","Por favor, seleccione un sender de la lista de emails."
"Email Template","Plantilla Email"
"Please select the custom email template or use the default.","Por favor seleccione la plantilla custom de email o utilice la defecto."
"Email Items Setting","Ajustes basicos de email"
"Email Basic Setting","Ajuste basico email"

Asi nos quedaría, ya traducido, el panel de Admin del módulo (System > Config > Admin Wishlist Email)

magevolve-wishlist admin email traducido

Además hay que modificar el fichero app/locale/es_ES/template/email/me_wlae_notification.html y ponerle éste contenido:

<!--@subject {{var store.getFrontendName()}}: Wishlist Admin Notification @-->
<!--@vars
{"store url=\"\"":"Store Url",
"var logo_url":"Email Logo Image Url",
"var logo_alt":"Email Logo Image Alt",
"var customer_name":"Customer Name",
"var customer_email":"Customer Email",
"var items":"Items",
"var store.getFrontendName()":"Store Name"}
@-->
<!--@styles
body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
@-->
 
<body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
    <table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
        <tr>
            <td align="center" valign="top" style="padding:20px 0 20px 0">
                <!-- [ header starts here] -->
                <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
                    <tr>
                        <td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
                    </tr>
                    <!-- [ middle starts here] -->
                    <tr>
                        <td valign="top">
                            <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;">Notificación de wishlist</h1>
                            <p style="font-size:12px; line-height:16px; margin:0 0 16px 0;">Nuevo producto en wishlist...</p>
                            <p style="font-size:12px; line-height:16px; margin:0 0 16px 0;">
                                <strong>Detalles:</strong><br /><br />
                                Nombre cliente: {{var customer_name}}<br />
                                Email cliente: {{var customer_email}}
                            </p>
                            {{var items}}
                        </td>
                    </tr>
                    <tr>
                        <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;"><strong>{{var store.getFrontendName()}}</strong></p></center></td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>
</body>

Después vaciamos la cache y ¡listo!

Asi quedaría el email que recibe el admin…
magevolve admin wishlist email including taxes

[SOLVED] Magento 1.9 BUG FIX Cron email alerts sent in wrong language

I found a Magento bug which makes cron (price, stock) alerts emails being in the wrong language.

Issue

I have configured price alerts for a client (which originally registered into my shop with spanish language).

The user receives the email, but it is in english.

For instance, the text: “You are receiving this notification because you subscribed to receive alerts when the prices for the following products changed:” (in ./app/design/frontend/base/default/template/email/productalert/price.phtml) is not being translated to spanish.

I have checked and the translation is present in ./app/locale/es_ES/Mage_ProductAlert.csv: “You are receiving this notification because you subscribed to receive alerts when the prices for the following products changed:”,”Usted está recibiendo esta notificación porque está suscrito para recibir alertas cuando los precios de los siguientes productos cambien:”

I am using a custom theme.

I have also tried to add that translation to my theme: app/design/frontend/mytheme/default/locale/es_ES/translate.csv

I have flushed translations cache and deleted Magento cache. Still not being translated.

Fix

What I did to fix the issue:

Edit app/code/core/Mage/ProductAlert/Model/Email.php

Replace this (line 255):

       $appEmulation = Mage::getSingleton('core/app_emulation');
       $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);

With this:

        $appEmulation = Mage::getSingleton('core/app_emulation');
        $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);
        //Dealing with uninitialized translator!
        Mage::app()->getTranslator()->init('frontend', true);

Flushed the cache and voila! Now magento is sending the email alerts in the right language 🙂

OSTicket: open source support / ticketing software with POP / IMAP

osTicket is a widely-used open source support ticket system. It seamlessly integrates inquiries created via email, phone and web-based forms into a simple easy-to-use multi-user web interface. Manage, organize and archive all your support requests and responses in one place while providing your customers with accountability and responsiveness they deserve.

osTicket is configured by default like the following: the client (user) fills in a form with information related to the issue he is having and then submits it. osTicket processes that info and shows it to the staff team so that the support can be given.

In our institution people are used to tell about their tech issues using email (suppose this email is support@yourinstitution.com) and we did not want to change this. So we thought there might be a trick to forward all the support@yourinstitution.com mails to osticket. And there is indeed!

There are two ways of achieving this:

1. Use pipes to forward the mails to osTicket system (original post talking about this and another post talking about this).

2. Configure osTicket to use POP/IMAP (check this post)

I have tried both options. The steps you should follow are:

OSTicket with pipes

Enable Email Piping:
Admin Panel -> Preferences -> Email Settings -> Enable Email Piping

chmod the file pipe.php in the api folder:

# cd /var/www/html/osticket/buz/api/
# chmod 764 pipe.php

Edit your aliases file

# vi /etc/aliases

and add the pipe line (supportusername is the name of the user to which the email will be forwarded):

supportusername: "|/usr/bin/php -q /var/www/html/osticket/buz/api/pipe.php"

Regenerate aliases file

# newaliases

Find php:

# whereis php
php: /usr/bin/php

Configure your email program (mine is sendmail). Spanish readers can refer to this sendmail guide

Enable your supportusername to run php:

#chmod 764 /usr/bin/php

Send an email to check it works:

# mail -s "Checking osticket piping" supportusername
This is a test
.
CC:

If something does not work as expected check the logs (tail -f -n 100 /var/log/maillog)

When everything is working as expected…
Forward your support@yourinstitution.com email to the server hosting osticket.

** Edit: I have noticed several problems with this configuration. When the emails are piped to osticket the headers are rewriten so the support staff does not know the client’s email!!

So I decided to try the IMAP configuration.

The IMAP/POP configuration

First of all, configure php-imap.

Then go to Settings -> Email Settings and:
For Incoming Emails:
* disable Enable email piping (You pipe we accept policy)
* enable Enable POP/IMAP email fetch (Global setting which can be disabled at email level)
For Outgoing Emails my config is like:
* Use PHP mail function

Now go to Email tab.
Create a new email account. Mine is configured as shown in the image:
osticket pop imap configuration