Version Notes
edrone magento module - initial public release
Download this release
Release Info
| Developer | Michał Blak |
| Extension | edroneCRM |
| Version | 1.0.0 |
| Comparing to | |
| See all releases | |
Version 1.0.0
- app/code/local/Edrone/Base/Block/Base.php +74 -0
- app/code/local/Edrone/Base/Block/Cart.php +23 -0
- app/code/local/Edrone/Base/Block/Order.php +48 -0
- app/code/local/Edrone/Base/Block/Product.php +19 -0
- app/code/local/Edrone/Base/Helper/Config.php +32 -0
- app/code/local/Edrone/Base/Helper/Data.php +5 -0
- app/code/local/Edrone/Base/Model/Observer.php +22 -0
- app/code/local/Edrone/Base/etc/adminhtml.xml +25 -0
- app/code/local/Edrone/Base/etc/config.xml +68 -0
- app/code/local/Edrone/Base/etc/system.xml +56 -0
- app/design/frontend/base/default/layout/edrone.xml +29 -0
- app/design/frontend/base/default/template/edrone/cart_view.phtml +37 -0
- app/design/frontend/base/default/template/edrone/default.phtml +34 -0
- app/design/frontend/base/default/template/edrone/product_view.phtml +35 -0
- app/design/frontend/base/default/template/edrone/success_view.phtml +37 -0
- app/etc/modules/Edrone_Base.xml +9 -0
- app/locale/pl_PL/Edrone.csv +2 -0
- package.xml +19 -0
app/code/local/Edrone/Base/Block/Base.php
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Edrone_Base_Block_Base extends Mage_Core_Block_Template
|
| 4 |
+
{
|
| 5 |
+
const CUSTOMER_DATA_KEY = 'customerData';
|
| 6 |
+
|
| 7 |
+
/**
|
| 8 |
+
* @var Edrone_Base_Helper_Config
|
| 9 |
+
*/
|
| 10 |
+
private $helper;
|
| 11 |
+
|
| 12 |
+
/**
|
| 13 |
+
* @var array
|
| 14 |
+
*/
|
| 15 |
+
protected $customerData = array();
|
| 16 |
+
|
| 17 |
+
public function __construct()
|
| 18 |
+
{
|
| 19 |
+
$this->helper = Mage::helper('edrone/config');
|
| 20 |
+
$this->customerData = Mage::registry(self::CUSTOMER_DATA_KEY);
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
/**
|
| 24 |
+
* @return Edrone_Base_Helper_Config
|
| 25 |
+
*/
|
| 26 |
+
public function getHelper()
|
| 27 |
+
{
|
| 28 |
+
return $this->helper;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
/**
|
| 32 |
+
* @return array
|
| 33 |
+
*/
|
| 34 |
+
public function getCustomerData()
|
| 35 |
+
{
|
| 36 |
+
if (empty($this->customerData)) {
|
| 37 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
| 38 |
+
$this->getLoggedCustomerData();
|
| 39 |
+
} else {
|
| 40 |
+
$this->getGuestCustomerData();
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
Mage::register(self::CUSTOMER_DATA_KEY, $this->customerData);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
return $this->customerData;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
private function getLoggedCustomerData()
|
| 50 |
+
{
|
| 51 |
+
/** @var Mage_Customer_Model_Customer $customer */
|
| 52 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
| 53 |
+
$this->customerData['first_name'] = $customer->getFirstname();
|
| 54 |
+
$this->customerData['last_name'] = $customer->getLastname();
|
| 55 |
+
$this->customerData['email'] = $customer->getEmail();
|
| 56 |
+
|
| 57 |
+
if ($address = $customer->getDefaultShippingAddress()) {
|
| 58 |
+
$this->customerData['country'] = $address->getCountry();
|
| 59 |
+
$this->customerData['city'] = $address->getCity();
|
| 60 |
+
} else {
|
| 61 |
+
$this->customerData['country'] = '';
|
| 62 |
+
$this->customerData['city'] = '';
|
| 63 |
+
}
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
private function getGuestCustomerData()
|
| 67 |
+
{
|
| 68 |
+
$this->customerData['first_name'] = '';
|
| 69 |
+
$this->customerData['last_name'] = '';
|
| 70 |
+
$this->customerData['email'] = '';
|
| 71 |
+
$this->customerData['country'] = '';
|
| 72 |
+
$this->customerData['city'] = '';
|
| 73 |
+
}
|
| 74 |
+
}
|
app/code/local/Edrone/Base/Block/Cart.php
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Edrone_Base_Block_Cart extends Edrone_Base_Block_Base
|
| 4 |
+
{
|
| 5 |
+
/**
|
| 6 |
+
* @return array
|
| 7 |
+
*/
|
| 8 |
+
public function getProductData()
|
| 9 |
+
{
|
| 10 |
+
$productData = array();
|
| 11 |
+
$product = Mage::getModel('core/session')->getProductToShoppingCart();
|
| 12 |
+
|
| 13 |
+
if ($product && $product->getSku()) {
|
| 14 |
+
$productData['sku'] = $product->getSku();
|
| 15 |
+
$productData['title'] = $product->getTitle();
|
| 16 |
+
$productData['image'] = $product->getImage();
|
| 17 |
+
|
| 18 |
+
Mage::getModel('core/session')->unsProductToShoppingCart();
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
return $productData;
|
| 22 |
+
}
|
| 23 |
+
}
|
app/code/local/Edrone/Base/Block/Order.php
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Edrone_Base_Block_Order extends Edrone_Base_Block_Base
|
| 4 |
+
{
|
| 5 |
+
/**
|
| 6 |
+
* @return array
|
| 7 |
+
*/
|
| 8 |
+
public function getOrderData()
|
| 9 |
+
{
|
| 10 |
+
$orderData = $skus = $titles = $images = array();
|
| 11 |
+
|
| 12 |
+
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
| 13 |
+
$order = Mage::getModel('sales/order')->load($lastOrderId);
|
| 14 |
+
|
| 15 |
+
foreach ($order->getAllVisibleItems() as $item) {
|
| 16 |
+
$skus[] = $item->getSku();
|
| 17 |
+
$titles[] = $item->getName();
|
| 18 |
+
$images[] = (string)Mage::helper('catalog/image')->init($item->getProduct(), 'image')->resize(438);
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
$orderData['sku'] = join('|', $skus);
|
| 22 |
+
$orderData['title'] = join('|', $titles);
|
| 23 |
+
$orderData['image'] = join('|', $images);
|
| 24 |
+
$orderData['order_id'] = $order->getIncrementId();
|
| 25 |
+
$orderData['order_payment_value'] = $order->getGrandTotal();
|
| 26 |
+
$orderData['currency'] = $order->getBaseCurrencyCode();
|
| 27 |
+
|
| 28 |
+
return $orderData;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
public function getCustomerData()
|
| 32 |
+
{
|
| 33 |
+
parent::getCustomerData();
|
| 34 |
+
|
| 35 |
+
if (empty($this->customerData['first_name'])) {
|
| 36 |
+
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
| 37 |
+
$order = Mage::getModel('sales/order')->load($lastOrderId);
|
| 38 |
+
|
| 39 |
+
$this->customerData['first_name'] = $order->getBillingAddress()->getFirstname();
|
| 40 |
+
$this->customerData['last_name'] = $order->getBillingAddress()->getLastname();
|
| 41 |
+
$this->customerData['email'] = $order->getBillingAddress()->getEmail();
|
| 42 |
+
$this->customerData['country'] = $order->getBillingAddress()->getCountry();
|
| 43 |
+
$this->customerData['city'] = $order->getBillingAddress()->getCity();
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
return $this->customerData;
|
| 47 |
+
}
|
| 48 |
+
}
|
app/code/local/Edrone/Base/Block/Product.php
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Edrone_Base_Block_Product extends Edrone_Base_Block_Base
|
| 4 |
+
{
|
| 5 |
+
/**
|
| 6 |
+
* @return array
|
| 7 |
+
*/
|
| 8 |
+
public function getProductData()
|
| 9 |
+
{
|
| 10 |
+
$productArray = array();
|
| 11 |
+
$product = Mage::registry('current_product');
|
| 12 |
+
|
| 13 |
+
$productArray['sku'] = $product->getSku();
|
| 14 |
+
$productArray['title'] = $product->getName();
|
| 15 |
+
$productArray['image'] = (string)Mage::helper('catalog/image')->init($product, 'image')->resize(438);
|
| 16 |
+
|
| 17 |
+
return $productArray;
|
| 18 |
+
}
|
| 19 |
+
}
|
app/code/local/Edrone/Base/Helper/Config.php
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Edrone_Base_Helper_Config extends Mage_Core_Helper_Abstract
|
| 4 |
+
{
|
| 5 |
+
const APP_ID_CONFIG_PATH = "edrone/base/app_id";
|
| 6 |
+
const EXTERNAL_SCRIPT_URL_CONFIG_PATH = "edrone/base/external_script_url";
|
| 7 |
+
const COLLECTOR_URL_CONFIG_PATH = "edrone/base/collector_url";
|
| 8 |
+
|
| 9 |
+
/**
|
| 10 |
+
* @return string
|
| 11 |
+
*/
|
| 12 |
+
public function getAppId()
|
| 13 |
+
{
|
| 14 |
+
return (string)Mage::getStoreConfig(self::APP_ID_CONFIG_PATH);
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
/**
|
| 18 |
+
* @return string
|
| 19 |
+
*/
|
| 20 |
+
public function getExternalScriptUrl()
|
| 21 |
+
{
|
| 22 |
+
return (string)Mage::getStoreConfig(self::EXTERNAL_SCRIPT_URL_CONFIG_PATH);
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
* @return string
|
| 27 |
+
*/
|
| 28 |
+
public function getCollectorUrl()
|
| 29 |
+
{
|
| 30 |
+
return (string)Mage::getStoreConfig(self::COLLECTOR_URL_CONFIG_PATH);
|
| 31 |
+
}
|
| 32 |
+
}
|
app/code/local/Edrone/Base/Helper/Data.php
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Edrone_Base_Helper_Data extends Mage_Core_Helper_Abstract
|
| 4 |
+
{
|
| 5 |
+
}
|
app/code/local/Edrone/Base/Model/Observer.php
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Edrone_Base_Model_Observer
|
| 4 |
+
{
|
| 5 |
+
public function addToCart()
|
| 6 |
+
{
|
| 7 |
+
$product = Mage::getModel('catalog/product')
|
| 8 |
+
->load(Mage::app()->getRequest()->getParam('product', 0));
|
| 9 |
+
|
| 10 |
+
if (!$product->getId()) {
|
| 11 |
+
return;
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
Mage::getModel('core/session')->setProductToShoppingCart(
|
| 15 |
+
new Varien_Object(array(
|
| 16 |
+
'sku' => $product->getSku(),
|
| 17 |
+
'title' => $product->getName(),
|
| 18 |
+
'image' => (string)Mage::helper('catalog/image')->init($product, 'image')->resize(438),
|
| 19 |
+
))
|
| 20 |
+
);
|
| 21 |
+
}
|
| 22 |
+
}
|
app/code/local/Edrone/Base/etc/adminhtml.xml
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<acl>
|
| 4 |
+
<resources>
|
| 5 |
+
<all>
|
| 6 |
+
<title>Allow Everything</title>
|
| 7 |
+
</all>
|
| 8 |
+
<admin>
|
| 9 |
+
<children>
|
| 10 |
+
<system>
|
| 11 |
+
<children>
|
| 12 |
+
<config>
|
| 13 |
+
<children>
|
| 14 |
+
<edrone>
|
| 15 |
+
<title>Edrone</title>
|
| 16 |
+
</edrone>
|
| 17 |
+
</children>
|
| 18 |
+
</config>
|
| 19 |
+
</children>
|
| 20 |
+
</system>
|
| 21 |
+
</children>
|
| 22 |
+
</admin>
|
| 23 |
+
</resources>
|
| 24 |
+
</acl>
|
| 25 |
+
</config>
|
app/code/local/Edrone/Base/etc/config.xml
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Edrone_Base>
|
| 5 |
+
<version>1.0.0</version>
|
| 6 |
+
</Edrone_Base>
|
| 7 |
+
</modules>
|
| 8 |
+
<global>
|
| 9 |
+
<blocks>
|
| 10 |
+
<edrone>
|
| 11 |
+
<class>Edrone_Base_Block</class>
|
| 12 |
+
</edrone>
|
| 13 |
+
</blocks>
|
| 14 |
+
<helpers>
|
| 15 |
+
<edrone>
|
| 16 |
+
<class>Edrone_Base_Helper</class>
|
| 17 |
+
</edrone>
|
| 18 |
+
</helpers>
|
| 19 |
+
</global>
|
| 20 |
+
<frontend>
|
| 21 |
+
<layout>
|
| 22 |
+
<updates>
|
| 23 |
+
<edrone>
|
| 24 |
+
<file>edrone.xml</file>
|
| 25 |
+
</edrone>
|
| 26 |
+
</updates>
|
| 27 |
+
</layout>
|
| 28 |
+
<translate>
|
| 29 |
+
<modules>
|
| 30 |
+
<edrone>
|
| 31 |
+
<files>
|
| 32 |
+
<default>Edrone.csv</default>
|
| 33 |
+
</files>
|
| 34 |
+
</edrone>
|
| 35 |
+
</modules>
|
| 36 |
+
</translate>
|
| 37 |
+
<events>
|
| 38 |
+
<checkout_cart_product_add_after>
|
| 39 |
+
<observers>
|
| 40 |
+
<edrone_add_to_cart_after>
|
| 41 |
+
<class>Edrone_Base_Model_Observer</class>
|
| 42 |
+
<method>addToCart</method>
|
| 43 |
+
</edrone_add_to_cart_after>
|
| 44 |
+
</observers>
|
| 45 |
+
</checkout_cart_product_add_after>
|
| 46 |
+
</events>
|
| 47 |
+
</frontend>
|
| 48 |
+
<adminhtml>
|
| 49 |
+
<translate>
|
| 50 |
+
<modules>
|
| 51 |
+
<edrone>
|
| 52 |
+
<files>
|
| 53 |
+
<default>Edrone.csv</default>
|
| 54 |
+
</files>
|
| 55 |
+
</edrone>
|
| 56 |
+
</modules>
|
| 57 |
+
</translate>
|
| 58 |
+
</adminhtml>
|
| 59 |
+
<default>
|
| 60 |
+
<edrone>
|
| 61 |
+
<base>
|
| 62 |
+
<app_id>INSERT_APP_ID_HERE</app_id>
|
| 63 |
+
<external_script_url>//api.edrone.me/edrone_2_0.js</external_script_url>
|
| 64 |
+
<collector_url>https://api.edrone.me/trace.php</collector_url>
|
| 65 |
+
</base>
|
| 66 |
+
</edrone>
|
| 67 |
+
</default>
|
| 68 |
+
</config>
|
app/code/local/Edrone/Base/etc/system.xml
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<config>
|
| 3 |
+
<tabs>
|
| 4 |
+
<edrone translate="label" module="edrone">
|
| 5 |
+
<label>Edrone</label>
|
| 6 |
+
<sort_order>100</sort_order>
|
| 7 |
+
</edrone>
|
| 8 |
+
</tabs>
|
| 9 |
+
<sections>
|
| 10 |
+
<edrone translate="label" module="edrone">
|
| 11 |
+
<label>Edrone</label>
|
| 12 |
+
<tab>edrone</tab>
|
| 13 |
+
<sort_order>10</sort_order>
|
| 14 |
+
<show_in_default>1</show_in_default>
|
| 15 |
+
<show_in_website>1</show_in_website>
|
| 16 |
+
<show_in_store>1</show_in_store>
|
| 17 |
+
|
| 18 |
+
<groups translate="label" module="edrone">
|
| 19 |
+
<base>
|
| 20 |
+
<label>Edrone</label>
|
| 21 |
+
<tab>edrone</tab>
|
| 22 |
+
<sort_order>10</sort_order>
|
| 23 |
+
<show_in_default>1</show_in_default>
|
| 24 |
+
<show_in_website>1</show_in_website>
|
| 25 |
+
<show_in_store>1</show_in_store>
|
| 26 |
+
<fields>
|
| 27 |
+
<app_id>
|
| 28 |
+
<label>App id</label>
|
| 29 |
+
<frontend_type>text</frontend_type>>
|
| 30 |
+
<sort_order>10</sort_order>
|
| 31 |
+
<show_in_default>1</show_in_default>
|
| 32 |
+
<show_in_website>1</show_in_website>
|
| 33 |
+
<show_in_store>1</show_in_store>
|
| 34 |
+
</app_id>
|
| 35 |
+
<external_script_url>
|
| 36 |
+
<label>External JS script address</label>
|
| 37 |
+
<frontend_type>text</frontend_type>
|
| 38 |
+
<sort_order>20</sort_order>
|
| 39 |
+
<show_in_default>1</show_in_default>
|
| 40 |
+
<show_in_website>1</show_in_website>
|
| 41 |
+
<show_in_store>1</show_in_store>
|
| 42 |
+
</external_script_url>
|
| 43 |
+
<collector_url>
|
| 44 |
+
<label>Collector script address</label>
|
| 45 |
+
<frontend_type>text</frontend_type>
|
| 46 |
+
<sort_order>30</sort_order>
|
| 47 |
+
<show_in_default>1</show_in_default>
|
| 48 |
+
<show_in_website>1</show_in_website>
|
| 49 |
+
<show_in_store>1</show_in_store>
|
| 50 |
+
</collector_url>
|
| 51 |
+
</fields>
|
| 52 |
+
</base>
|
| 53 |
+
</groups>
|
| 54 |
+
</edrone>
|
| 55 |
+
</sections>
|
| 56 |
+
</config>
|
app/design/frontend/base/default/layout/edrone.xml
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<layout version="0.1.0">
|
| 3 |
+
<default>
|
| 4 |
+
<reference name="before_body_end">
|
| 5 |
+
<block type="edrone/base" name="edrone_base" template="edrone/default.phtml"/>
|
| 6 |
+
</reference>
|
| 7 |
+
</default>
|
| 8 |
+
|
| 9 |
+
<catalog_product_view>
|
| 10 |
+
<remove name="edrone_base"/>
|
| 11 |
+
<reference name="before_body_end">
|
| 12 |
+
<block type="edrone/product" name="edrone" template="edrone/product_view.phtml"/>
|
| 13 |
+
</reference>
|
| 14 |
+
</catalog_product_view>
|
| 15 |
+
|
| 16 |
+
<checkout_cart_index>
|
| 17 |
+
<remove name="edrone_base"/>
|
| 18 |
+
<reference name="before_body_end">
|
| 19 |
+
<block type="edrone/cart" name="edrone" template="edrone/cart_view.phtml"/>
|
| 20 |
+
</reference>
|
| 21 |
+
</checkout_cart_index>
|
| 22 |
+
|
| 23 |
+
<checkout_onepage_success>
|
| 24 |
+
<remove name="edrone_base"/>
|
| 25 |
+
<reference name="before_body_end">
|
| 26 |
+
<block type="edrone/order" name="edrone" template="edrone/success_view.phtml"/>
|
| 27 |
+
</reference>
|
| 28 |
+
</checkout_onepage_success>
|
| 29 |
+
</layout>
|
app/design/frontend/base/default/template/edrone/cart_view.phtml
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/* @var $this Edrone_Base_Block_Cart */
|
| 3 |
+
$helper = $this->getHelper();
|
| 4 |
+
$customerData = $this->getCustomerData();
|
| 5 |
+
$productData = $this->getProductData();
|
| 6 |
+
?>
|
| 7 |
+
|
| 8 |
+
<?php if(!empty($productData)): ?>
|
| 9 |
+
<script type="text/javascript">
|
| 10 |
+
(function (srcjs) {
|
| 11 |
+
window._edrone = window._edrone || {};
|
| 12 |
+
_edrone.app_id = '<?php echo $helper->getAppId() ?>';
|
| 13 |
+
_edrone.version = '2.4';
|
| 14 |
+
_edrone.trace_url = '<?php echo $helper->getCollectorUrl() ?>';
|
| 15 |
+
_edrone.email = '<?php echo $customerData['email'] ?>';
|
| 16 |
+
_edrone.first_name = '<?php echo $customerData['first_name'] ?>';
|
| 17 |
+
_edrone.last_name = '<?php echo $customerData['last_name'] ?>';
|
| 18 |
+
_edrone.product_ids = '<?php echo $productData['sku'] ?>';
|
| 19 |
+
_edrone.product_titles = '<?php echo $productData['title'] ?>';
|
| 20 |
+
_edrone.product_images = '<?php echo $productData['image'] ?>';
|
| 21 |
+
_edrone.order_id = '';
|
| 22 |
+
_edrone.order_payment_value = '';
|
| 23 |
+
_edrone.currency = '';
|
| 24 |
+
_edrone.action_type = 'add_to_cart';
|
| 25 |
+
_edrone.country = '<?php echo $customerData['country'] ?>';
|
| 26 |
+
_edrone.city = '<?php echo $customerData['city'] ?>';
|
| 27 |
+
|
| 28 |
+
var doc = document.createElement('script');
|
| 29 |
+
doc.type = 'text/javascript';
|
| 30 |
+
doc.async = true;
|
| 31 |
+
doc.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + srcjs;
|
| 32 |
+
var s = document.getElementsByTagName('script')[0];
|
| 33 |
+
s.parentNode.insertBefore(doc, s);
|
| 34 |
+
|
| 35 |
+
})("<?php echo $helper->getExternalScriptUrl() ?>");
|
| 36 |
+
</script>
|
| 37 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/edrone/default.phtml
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/* @var $this Edrone_Base_Block_Base */
|
| 3 |
+
$helper = $this->getHelper();
|
| 4 |
+
$customerData = $this->getCustomerData();
|
| 5 |
+
?>
|
| 6 |
+
|
| 7 |
+
<script type="text/javascript">
|
| 8 |
+
(function (srcjs) {
|
| 9 |
+
window._edrone = window._edrone || {};
|
| 10 |
+
_edrone.app_id = '<?php echo $helper->getAppId() ?>';
|
| 11 |
+
_edrone.version = '2.4';
|
| 12 |
+
_edrone.trace_url = '<?php echo $helper->getCollectorUrl() ?>';
|
| 13 |
+
_edrone.email = '<?php echo $customerData['email'] ?>';
|
| 14 |
+
_edrone.first_name = '<?php echo $customerData['first_name'] ?>';
|
| 15 |
+
_edrone.last_name = '<?php echo $customerData['last_name'] ?>';
|
| 16 |
+
_edrone.product_ids = '';
|
| 17 |
+
_edrone.product_titles = '';
|
| 18 |
+
_edrone.product_images = '';
|
| 19 |
+
_edrone.order_id = '';
|
| 20 |
+
_edrone.order_payment_value = '';
|
| 21 |
+
_edrone.currency = '';
|
| 22 |
+
_edrone.action_type = 'other';
|
| 23 |
+
_edrone.country = '<?php echo $customerData['country'] ?>';
|
| 24 |
+
_edrone.city = '<?php echo $customerData['city'] ?>';
|
| 25 |
+
|
| 26 |
+
var doc = document.createElement('script');
|
| 27 |
+
doc.type = 'text/javascript';
|
| 28 |
+
doc.async = true;
|
| 29 |
+
doc.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + srcjs;
|
| 30 |
+
var s = document.getElementsByTagName('script')[0];
|
| 31 |
+
s.parentNode.insertBefore(doc, s);
|
| 32 |
+
|
| 33 |
+
})("<?php echo $helper->getExternalScriptUrl() ?>");
|
| 34 |
+
</script>
|
app/design/frontend/base/default/template/edrone/product_view.phtml
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/* @var $this Edrone_Base_Block_Product */
|
| 3 |
+
$helper = $this->getHelper();
|
| 4 |
+
$customerData = $this->getCustomerData();
|
| 5 |
+
$productData = $this->getProductData();
|
| 6 |
+
?>
|
| 7 |
+
|
| 8 |
+
<script type="text/javascript">
|
| 9 |
+
(function (srcjs) {
|
| 10 |
+
window._edrone = window._edrone || {};
|
| 11 |
+
_edrone.app_id = '<?php echo $helper->getAppId() ?>';
|
| 12 |
+
_edrone.version = '2.4';
|
| 13 |
+
_edrone.trace_url = '<?php echo $helper->getCollectorUrl() ?>';
|
| 14 |
+
_edrone.email = '<?php echo $customerData['email'] ?>';
|
| 15 |
+
_edrone.first_name = '<?php echo $customerData['first_name'] ?>';
|
| 16 |
+
_edrone.last_name = '<?php echo $customerData['last_name'] ?>';
|
| 17 |
+
_edrone.product_ids = '<?php echo $productData['sku'] ?>';
|
| 18 |
+
_edrone.product_titles = '<?php echo $productData['title'] ?>';
|
| 19 |
+
_edrone.product_images = '<?php echo $productData['image'] ?>';
|
| 20 |
+
_edrone.order_id = '';
|
| 21 |
+
_edrone.order_payment_value = '';
|
| 22 |
+
_edrone.currency = '';
|
| 23 |
+
_edrone.action_type = 'product_view';
|
| 24 |
+
_edrone.country = '<?php echo $customerData['country'] ?>';
|
| 25 |
+
_edrone.city = '<?php echo $customerData['city'] ?>';
|
| 26 |
+
|
| 27 |
+
var doc = document.createElement('script');
|
| 28 |
+
doc.type = 'text/javascript';
|
| 29 |
+
doc.async = true;
|
| 30 |
+
doc.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + srcjs;
|
| 31 |
+
var s = document.getElementsByTagName('script')[0];
|
| 32 |
+
s.parentNode.insertBefore(doc, s);
|
| 33 |
+
|
| 34 |
+
})("<?php echo $helper->getExternalScriptUrl() ?>");
|
| 35 |
+
</script>
|
app/design/frontend/base/default/template/edrone/success_view.phtml
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/* @var $this Edrone_Base_Block_Order */
|
| 3 |
+
$helper = $this->getHelper();
|
| 4 |
+
$customerData = $this->getCustomerData();
|
| 5 |
+
$orderData = $this->getOrderData();
|
| 6 |
+
?>
|
| 7 |
+
|
| 8 |
+
<?php if(!empty($orderData)): ?>
|
| 9 |
+
<script type="text/javascript">
|
| 10 |
+
(function (srcjs) {
|
| 11 |
+
window._edrone = window._edrone || {};
|
| 12 |
+
_edrone.app_id = '<?php echo $helper->getAppId() ?>';
|
| 13 |
+
_edrone.version = '2.4';
|
| 14 |
+
_edrone.trace_url = '<?php echo $helper->getCollectorUrl() ?>';
|
| 15 |
+
_edrone.email = '<?php echo $customerData['email'] ?>';
|
| 16 |
+
_edrone.first_name = '<?php echo $customerData['first_name'] ?>';
|
| 17 |
+
_edrone.last_name = '<?php echo $customerData['last_name'] ?>';
|
| 18 |
+
_edrone.product_ids = '<?php echo $orderData['sku'] ?>';
|
| 19 |
+
_edrone.product_titles = '<?php echo $orderData['title'] ?>';
|
| 20 |
+
_edrone.product_images = '<?php echo $orderData['image'] ?>';
|
| 21 |
+
_edrone.order_id = '<?php echo $orderData['order_id'] ?>';
|
| 22 |
+
_edrone.order_payment_value = '<?php echo $orderData['order_payment_value'] ?>';
|
| 23 |
+
_edrone.currency = '<?php echo $orderData['currency'] ?>';
|
| 24 |
+
_edrone.action_type = 'order';
|
| 25 |
+
_edrone.country = '<?php echo $customerData['country'] ?>';
|
| 26 |
+
_edrone.city = '<?php echo $customerData['city'] ?>';
|
| 27 |
+
|
| 28 |
+
var doc = document.createElement('script');
|
| 29 |
+
doc.type = 'text/javascript';
|
| 30 |
+
doc.async = true;
|
| 31 |
+
doc.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + srcjs;
|
| 32 |
+
var s = document.getElementsByTagName('script')[0];
|
| 33 |
+
s.parentNode.insertBefore(doc, s);
|
| 34 |
+
|
| 35 |
+
})("<?php echo $helper->getExternalScriptUrl() ?>");
|
| 36 |
+
</script>
|
| 37 |
+
<?php endif; ?>
|
app/etc/modules/Edrone_Base.xml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Edrone_Base>
|
| 5 |
+
<active>true</active>
|
| 6 |
+
<codePool>local</codePool>
|
| 7 |
+
</Edrone_Base>
|
| 8 |
+
</modules>
|
| 9 |
+
</config>
|
app/locale/pl_PL/Edrone.csv
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
| 1 |
+
"External JS script address","Adres zewnętrznego skryptu JS"
|
| 2 |
+
"Collector script address","Adres skryptu kolektora"
|
package.xml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<package>
|
| 3 |
+
<name>edroneCRM</name>
|
| 4 |
+
<version>1.0.0</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.
|
| 11 |
+
License: GPL</description>
|
| 12 |
+
<notes>edrone magento module - initial public release</notes>
|
| 13 |
+
<authors><author><name>Michał Blak</name><user>MAG002993376</user><email>michalblak@gmail.com</email></author></authors>
|
| 14 |
+
<date>2015-05-27</date>
|
| 15 |
+
<time>07:24:25</time>
|
| 16 |
+
<contents><target name="magelocal"><dir name="Edrone"><dir name="Base"><dir name="Block"><file name="Base.php" hash="3973d98222018fe0bf3bdbf3a874b16a"/><file name="Cart.php" hash="ed49bc87f960039570aa016c7c0fae6a"/><file name="Order.php" hash="b2a4e9caa2180ba37cb5cc75b9419d8e"/><file name="Product.php" hash="174503941cc8dbabddf875a4001bc6fd"/></dir><dir name="Helper"><file name="Config.php" hash="5b0ffff08d4f2c8a3dfd08837732d776"/><file name="Data.php" hash="bd4dcfb429a76044eb2dab3958b89b15"/></dir><dir name="Model"><file name="Observer.php" hash="f35c3bf591865d6db22e2477580df76c"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0e715e76c00295dc4e555411455fedfb"/><file name="config.xml" hash="57c22e147944614c9365b2f93771a851"/><file name="system.xml" hash="6ea9bd6557a047e88bdf2f9de7da5de5"/></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="e1649ff612464ab28bce8fb7bfd7b77a"/><file name="default.phtml" hash="1575862a52ea6a868cefe3a70e4be06c"/><file name="product_view.phtml" hash="37f24589924909223973682f85ccf351"/><file name="success_view.phtml" hash="1a70c7b2270c2011ee4f588015964cef"/></dir></dir><dir name="layout"><file name="edrone.xml" hash="b08f6069d1a9a10c6e32a9757f9bc4cf"/></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Edrone_Base.xml" hash="4c5f7b0e7d7ab7ba79395f08d76f2f74"/></dir></dir></target><target name="magelocale"><dir name="pl_PL"><file name="Edrone.csv" hash="b8aa59d39815f4d92738129cc9fbdf34"/></dir></target></contents>
|
| 17 |
+
<compatible/>
|
| 18 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
| 19 |
+
</package>
|
