cartdefender_actions - Version 2.1.0

Version Notes

Product recommendation included. Plugin sends more data about products to Cart Defender.

Download this release

Release Info

Developer Radoslaw Gliniecki
Extension cartdefender_actions
Version 2.1.0
Comparing to
See all releases


Code changes from version 2.0.2 to 2.1.0

app/code/community/CartDefender/Actions/Block/Script.php CHANGED
@@ -84,11 +84,10 @@ class CartDefender_Actions_Block_Script extends Mage_Core_Block_Template
84
  ->ensureCorrelationIdSet();
85
 
86
  $cdsvarData = array(
 
87
  'api' => Mage::helper('actions')->getApi(),
88
  'website_url' =>
89
  Mage::getStoreConfig('web/unsecure/base_url', 0),
90
- 'app_software_name' => 'Magento ' . Mage::getEdition(),
91
- 'app_software_version' => Mage::getVersion(),
92
  'website_id' => $website->getId(),
93
  'website_code' => $website->getCode(),
94
  'website_name' => $website->getName(),
@@ -110,6 +109,7 @@ class CartDefender_Actions_Block_Script extends Mage_Core_Block_Template
110
  Mage::helper('checkout/url')->getCheckoutUrl(),
111
  'multishipping_checkout_link' =>
112
  Mage::helper('checkout/url')->getMSCheckoutUrl(),
 
113
  'request_route_name' =>
114
  Mage::app()->getRequest()->getRouteName(),
115
  'page_identifier' =>
84
  ->ensureCorrelationIdSet();
85
 
86
  $cdsvarData = array(
87
+ 'cd_host' => $this->getHost(),
88
  'api' => Mage::helper('actions')->getApi(),
89
  'website_url' =>
90
  Mage::getStoreConfig('web/unsecure/base_url', 0),
 
 
91
  'website_id' => $website->getId(),
92
  'website_code' => $website->getCode(),
93
  'website_name' => $website->getName(),
109
  Mage::helper('checkout/url')->getCheckoutUrl(),
110
  'multishipping_checkout_link' =>
111
  Mage::helper('checkout/url')->getMSCheckoutUrl(),
112
+ 'cart_link' => Mage::helper('checkout/cart')->getCartUrl(),
113
  'request_route_name' =>
114
  Mage::app()->getRequest()->getRouteName(),
115
  'page_identifier' =>
app/code/community/CartDefender/Actions/Model/AsyncLocalSender.php CHANGED
@@ -64,7 +64,7 @@ class CartDefender_Actions_Model_AsyncLocalSender extends Varien_Object
64
  $remoteSenderConf['port'],
65
  $errno,
66
  $errstr,
67
- 0.5 /*timeout*/
68
  );
69
  $success = fwrite($socket, $request);
70
  Mage::getSingleton('core/session')->setLastEventTime(time());
64
  $remoteSenderConf['port'],
65
  $errno,
66
  $errstr,
67
+ 0.2 /*timeout*/
68
  );
69
  $success = fwrite($socket, $request);
70
  Mage::getSingleton('core/session')->setLastEventTime(time());
app/code/community/CartDefender/Actions/Model/EventBuilder.php CHANGED
@@ -55,6 +55,7 @@ class CartDefender_Actions_Model_EventBuilder
55
  'checkoutLink' => Mage::helper('checkout/url')->getCheckoutUrl(),
56
  'multishippingCheckoutLink' =>
57
  Mage::helper('checkout/url')->getMSCheckoutUrl(),
 
58
  'visitorId' => isset($visitorData['visitor_id'])
59
  ? $visitorData['visitor_id'] : CDData::MISSING_VALUE,
60
  'visitorData' => $visitorData,
@@ -130,9 +131,17 @@ class CartDefender_Actions_Model_EventBuilder
130
  $cartData = array();
