All posts tagged communication

Zopim Chat by Diglin in the Magento Homepage

Frontend Zopim Badge

I published a new module for Magento to integrate the Zopim Chat into your Magento Shop installation. This is an unofficial version of the module and supported by Diglin GmbH.

This module has for advantage:

  • to integrate easily and quickly the widget into your Magento installation by just entering your Zopim credentials, it will enable automatically the widget for you.
  • to allow to create a configuration for each store view
  • to configure some options of the Chat: window, buble, button (color, position, text, language synchronisation mode …) for all store views or for a specific one.
  • to get access to the Zopim dashboard directly from your Magento backend and chat directly with your visitors.

An official version exists but don’t take in charge the configuration per store view and doesn’t allow to define the chat for specific Magento page.

You can visit the Magento Connect page to get this module. Clic on the pictures below to zoom in and get a preview of the module. You can click on the button “Read more” to get more information about Zopim Chat.

What is Zopim Chat?

This service is available under différent prices at this address http://www.zopim.com

Zopim Live Chat is a web-based application that lets businesses monitor and engage website visitors in real time. Designed with small medium businesses in mind, it is easy to use, affordable and powerful.
Zopim was the first to introduce live chat widgets thats built right into your website. This gives your customers a more seamless and pleasant chatting experience while surfing your site. No more annoying popup chat windows!
Log in to Zopim’s web-based dashboard to get a wealth of information about your visitors in real-time. With an intuitive interface and features, you’ll become an expert in customer service within minutes.

widget 3 widget2

dashboard incoming chats

logo_paypal

There is a bug in Paypal Standard for Magento, when a customer has finished the order process and validate his payment in Paypal, the customer doesn’t receive any email including his invoice. He receives only a confirmation payment of Paypal and a message after the process to tell him that the order is going to be proceeded.

To resolve this problem, two possibilities:

  • Overload the class in your own module : Mage_Paypal_Model_Standard (app/code/core/Mage/Paypal/Model/) at the line 418 after $invoice->register()->pay();, add the following line: $invoice->sendEmail();
  • Create an event with the help of a class Observer.php which trigger after the event sales_order_invoice_pay, which in Paypal standard start at line 418, after the treatment $invoice->register()->pay(). To do it, you have to create a module (there is lots of tutorials on Google to know how to do it) with the following files (replace Name by the name of your module):
    • /app/code/local/Name/Sales/etc/config.xml
    • /app/code/local/Name/Sales/Model/Observer.php
    • /app/etc/modules/Name_All.xm
Here the content:
/app/code/local/Name/Sales/etc/config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Name_Sales>
            <version>0.1.0</version>
        </Name_Sales>
    </modules>
    <global>
        <models>
            <sales>
                <rewrite>
                    <observer>Name_Sales_Model_Observer</observer>
                </rewrite>
            </sales>
        </models>
        <events>
            <sales_order_invoice_pay>
                <observers>
                    <sales_notification_observer>
                        <type>singleton</type>
                        <class>sales/observer</class>
                        <method>sendInvoiceEmail</method>
                    </sales_notification_observer>
                </observers>
            </sales_order_invoice_pay>
        </events>
    </global>
</config>

/app/code/local/Name/Sales/Model/Observer.php

<?php
/**
 * Event sales_order_invoice_pay
 *
 */
require_once 'Mage/Sales/Model/Observer.php';
class Name_Sales_Model_Observer extends Mage_Sales_Model_Observer {
 
    public function sendInvoiceEmail($observer) {
            $invoice = $observer->getEvent ()->getInvoice ();
 
            switch ($invoice->getState ()) {
                case Mage_Sales_Model_Order_Invoice::STATE_PAID :
 
		try {
			// Save first time the invoice to get an id and send the invoice to the customer with the correct id
			$invoice->save ();
			Mage::log ('Email sent to the customer by the Name/sales/observer - Invoice number ' . $invoice->getIncrementId(), Zend_Log::DEBUG );
			$invoice->sendEmail ();
			$invoice->setEmailSent ( true );
			// Save a second time to save the EmailSent value
			$invoice->save ();
		} catch ( Exception $e ) {
			$session = Mage::getSingleton ( 'core/session' );
			$exception = new Exception ( Mage::helper('Sales')->__('Error during the email sending.'), 0 );
			$session->addException ( $exception, Mage::helper('Sales')->__('Error to send invoice email. Please, contact the website administrator.') );
		}
            }
        return $this;
    }
}

/app/etc/modules/Name_All.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Name_Sales>
            <active>true</active>
            <codePool>local</codePool>
        </Name_Sales>
    </modules>
</config>

In Paypal Express, the interesting line is in the controller /app/code/core/Mage/Paypal/controllers/expressController.php, in the method updateorderAction(){} the code is near of $invoice->register()->capture(); add $invoice->sendEmail(); or use this observer (untested).

For more information about the events I invite you to visit the Magento website which make good explanation: Customizing Magento using Event-Observer Method