Version Notes
Bugfix: Purchase dates of orders
Bugfix: Failing on multiple address fields
Bugfix: Don't activate subscribers on sync
Bugfix: Don't activate subscribers on order sync
Download this release
Release Info
Developer | Conlabz GmbH |
Extension | Conlabz_CrConnect |
Version | 3.3.7 |
Comparing to | |
See all releases |
Code changes from version 3.3.2 to 3.3.7
- app/code/community/Conlabz/CrConnect/Helper/Data.php +1 -1
- app/code/community/Conlabz/CrConnect/Model/Api.php +4 -2
- app/code/community/Conlabz/CrConnect/Model/Observer.php +18 -7
- app/code/community/Conlabz/CrConnect/etc/config.xml +3 -3
- app/design/frontend/base/default/template/crconnect/checkout/onepage/form/newsletter.phtml +8 -1
- package.xml +8 -5
app/code/community/Conlabz/CrConnect/Helper/Data.php
CHANGED
@@ -362,7 +362,7 @@ class Conlabz_CrConnect_Helper_Data extends Mage_Core_Helper_Abstract
|
|
362 |
$crOrder["product_id"] = $item->getProductId();
|
363 |
$crOrder["price"] = round($item->getPrice(), 2);
|
364 |
$crOrder["quantity"] = (integer)$item->getQtyOrdered();
|
365 |
-
$crOrder["purchase_date"] =
|
366 |
$crOrder["currency"] = $order->getData('order_currency_code');
|
367 |
$crOrder["source"] = "MAGENTO Order";
|
368 |
|
362 |
$crOrder["product_id"] = $item->getProductId();
|
363 |
$crOrder["price"] = round($item->getPrice(), 2);
|
364 |
$crOrder["quantity"] = (integer)$item->getQtyOrdered();
|
365 |
+
$crOrder["purchase_date"] = strtotime($item->getCreatedAt());
|
366 |
$crOrder["currency"] = $order->getData('order_currency_code');
|
367 |
$crOrder["source"] = "MAGENTO Order";
|
368 |
|
app/code/community/Conlabz/CrConnect/Model/Api.php
CHANGED
@@ -323,8 +323,10 @@ class Conlabz_CrConnect_Model_Api extends Mage_Core_Model_Abstract
|
|
323 |
$listId = $this->_helper->getDefaultListId();
|
324 |
|
325 |
$result = $this->_client->receiverUpdate($this->_apiKey, $listId, array(
|
326 |
-
"email"
|
327 |
-
|
|
|
|
|
328 |
));
|
329 |
|
330 |
$this->_helper->log("CALL receiverAddOrder: ".$email);
|
323 |
$listId = $this->_helper->getDefaultListId();
|
324 |
|
325 |
$result = $this->_client->receiverUpdate($this->_apiKey, $listId, array(
|
326 |
+
"email" => $email,
|
327 |
+
'deactivated' => (int)( !(boolean) $this->isSubscribed($email)),
|
328 |
+
'source' => 'MAGENTO',
|
329 |
+
"orders" => $orderInfo
|
330 |
));
|
331 |
|
332 |
$this->_helper->log("CALL receiverAddOrder: ".$email);
|
app/code/community/Conlabz/CrConnect/Model/Observer.php
CHANGED
@@ -91,7 +91,7 @@ class Conlabz_CrConnect_Model_Observer
|
|
91 |
$order = Mage::getModel('sales/order')->load($lastOrderId);
|
92 |
$email = $order->getCustomerEmail();
|
93 |
|
94 |
-
if (Mage::helper("crconnect")->isTrackingEnabled()) {
|
95 |
$items = $order->getAllItems();
|
96 |
if ($items) {
|
97 |
$tmpItems = array();
|
@@ -102,7 +102,7 @@ class Conlabz_CrConnect_Model_Observer
|
|
102 |
$tmpItem["product_id"] = $item->getProductId();
|
103 |
$tmpItem["price"] = round($item->getPrice(), 2);
|
104 |
$tmpItem["quantity"] = (integer)$item->getQtyOrdered();
|
105 |
-
$tmpItem["purchase_date"] =
|
106 |
$tmpItem["currency"] = $order->getData('order_currency_code');
|
107 |
$tmpItem["source"] = "MAGENTO Order";
|
108 |
|
@@ -130,6 +130,8 @@ class Conlabz_CrConnect_Model_Observer
|
|
130 |
{
|
131 |
try {
|
132 |
$order = $observer->getOrder();
|
|
|
|
|
133 |
if (Mage::helper("crconnect")->isM2eExclude()) {
|
134 |
$shippingMethod = $order->getShippingMethod();
|
135 |
Mage::helper("crconnect")->log("M2E sync disabled -> shipping method: " . $shippingMethod);
|
@@ -139,10 +141,15 @@ class Conlabz_CrConnect_Model_Observer
|
|
139 |
}
|
140 |
}
|
141 |
|
142 |
-
$
|
|
|
|
|
143 |
$email = $order->getCustomerEmail();
|
|
|
|
|
|
|
144 |
|
145 |
-
if (Mage::helper("crconnect")->isForceSyncEnabled()) {
|
146 |
Mage::helper("crconnect")->log("Force sync orders enabled");
|
147 |
|
148 |
if ($customer->getEmail()) {
|
@@ -158,10 +165,11 @@ class Conlabz_CrConnect_Model_Observer
|
|
158 |
$crReceiver = array (
|
159 |
'email' => $email,
|
160 |
'source' => 'MAGENTO',
|
|
|
161 |
'attributes' => array(
|
162 |
array("key" => "firstname", "value" => $billingAddress->getFirstname()),
|
163 |
array("key" => "lastname", "value" => $billingAddress->getLastname()),
|
164 |
-
array("key" => "street", "value" => $billingAddress->
|
165 |
array("key" => "zip", "value" => $billingAddress->getPostcode()),
|
166 |
array("key" => "city", "value" => $billingAddress->getCity()),
|
167 |
array("key" => "country", "value" => $billingAddress->getCountryId()),
|
@@ -170,6 +178,9 @@ class Conlabz_CrConnect_Model_Observer
|
|
170 |
array("key" => "company", "value" => $billingAddress->getCompany())
|
171 |
)
|
172 |
);
|
|
|
|
|
|
|
173 |
|
174 |
$cookie = Mage::getSingleton('core/cookie');
|
175 |
if ($cookie->get('crmailing')) {
|
@@ -177,9 +188,9 @@ class Conlabz_CrConnect_Model_Observer
|
|
177 |
}
|
178 |
Mage::helper("crconnect")->log($crReceiver);
|
179 |
|
180 |
-
$result = Mage::getModel("crconnect/api")->
|
181 |
if ($result->status !== 'SUCCESS') {
|
182 |
-
$result = Mage::getModel("crconnect/api")->
|
183 |
}
|
184 |
Mage::helper("crconnect")->log($result);
|
185 |
}
|
91 |
$order = Mage::getModel('sales/order')->load($lastOrderId);
|
92 |
$email = $order->getCustomerEmail();
|
93 |
|
94 |
+
if (Mage::helper("crconnect")->isTrackingEnabled() && (Mage::helper("crconnect")->isForceSyncEnabled() || Mage::getModel('crconnect/api')->isSubscribed($email))) {
|
95 |
$items = $order->getAllItems();
|
96 |
if ($items) {
|
97 |
$tmpItems = array();
|
102 |
$tmpItem["product_id"] = $item->getProductId();
|
103 |
$tmpItem["price"] = round($item->getPrice(), 2);
|
104 |
$tmpItem["quantity"] = (integer)$item->getQtyOrdered();
|
105 |
+
$tmpItem["purchase_date"] = strtotime($item->getCreatedAt());
|
106 |
$tmpItem["currency"] = $order->getData('order_currency_code');
|
107 |
$tmpItem["source"] = "MAGENTO Order";
|
108 |
|
130 |
{
|
131 |
try {
|
132 |
$order = $observer->getOrder();
|
133 |
+
$request = Mage::app()->getRequest();
|
134 |
+
|
135 |
if (Mage::helper("crconnect")->isM2eExclude()) {
|
136 |
$shippingMethod = $order->getShippingMethod();
|
137 |
Mage::helper("crconnect")->log("M2E sync disabled -> shipping method: " . $shippingMethod);
|
141 |
}
|
142 |
}
|
143 |
|
144 |
+
$subscribe = (boolean) $request->getParam('is_subscribed', false);
|
145 |
+
|
146 |
+
//$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
|
147 |
$email = $order->getCustomerEmail();
|
148 |
+
$customer = Mage::getModel('customer/customer')
|
149 |
+
->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
|
150 |
+
->loadByEmail($email);
|
151 |
|
152 |
+
if (Mage::helper("crconnect")->isForceSyncEnabled() && (Mage::getModel('crconnect/api')->isSubscribed($email) || $subscribe)) {
|
153 |
Mage::helper("crconnect")->log("Force sync orders enabled");
|
154 |
|
155 |
if ($customer->getEmail()) {
|
165 |
$crReceiver = array (
|
166 |
'email' => $email,
|
167 |
'source' => 'MAGENTO',
|
168 |
+
'deactivated' => 1,
|
169 |
'attributes' => array(
|
170 |
array("key" => "firstname", "value" => $billingAddress->getFirstname()),
|
171 |
array("key" => "lastname", "value" => $billingAddress->getLastname()),
|
172 |
+
array("key" => "street", "value" => $billingAddress->getStreetFull()),
|
173 |
array("key" => "zip", "value" => $billingAddress->getPostcode()),
|
174 |
array("key" => "city", "value" => $billingAddress->getCity()),
|
175 |
array("key" => "country", "value" => $billingAddress->getCountryId()),
|
178 |
array("key" => "company", "value" => $billingAddress->getCompany())
|
179 |
)
|
180 |
);
|
181 |
+
if ($subscribe) {
|
182 |
+
$crReceiver['deactivated'] = 0;
|
183 |
+
}
|
184 |
|
185 |
$cookie = Mage::getSingleton('core/cookie');
|
186 |
if ($cookie->get('crmailing')) {
|
188 |
}
|
189 |
Mage::helper("crconnect")->log($crReceiver);
|
190 |
|
191 |
+
$result = Mage::getModel("crconnect/api")->receiverUpdate($crReceiver, $customer->getGroupId());
|
192 |
if ($result->status !== 'SUCCESS') {
|
193 |
+
$result = Mage::getModel("crconnect/api")->receiverAdd($crReceiver, $customer->getGroupId());
|
194 |
}
|
195 |
Mage::helper("crconnect")->log($result);
|
196 |
}
|
app/code/community/Conlabz/CrConnect/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Conlabz_CrConnect>
|
5 |
-
<version>3.3.
|
6 |
</Conlabz_CrConnect>
|
7 |
</modules>
|
8 |
<global>
|
@@ -67,11 +67,11 @@
|
|
67 |
<class>crconnect/observer</class>
|
68 |
<method>orderPlacedAfter</method>
|
69 |
</crconnect_sales_order_place_after>
|
70 |
-
|
71 |
<type>singleton</type>
|
72 |
<class>crconnect/observer</class>
|
73 |
<method>checkoutSubscription</method>
|
74 |
-
</crconnect_checkout_subscription
|
75 |
</observers>
|
76 |
</sales_order_place_after>
|
77 |
<customer_delete_before>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Conlabz_CrConnect>
|
5 |
+
<version>3.3.7</version>
|
6 |
</Conlabz_CrConnect>
|
7 |
</modules>
|
8 |
<global>
|
67 |
<class>crconnect/observer</class>
|
68 |
<method>orderPlacedAfter</method>
|
69 |
</crconnect_sales_order_place_after>
|
70 |
+
<!-- crconnect_checkout_subscription>
|
71 |
<type>singleton</type>
|
72 |
<class>crconnect/observer</class>
|
73 |
<method>checkoutSubscription</method>
|
74 |
+
</crconnect_checkout_subscription -->
|
75 |
</observers>
|
76 |
</sales_order_place_after>
|
77 |
<customer_delete_before>
|
app/design/frontend/base/default/template/crconnect/checkout/onepage/form/newsletter.phtml
CHANGED
@@ -24,6 +24,13 @@
|
|
24 |
//<![CDATA[
|
25 |
//newsletterForm = new VarienForm('form-validate', false);
|
26 |
//move fieldset into form to get data send via review.save() later on
|
27 |
-
$('checkout-agreements')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
//]]>
|
29 |
</script>
|
24 |
//<![CDATA[
|
25 |
//newsletterForm = new VarienForm('form-validate', false);
|
26 |
//move fieldset into form to get data send via review.save() later on
|
27 |
+
var form = $('checkout-agreements');
|
28 |
+
|
29 |
+
if (!form) {
|
30 |
+
form = new Element('form', {action: '', id: 'checkout-agreements', onsubmit: 'return false;'});
|
31 |
+
$('checkout-step-review').insert({top: form});
|
32 |
+
}
|
33 |
+
|
34 |
+
form.insert({top: $('crconnect-checkout-subscription')});
|
35 |
//]]>
|
36 |
</script>
|
package.xml
CHANGED
@@ -1,18 +1,21 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Conlabz_CrConnect</name>
|
4 |
-
<version>3.3.
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU General Public License</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Synchronizes your Magento subscribers, customers and sales with CleverReach Email Marketing Software.</summary>
|
10 |
<description>With CleverReach (http://www.cleverreach.de) you can create professional emails online, dispatch them reliably, track their success and manage receivers. CleverReach is equipped with a particularly user-friendly interface, which you can use intuitively and without special knowledge.</description>
|
11 |
-
<notes>Bugfix:
|
|
|
|
|
|
|
12 |
<authors><author><name>conlabz GmbH</name><user>conlabz</user><email>info@conlabz.de</email></author></authors>
|
13 |
-
<date>2017-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Conlabz"><dir name="CrConnect"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Newsletter.php" hash="ff47d3028a8e766077ee78affd52eea6"/></dir></dir></dir><dir name="Newsletter"><file name="Subscriber.php" hash="e1b516bc593a41bcc6d00b259776c8b8"/></dir></dir><dir name="Config"><file name="GroupsApis.php" hash="9f1fae68c4224144a42d400b14d4d7d6"/><file name="Key.php" hash="e8467e4fe47aa6965ac7284978a08dbd"/><file name="Url.php" hash="19519ce690aedccea366d011384864d4"/></dir><dir name="Customer"><file name="Newsletter.php" hash="83959c0d83308c983989ccc132908919"/></dir><file name="Groupsapis.php" hash="f20a158b439469cdd498b16cc459ab4a"/></dir><dir name="Helper"><file name="Data.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Conlabz_CrConnect</name>
|
4 |
+
<version>3.3.7</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU General Public License</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Synchronizes your Magento subscribers, customers and sales with CleverReach Email Marketing Software.</summary>
|
10 |
<description>With CleverReach (http://www.cleverreach.de) you can create professional emails online, dispatch them reliably, track their success and manage receivers. CleverReach is equipped with a particularly user-friendly interface, which you can use intuitively and without special knowledge.</description>
|
11 |
+
<notes>Bugfix: Purchase dates of orders
|
12 |
+
Bugfix: Failing on multiple address fields
|
13 |
+
Bugfix: Don't activate subscribers on sync
|
14 |
+
Bugfix: Don't activate subscribers on order sync</notes>
|
15 |
<authors><author><name>conlabz GmbH</name><user>conlabz</user><email>info@conlabz.de</email></author></authors>
|
16 |
+
<date>2017-06-22</date>
|
17 |
+
<time>12:22:09</time>
|
18 |
+
<contents><target name="magecommunity"><dir name="Conlabz"><dir name="CrConnect"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Newsletter.php" hash="ff47d3028a8e766077ee78affd52eea6"/></dir></dir></dir><dir name="Newsletter"><file name="Subscriber.php" hash="e1b516bc593a41bcc6d00b259776c8b8"/></dir></dir><dir name="Config"><file name="GroupsApis.php" hash="9f1fae68c4224144a42d400b14d4d7d6"/><file name="Key.php" hash="e8467e4fe47aa6965ac7284978a08dbd"/><file name="Url.php" hash="19519ce690aedccea366d011384864d4"/></dir><dir name="Customer"><file name="Newsletter.php" hash="83959c0d83308c983989ccc132908919"/></dir><file name="Groupsapis.php" hash="f20a158b439469cdd498b16cc459ab4a"/></dir><dir name="Helper"><file name="Data.php" hash="a5c429d962be6880753731777940971b"/></dir><dir name="Model"><file name="Api.php" hash="c04ef227539ac5371ae29e5c64a51dc8"/><dir name="Checkout"><file name="Observer.php" hash="8fd916c7332ce6ebfa9197666c2987a9"/></dir><dir name="Customer"><file name="Observer.php" hash="878370bd5958b3813f0b90f395b27ecf"/></dir><dir name="Newsletter"><file name="Subscriber.php" hash="96e4b452bf916d5afa209cb80192eba0"/></dir><file name="Observer.php" hash="9485ca69cc5a5abda9ba8b36ecac6b5a"/><file name="Search.php" hash="5419d8b49f901e2d28eff3d57ae9de4f"/><file name="Subscriber.php" hash="83c10411c80bba5f8303d9f555dc2872"/><dir name="System"><dir name="Config"><dir name="Source"><file name="EmptyForms.php" hash="910b9588b11edf73be1fc0103e49b997"/><file name="EmptyList.php" hash="6fe676d12ff5fa9231c3b0869b1ec750"/></dir></dir></dir><dir name="Website"><file name="Observer.php" hash="6c068fc61ae6ed512cbdce2a28f48cb7"/></dir></dir><dir name="Test"><dir name="Config"><file name="ActivationXml.php" hash="0270720ffc36ea493b9c976377bdfdcd"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CrconfigController.php" hash="fdb46a1200e564d69426aba8a518e487"/><file name="CrconnectController.php" hash="fa3cb1d4f515cabd0e378715258db203"/></dir><file name="HookController.php" hash="2c81dd3ebd9310ca86afc732b2e2d1c6"/><file name="ManageController.php" hash="938402949b4d60160dc56bb32cce861e"/><file name="SearchController.php" hash="0141ec8a414c86619ff63c6a856af470"/><file name="SubscriberController.php" hash="3bbf81a698e630d4a04f638a53ecd3e9"/><file name="UnsubscribeController.php" hash="eaba3ee3bef995d4bb6f7e17b1709585"/></dir><dir name="etc"><file name="adminhtml.xml" hash="05f8a5b43c8abe877f05e09eec5d8c65"/><file name="config.xml" hash="4730e79b94107547020b665e712a2fda"/><file name="jstranslator.xml" hash="040e5e790dcae18ddf223d54e38e45b0"/><file name="system.xml" hash="3fd385d87c0235d6cb9720f248ed4700"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Conlabz_CrConnect.xml" hash="dd6482e7f0daedb3387e80bdff66f321"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="crconnect.xml" hash="9f27e2dd497b7c57a6f334749779d614"/></dir><dir name="template"><dir name="crconnect"><dir name="checkout"><dir name="onepage"><dir name="form"><file name="newsletter.phtml" hash="3f9f431ea58418e2b79df49787ef5334"/></dir></dir></dir><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="a533451e27b90284d3414e391b460231"/></dir></dir><dir name="form"><file name="newsletter.phtml" hash="4a1309d0d6d2587c8534dd4a1ccdf235"/></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="crconnect.xml" hash="fac2e1194c8c007a54abfe3e82fd6834"/></dir><dir name="template"><dir name="crconnect"><file name="config.phtml" hash="9f2232c8311fa439434d8023181a7ab5"/><dir name="newsletter"><dir name="subscriber"><file name="list.phtml" hash="2d7dd105e2c543d19746ada03fa54ff8"/></dir></dir><dir name="system"><dir name="config"><dir name="form"><dir name="field"><file name="array_groups.phtml" hash="ac84db9b1e8b342337a478ecba62e0b1"/><file name="cr_array_groups.phtml" hash="c924ef81c5699817327580eb7b8a2e86"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="Conlabz_CleverReach.csv" hash="4cb844c7288d9995d21d39eb4015fa44"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="cleverreach"><file name="cleverreach-logo.png" hash="bff60f831ca9e1dc9bcbdb2e3f5a5805"/></dir></dir><dir name="js"><file name="crconnect.js" hash="481f77d2331b82c7c6043e72043f5c26"/></dir></dir></dir></dir></target></contents>
|
19 |
<compatible/>
|
20 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
21 |
</package>
|