131
  if (isset($quote)) {
132
  $cartData = $this->removePersonalData($quote->getData());
 
133
  $items = $quote->getAllVisibleItems();
134
  foreach ($items as $item) {
135
  $itemData = $item->getData();
 
 
 
 
 
 
 
136
  $cartItems[] = $itemData;
137
  }
138
  } else {
55
  'checkoutLink' => Mage::helper('checkout/url')->getCheckoutUrl(),
56
  'multishippingCheckoutLink' =>
57
  Mage::helper('checkout/url')->getMSCheckoutUrl(),
58
+ 'cartLink' => Mage::helper('checkout/cart')->getCartUrl(),
59
  'visitorId' => isset($visitorData['visitor_id'])
60
  ? $visitorData['visitor_id'] : CDData::MISSING_VALUE,
61
  'visitorData' => $visitorData,
131
  $cartData = array();
132
  if (isset($quote)) {
133
  $cartData = $this->removePersonalData($quote->getData());
134
+ $productMediaConfig = Mage::getModel('catalog/product_media_config');
135
  $items = $quote->getAllVisibleItems();
136
  foreach ($items as $item) {
137
  $itemData = $item->getData();
138
+ $productFromData = $itemData['product'];
139
+ $productUrl = Mage::getUrl($productFromData->getUrlPath(), array('_secure' => true, '_type' => 'direct_link'));
140
+ $itemData['product_url'] = $productUrl;
141
+ $itemData['base_image_url'] = $productMediaConfig->getMediaUrl($productFromData->getImage());
142
+ $itemData['small_image_url'] = $productMediaConfig->getMediaUrl($productFromData->getSmallImage());
143
+ $itemData['thumbnail_url'] = $productMediaConfig->getMediaUrl($productFromData->getThumbnail());
144
+ $itemData['product_data'] = $productFromData->getData();
145
  $cartItems[] = $itemData;
146
  }
147
  } else {
app/code/community/CartDefender/Actions/controllers/CartDefenderSenderController.php CHANGED
@@ -85,9 +85,11 @@ class CartDefender_Actions_CartDefenderSenderController
85
  'CartDefenderSenderController->sendAction',
86
  'Error - request not allowed.'
87
  );
 
88
  }
89
  $this->logger->log('CartDefenderSenderController->sendAction', 'Done');
90
  echo 'Done';
 
91
  }
92
 
