Version Notes
edrone magento module - 1.0.6 release
Download this release
Release Info
| Developer | Michał Blak |
| Extension | edroneCRM |
| Version | 1.0.6 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.5 to 1.0.6
app/code/local/Edrone/Base/Block/Base.php~
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Edrone_Base_Block_Base extends Mage_Core_Block_Template
|
| 4 |
+
{
|
| 5 |
+
|
| 6 |
+
/**
|
| 7 |
+
* @var Edrone_Base_Helper_Config
|
| 8 |
+
*/
|
| 9 |
+
private $configHelper;
|
| 10 |
+
/**
|
| 11 |
+
* @var Edrone_Base_Helper_Data
|
| 12 |
+
*/
|
| 13 |
+
private $helper;
|
| 14 |
+
|
| 15 |
+
/**
|
| 16 |
+
* @var array
|
| 17 |
+
*/
|
| 18 |
+
protected $customerData = array();
|
| 19 |
+
|
| 20 |
+
public function _construct()
|
| 21 |
+
{
|
| 22 |
+
parent::_construct();
|
| 23 |
+
|
| 24 |
+
$this->configHelper = Mage::helper('edrone/config');
|
| 25 |
+
$this->helper = Mage::helper('edrone');
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
/**
|
| 29 |
+
* @return Edrone_Base_Helper_Config
|
| 30 |
+
*/
|
| 31 |
+
public function getConfigHelper()
|
| 32 |
+
{
|
| 33 |
+
return $this->configHelper;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
/**
|
| 37 |
+
* @return Edrone_Base_Helper_Data
|
| 38 |
+
*/
|
| 39 |
+
public function getHelper()
|
| 40 |
+
{
|
| 41 |
+
return $this->helper;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
/**
|
| 45 |
+
* @return array
|
| 46 |
+
*/
|
| 47 |
+
public function getCustomerData()
|
| 48 |
+
{
|
| 49 |
+
if(!count($this->customerData)) {
|
| 50 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
| 51 |
+
$this->getLoggedCustomerData();
|
| 52 |
+
} else {
|
| 53 |
+
$this->getGuestCustomerData();
|
| 54 |
+
}
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
return $this->customerData;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
private function getLoggedCustomerData()
|
| 61 |
+
{
|
| 62 |
+
/** @var Mage_Customer_Model_Customer $customer */
|
| 63 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
| 64 |
+
$this->customerData['first_name'] = $customer->getFirstname();
|
| 65 |
+
$this->customerData['last_name'] = $customer->getLastname();
|
| 66 |
+
$this->customerData['email'] = $customer->getEmail();
|
| 67 |
+
|
| 68 |
+
$subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($customer->getEmail());
|
| 69 |
+
if($subscriber){
|
| 70 |
+
$this->customerData['subscriber_status'] = ( $subscriber->getStatus() == Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED ) ? 1 : 0;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
if ($address = $customer->getDefaultShippingAddress()) {
|
| 74 |
+
$this->customerData['country'] = $address->getCountry();
|
| 75 |
+
$this->customerData['city'] = $address->getCity();
|
| 76 |
+
$this->customerData['phone'] = $address->getTelephone();
|
| 77 |
+
} else {
|
| 78 |
+
$this->customerData['country'] = '';
|
| 79 |
+
$this->customerData['city'] = '';
|
| 80 |
+
$this->customerData['phone'] = '';
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
$this->customerData['is_logged_in'] = 1;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
private function getGuestCustomerData()
|
| 87 |
+
{
|
| 88 |
+
$this->customerData['first_name'] = '';
|
| 89 |
+
$this->customerData['last_name'] = '';
|
| 90 |
+
$this->customerData['email'] = '';
|
| 91 |
+
$this->customerData['country'] = '';
|
| 92 |
+
$this->customerData['city'] = '';
|
| 93 |
+
$this->customerData['phone'] = '';
|
| 94 |
+
|
| 95 |
+
$quote = Mage::getModel('checkout/cart')->getQuote();
|
| 96 |
+
$address = $quote->getBillingAddress();
|
| 97 |
+
|
| 98 |
+
if($address) {
|
| 99 |
+
$this->customerData['first_name'] = $address->getFirstname();
|
| 100 |
+
$this->customerData['last_name'] = $address->getFirstname();
|
| 101 |
+
$this->customerData['email'] = $address->getFirstname();
|
| 102 |
+
$this->customerData['country'] = $address->getFirstname();
|
| 103 |
+
$this->customerData['city'] = $address->getFirstname();
|
| 104 |
+
$this->customerData['phone'] = $address->getTelephone();
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
$this->customerData['is_logged_in'] = 0;
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
}
|
| 111 |
+
}
|
app/code/local/Edrone/Base/Block/Cart.php
CHANGED
|
@@ -9,10 +9,10 @@ class Edrone_Base_Block_Cart extends Edrone_Base_Block_Base
|
|
| 9 |
{
|
| 10 |
$productData = array();
|
| 11 |
$product = Mage::getModel('core/session')->getProductToShoppingCart();
|
| 12 |
-
|
| 13 |
if ($product && $product->getSku()) {
|
|
|
|
| 14 |
$productData['sku'] = $product->getSku();
|
| 15 |
-
$productData['id'] = $product->
|
| 16 |
$productData['title'] = $product->getTitle();
|
| 17 |
$productData['image'] = $product->getImage();
|
| 18 |
|
| 9 |
{
|
| 10 |
$productData = array();
|
| 11 |
$product = Mage::getModel('core/session')->getProductToShoppingCart();
|
|
|
|
| 12 |
if ($product && $product->getSku()) {
|
| 13 |
+
|
| 14 |
$productData['sku'] = $product->getSku();
|
| 15 |
+
$productData['id'] = intval( Mage::getModel("catalog/product")->getIdBySku( $product->getSku() ) );
|
| 16 |
$productData['title'] = $product->getTitle();
|
| 17 |
$productData['image'] = $product->getImage();
|
| 18 |
|
package.xml
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>edroneCRM</name>
|
| 4 |
-
<version>1.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>GPL</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>edrone - first CRM for e-commerce Maintain clients & increase customer retention with dynamic e-CRM.</summary>
|
| 10 |
<description>edrone is collecting and analyzing Magento visitors and customers data. The plugin allows processing personal data in the real-time in order to communicate with them through dynamic and personalized e-mail.</description>
|
| 11 |
-
<notes>edrone magento module</notes>
|
| 12 |
<authors><author><name>Michał Blak</name><user>MAG002993376</user><email>michalblak@gmail.com</email></author></authors>
|
| 13 |
-
<date>2015-11-
|
| 14 |
-
<time>
|
| 15 |
-
<contents><target name="magelocal"><dir name="Edrone"><dir name="Base"><dir name="Block"><file name="Base.php" hash="ad12027aa8779c42a3da96bb4c17e40b"/><file name="Cart.php" hash="
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>edroneCRM</name>
|
| 4 |
+
<version>1.0.6</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>GPL</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>edrone - first CRM for e-commerce Maintain clients & increase customer retention with dynamic e-CRM.</summary>
|
| 10 |
<description>edrone is collecting and analyzing Magento visitors and customers data. The plugin allows processing personal data in the real-time in order to communicate with them through dynamic and personalized e-mail.</description>
|
| 11 |
+
<notes>edrone magento module - 1.0.6 release</notes>
|
| 12 |
<authors><author><name>Michał Blak</name><user>MAG002993376</user><email>michalblak@gmail.com</email></author></authors>
|
| 13 |
+
<date>2015-11-16</date>
|
| 14 |
+
<time>10:17:56</time>
|
| 15 |
+
<contents><target name="magelocal"><dir name="Edrone"><dir name="Base"><dir name="Block"><file name="Base.php" hash="ad12027aa8779c42a3da96bb4c17e40b"/><file name="Base.php~" hash="82030cabfaba3e3fd52915d4b7b25a44"/><file name="Cart.php" hash="3beb45a6fd0f7dd2bb57969f0b0bcf3c"/><file name="Order.php" hash="81d09cbe0f5c89fb93294739b84e49b9"/><file name="Product.php" hash="c2a7fa725d55ddda2c31edfcdd523eb0"/></dir><dir name="Helper"><file name="Config.php" hash="194670e7ef6eb1dc89b8a61a38499264"/><file name="Data.php" hash="a9040014b1b54a1d3cc7ebf401f489c0"/></dir><dir name="Model"><file name="Observer.php" hash="f35c3bf591865d6db22e2477580df76c"/></dir><dir name="controllers"><file name="NewsletterController.php" hash="fa9e82363c785ce94e005a7aad141162"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0e715e76c00295dc4e555411455fedfb"/><file name="config.xml" hash="2545eea07f413e16e0b2eda541dac12b"/><file name="system.xml" hash="51dc19fd276baa4e2b3fd8e290e67d4b"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="edrone"><file name="cart_view.phtml" hash="ff8f5744edae1c093830624c0e6f7d70"/><file name="default.phtml" hash="59d4d6a24afd1b45c9fc9b40920e9586"/><file name="product_view.phtml" hash="26aed783e26a2d555ddcf7a7a5cf07d1"/><file name="success_view.phtml" hash="efae373e96dd732d672440a5775724cc"/></dir></dir><dir name="layout"><file name="edrone.xml" hash="48e37d1c01507337f8dc33eb9e03af34"/></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Edrone_Base.xml" hash="29d3699c3a83fa4fea848a6cb7800872"/></dir></dir></target><target name="magelocale"><dir name="pl_PL"><file name="Edrone.csv" hash="b8aa59d39815f4d92738129cc9fbdf34"/></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