93
  /**
85
  'CartDefenderSenderController->sendAction',
86
  'Error - request not allowed.'
87
  );
88
+ exit;
89
  }
90
  $this->logger->log('CartDefenderSenderController->sendAction', 'Done');
91
  echo 'Done';
92
+ exit;
93
  }
94
 
95
  /**
app/code/community/CartDefender/Actions/etc/system.xml CHANGED
@@ -12,7 +12,7 @@
12
  <config>
13
  <sections>
14
  <actions translate="label" module="actions">
15
- <label>Cart Defender Popups</label>
16
  <tab>sales</tab>
17
  <frontend_type>text</frontend_type>
18
  <sort_order>1</sort_order>
@@ -27,12 +27,12 @@
27
  <show_in_default>1</show_in_default>
28
  <show_in_website>1</show_in_website>
29
  <show_in_store>1</show_in_store>
30
- <comment><![CDATA[ <p>You can configure the Cart Defender's Magento Extension settings
31
  in this section. </p>
32
- <p>To register for Cart Defender's service and enable the Bot on your website
33
  <a href="https://portal.cartdefender.com/#!register"
34
  target="_blank">go to the registration page</a>.</p>
35
- <p> To configure your Bot's messages <a href="https://portal.cartdefender.com"
36
  target="_blank">go to the Cart Defender Portal</a>.</p>
37
  ]]>
38
  </comment>
@@ -73,7 +73,7 @@
73
  </test>
74
  <!-- Don't use a trailing slash in test server URL.-->
75
  <test_server_url_start>
76
- <label>Test server URL protocol, domain, and path prefix (if any)</label>
77
  <frontend_type>text</frontend_type>
78
  <sort_order>5</sort_order>
79
  <show_in_default>1</show_in_default>
@@ -86,7 +86,7 @@
86
  like "/plugin/<correlation id>/v1-beta/bizEvent". This is useful for
87
  inspecting biz event JSONs with something like RequestBin. -->
88
  <use_raw_test_url_for_biz_api>
89
- <label>Use unadorned test server URL for JSON API</label>
90
  <frontend_type>select</frontend_type>
91
  <source_model>adminhtml/system_config_source_yesno</source_model>
92
  <sort_order>6</sort_order>
12
  <config>
13
  <sections>
14
  <actions translate="label" module="actions">
15
+ <label>Cart Defender Persuasion Tools</label>
16
  <tab>sales</tab>
17
  <frontend_type>text</frontend_type>
18
  <sort_order>1</sort_order>
27
  <show_in_default>1</show_in_default>
28
  <show_in_website>1</show_in_website>
29
  <show_in_store>1</show_in_store>
30
+ <comment><![CDATA[ <p>You can configure the Cart Defender's Persuasion Tools settings
31
  in this section. </p>
32
+ <p>To register for Cart Defender's service and enable the AI on your website
33
  <a href="https://portal.cartdefender.com/#!register"
34
  target="_blank">go to the registration page</a>.</p>
35
+ <p> To configure your messages and product recommendations <a href="https://portal.cartdefender.com"
36
  target="_blank">go to the Cart Defender Portal</a>.</p>
37
  ]]>
38
  </comment>
73
  </test>
74
  <!-- Don't use a trailing slash in test server URL.-->
75
  <test_server_url_start>
76
+ <label>Send data to this URL: protocol, domain, and path prefix if any (e.g. http://localhost)</label>
77
  <frontend_type>text</frontend_type>
78
  <sort_order>5</sort_order>
79
  <show_in_default>1</show_in_default>
86
  like "/plugin/<correlation id>/v1-beta/bizEvent". This is useful for
87
  inspecting biz event JSONs with something like RequestBin. -->
88
  <use_raw_test_url_for_biz_api>
89
+ <label>Use unadorned target server URL for JSON API</label>
90
  <frontend_type>select</frontend_type>
91
  <source_model>adminhtml/system_config_source_yesno</source_model>
92
  <sort_order>6</sort_order>
package.xml CHANGED
@@ -1,18 +1,19 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>cartdefender_actions</name>
4
- <version>2.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Increase sales with smart targeted popups and offers delivered to your visitors in real time.</summary>
10
- <description>You can instantly use messages and offers which convert your visitors into customers. You focus on your business needs without A/B tests, as Cart Defender learns which popups convert the best and adjusts itself automatically.</description>
11
- <notes>Performance &amp; event sending improvements.</notes>
 
12
  <authors><author><name>Radoslaw Gliniecki</name><user>Cart_Defender</user><email>radek@cartdefender.com</email></author><author><name>Jan Zankowski</name><user>janzankowski</user><email>jan@cartdefender.com</email></author><author><name>Przemyslaw Gliniecki</name><user>psgliniecki</user><email>psg@cartdefender.com</email></author></authors>
13
- <date>2016-12-13</date>
14
- <time>23:41:26</time>
15
- <contents><target name="magecommunity"><dir name="CartDefender"><dir name="Actions"><dir name="Block"><file name="Script.php" hash="3b1ca143e8b9209ce3e9df6dce1621ac"/></dir><dir name="Helper"><file name="Data.php" hash="dd4057deaaa8b0bdcfcc3e6f7c31091c"/><file name="Logger.php" hash="f21b3aed521b3761a890b22ba0f247a9"/></dir><dir name="Model"><file name="AsyncLocalSender.php" hash="e5bcd13994390e038b3cfeb26a404014"/><file name="CorrelationIdManager.php" hash="7215fd45ca052d5bde16e93d278565be"/><file name="EventAsyncLocalSender.php" hash="cd9a25e21225cb1966da47fbbc8f9854"/><file name="EventBuilder.php" hash="d814e3b3c947e5a4815b43ba268a9b87"/><file name="Observer.php" hash="f34856aad9bf7aeb870317f6548eb349"/></dir><dir name="controllers"><file name="CartDefenderSenderController.php" hash="3d1ab36a1081a17e493d3c6af898f3c4"/></dir><dir name="etc"><file name="config.xml" hash="b9d1b6f7bb362aa490d2f13f38695867"/><file name="system.xml" hash="3a0ef9f8ca4414d7714e717a64816a33"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="CartDefender_Actions.xml" hash="f9e77235e41f79ac086160ef2e494837"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="actions"><file name="script.phtml" hash="aa322fad9cd04ae7c910936e043fa8f1"/></dir></dir><dir name="layout"><file name="actions.xml" hash="e6a4b2f6d8132a833a1b5f8b9fce7166"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
- <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.7.0.2</min><max>1.9.2.4</max></package><extension><name>openssl</name><min>0.9.6</min><max>1.0.1</max></extension></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>cartdefender_actions</name>
4
+ <version>2.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Increase sales with this state-of-the-art product recommendations and targeted popups, including a FREE exit intent message. Engage your visitors in real time or later via email!</summary>
10
+ <description>You can instantly use product recommendations, messages and offers which convert your visitors into customers. Start with FREE exit intent messages. Do it without A/B tests, because Cart Defender learns which messages convert the best and adjusts itself automatically.</description>
11
+ <notes>Product recommendation included. Plugin sends more data about products to Cart Defender.&#xD;
12
+ </notes>
13
  <authors><author><name>Radoslaw Gliniecki</name><user>Cart_Defender</user><email>radek@cartdefender.com</email></author><author><name>Jan Zankowski</name><user>janzankowski</user><email>jan@cartdefender.com</email></author><author><name>Przemyslaw Gliniecki</name><user>psgliniecki</user><email>psg@cartdefender.com</email></author></authors>
14
+ <date>2017-03-13</date>
15
+ <time>20:14:21</time>
16
+ <contents><target name="magecommunity"><dir name="CartDefender"><dir name="Actions"><dir name="Block"><file name="Script.php" hash="247305c63594b6442e94122b226e3bb2"/></dir><dir name="Helper"><file name="Data.php" hash="dd4057deaaa8b0bdcfcc3e6f7c31091c"/><file name="Logger.php" hash="f21b3aed521b3761a890b22ba0f247a9"/></dir><dir name="Model"><file name="AsyncLocalSender.php" hash="f92a25257a8262840019eaff9eb0a387"/><file name="CorrelationIdManager.php" hash="7215fd45ca052d5bde16e93d278565be"/><file name="EventAsyncLocalSender.php" hash="cd9a25e21225cb1966da47fbbc8f9854"/><file name="EventBuilder.php" hash="fb4642447e925748ec47f4620d26b4c0"/><file name="Observer.php" hash="f34856aad9bf7aeb870317f6548eb349"/></dir><dir name="controllers"><file name="CartDefenderSenderController.php" hash="f35bb2528ccab59c3e2df3efa8172fd2"/></dir><dir name="etc"><file name="config.xml" hash="b9d1b6f7bb362aa490d2f13f38695867"/><file name="system.xml" hash="3b03c1e1412712cbba28a999dd52514c"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="CartDefender_Actions.xml" hash="f9e77235e41f79ac086160ef2e494837"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="actions"><file name="script.phtml" hash="aa322fad9cd04ae7c910936e043fa8f1"/></dir></dir><dir name="layout"><file name="actions.xml" hash="e6a4b2f6d8132a833a1b5f8b9fce7166"/></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
+ <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.7.0.2</min><max>1.9.3.2</max></package><extension><name>openssl</name><min>0.9.6</min><max>1.1.0</max></extension></required></dependencies>
19
  </package>