eBay_Enterprise_Display_Extension - Version 1.0.4

Version Notes

Fix cron schedule
Fix redundant SQL loads
Fix product feed to filter out disabled, out-of-stock and invisible products
Optimize memory use when loading large catalogs to generate the product feed
Fix Feed Retrieve Action, was sending feed twice

Download this release

Release Info

Developer Michael A. Smith
Extension eBay_Enterprise_Display_Extension
Version 1.0.4
Comparing to
See all releases


Code changes from version 1.0.3 to 1.0.4

app/code/community/EbayEnterprise/Display/Block/Adminhtml/System/Config/Form/Field/Feedurl.php CHANGED
@@ -1,4 +1,20 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * This class is block (but is specified as a 'frontend_model' it the config.xml)
4
  * which effectively overrides lib/Varien/Data/Form/Element/Textarea.php so that we
1
  <?php
2
+ /**
3
+ * Copyright (c) 2014 eBay Enterprise, Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the eBay Enterprise
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+ *
13
+ * @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ * @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
  /**
19
  * This class is block (but is specified as a 'frontend_model' it the config.xml)
20
  * which effectively overrides lib/Varien/Data/Form/Element/Textarea.php so that we
app/code/community/EbayEnterprise/Display/Block/Beacon.php CHANGED
@@ -1,4 +1,20 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class EbayEnterprise_Display_Block_Beacon extends Mage_Core_Block_Template
3
  {
4
  protected $_order; // The order
1
  <?php
2
+ /**
3
+ * Copyright (c) 2014 eBay Enterprise, Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the eBay Enterprise
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+ *
13
+ * @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ * @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
  class EbayEnterprise_Display_Block_Beacon extends Mage_Core_Block_Template
19
  {
20
  protected $_order; // The order
app/code/community/EbayEnterprise/Display/Helper/Config.php CHANGED
@@ -1,4 +1,20 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * @codeCoverageIgnore
4
  */
@@ -12,6 +28,7 @@ class EbayEnterprise_Display_Helper_Config extends Mage_Core_Helper_Abstract
12
  const EEMS_DISPLAY_PRODUCT_FEED_FRONTNAME_PATH = 'frontend/routers/eems_display/args/frontName';
13
  const EEMS_DISPLAY_SITE_ID_PATH = 'marketing_solutions/eems_display/site_id';
14
  const EEMS_DISPLAY_SITE_ID_CHECKSUM_PATH = 'marketing_solutions/eems_display/site_id_checksum';
 
15
  /**
16
  * Get whether or not this extension is enabled.
17
  * @return boolean
@@ -53,7 +70,7 @@ class EbayEnterprise_Display_Helper_Config extends Mage_Core_Helper_Abstract
53
  return $path;
54
  }
55
  /**
56
- * Gets the frontName of the router for the Display feed controller
57
  * @return string
58
  */
59
  public function getProductFeedFrontName()
@@ -61,7 +78,15 @@ class EbayEnterprise_Display_Helper_Config extends Mage_Core_Helper_Abstract
61
  return Mage::getConfig()->getNode(self::EEMS_DISPLAY_PRODUCT_FEED_FRONTNAME_PATH);
62
  }
63
  /**
64
- * Gets the height configuration for feed images
 
 
 
 
 
 
 
 
65
  * @return int
66
  */
67
  public function getFeedImageHeight($storeId)
1
  <?php
2
+ /**
3
+ * Copyright (c) 2014 eBay Enterprise, Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the eBay Enterprise
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+ *
13
+ * @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ * @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
  /**
19
  * @codeCoverageIgnore
20
  */
28
  const EEMS_DISPLAY_PRODUCT_FEED_FRONTNAME_PATH = 'frontend/routers/eems_display/args/frontName';
29
  const EEMS_DISPLAY_SITE_ID_PATH = 'marketing_solutions/eems_display/site_id';
30
  const EEMS_DISPLAY_SITE_ID_CHECKSUM_PATH = 'marketing_solutions/eems_display/site_id_checksum';
31
+ const EEMS_DISPLAY_PRODUCT_FEED_PAGESIZE_PATH = 'marketing_solutions/eems_display/product_feed_buffer';
32
  /**
33
  * Get whether or not this extension is enabled.
34
  * @return boolean
70
  return $path;
71
  }
72
  /**
73
+ * Gets the frontName of the router for the Display feed controller
74
  * @return string
75
  */
76
  public function getProductFeedFrontName()
78
  return Mage::getConfig()->getNode(self::EEMS_DISPLAY_PRODUCT_FEED_FRONTNAME_PATH);
79
  }
80
  /**
81
+ * Gets the Page Size for the product collection; this is the number of products processed simultaneously
82
+ * @return int
83
+ */
84
+ public function getProductFeedPageSize()
85
+ {
86
+ return (int) Mage::getStoreConfig(self::EEMS_DISPLAY_PRODUCT_FEED_PAGESIZE_PATH) ? : 1;
87
+ }
88
+ /**
89
+ * Gets the height configuration for feed images
90
  * @return int
91
  */
92
  public function getFeedImageHeight($storeId)
app/code/community/EbayEnterprise/Display/Helper/Data.php CHANGED
@@ -1,4 +1,20 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class EbayEnterprise_Display_Helper_Data extends Mage_Core_Helper_Abstract
3
  {
4
  const EEMS_DISPLAY_PRODUCT_FEED_ROUTE = '/index/retrieve?id=';
1
  <?php
2
+ /**
3
+ * Copyright (c) 2014 eBay Enterprise, Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the eBay Enterprise
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+ *
13
+ * @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ * @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
  class EbayEnterprise_Display_Helper_Data extends Mage_Core_Helper_Abstract
19
  {
20
  const EEMS_DISPLAY_PRODUCT_FEED_ROUTE = '/index/retrieve?id=';
app/code/community/EbayEnterprise/Display/Model/Adminhtml/System/Config/Backend/Feedurl.php CHANGED
@@ -1,4 +1,20 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class EbayEnterprise_Display_Model_Adminhtml_System_Config_Backend_Feedurl
3
  extends Mage_Core_Model_Config_Data
4
  {
1
  <?php
2
+ /**
3
+ * Copyright (c) 2014 eBay Enterprise, Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the eBay Enterprise
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+ *
13
+ * @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ * @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
  class EbayEnterprise_Display_Model_Adminhtml_System_Config_Backend_Feedurl
19
  extends Mage_Core_Model_Config_Data
20
  {
app/code/community/EbayEnterprise/Display/Model/Adminhtml/System/Config/Backend/Siteidchecksum.php CHANGED
@@ -1,4 +1,20 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A class that checks that the entered md5 Site Id Checksum mathes the one we generate.
4
  */
1
  <?php
2
+ /**
3
+ * Copyright (c) 2014 eBay Enterprise, Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the eBay Enterprise
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+ *
13
+ * @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ * @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
  /**
19
  * A class that checks that the entered md5 Site Id Checksum mathes the one we generate.
20
  */
app/code/community/EbayEnterprise/Display/Model/Email.php CHANGED
@@ -1,4 +1,20 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * @codeCoverageIgnore
4
  */
1
  <?php
2
+ /**
3
+ * Copyright (c) 2014 eBay Enterprise, Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the eBay Enterprise
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+ *
13
+ * @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ * @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
  /**
19
  * @codeCoverageIgnore
20
  */
app/code/community/EbayEnterprise/Display/Model/Error/Exception.php CHANGED
@@ -1,4 +1,20 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class EbayEnterprise_Display_Model_Error_Exception extends Mage_Core_Exception
3
  {
4
  }
1
  <?php
2
+ /**
3
+ * Copyright (c) 2014 eBay Enterprise, Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the eBay Enterprise
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+ *
13
+ * @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ * @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
  class EbayEnterprise_Display_Model_Error_Exception extends Mage_Core_Exception
19
  {
20
  }
app/code/community/EbayEnterprise/Display/Model/Products.php CHANGED
@@ -1,4 +1,20 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class EbayEnterprise_Display_Model_Products extends Mage_Core_Model_Abstract
3
  {
4
  const CSV_FIELD_DELIMITER = ',';
@@ -19,71 +35,52 @@ class EbayEnterprise_Display_Model_Products extends Mage_Core_Model_Abstract
19
  }
20
  }
21
  /**
22
- * Puts an array of data into a file pointed to by fileHandle
23
- * @param $outputFileName (full path)
24
- * @param $dataRows
25
- * @return self
26
  */
27
- protected function _createCsvFile($outputFileName, $dataRows)
28
  {
29
- $fh = fopen($outputFileName, 'w');
30
- if ($fh === false) {
31
- Mage::log('Cannot open file for writing: ' . $outputFileName);
32
- } else {
33
- foreach ($dataRows as $row) {
34
- fputcsv( $fh, $row, self::CSV_FIELD_DELIMITER, self::CSV_FIELD_ENCLOSURE);
35
- }
36
- fclose($fh);
37
- }
38
- return $this;
39
  }
40
  /**
41
  * Processes output files for one Store Group. Each store that has a
42
  * non-empty SiteId and is enabled gets a feed output. File name
43
  * is StoreId.csv and it's placed in the configured feed file path.
 
 
44
  */
45
- protected function _processStores($stores)
46
  {
47
- $helper = Mage::helper('eems_display/config');
48
- $dirName = $helper->getFeedFilePath();
49
  foreach ($stores as $store) {
50
  $storeId = $store->getId();
51
  $siteId = $helper->getSiteId($storeId);
52
  if (empty($siteId) || !$helper->getIsEnabled($storeId)) {
 
 
 
 
 
 
 
53
  continue;
54
  }
55
- $outputFileName = $dirName . DS . $storeId . '.csv';
56
- $rows = array_merge(
57
- array($this->_getProductDataHeader()),
58
- $this->_getProductData($storeId)
59
- );
60
- $this->_createCsvFile($outputFileName, $rows);
61
  }
62
  return $this;
63
  }
64
- /**
65
- * Get the product collection for this store.
66
- * @return object (collection of Mage_Sales_Model_Order)
67
- */
68
- protected function _getProductCollection($storeId=null)
69
- {
70
- return Mage::getModel('catalog/product')
71
- ->getCollection()
72
- ->addStoreFilter($storeId);
73
- }
74
- /**
75
- * Return an array of header row values.
76
- * @return array
77
- */
78
- protected function _getProductDataHeader()
79
- {
80
- return array('Id', 'Name', 'Description', 'Price', 'Image URL', 'Page URL');
81
- }
82
  /**
83
  * Gets the product image URL, ensuring that it gets resized
84
- * @return image url, or blank if we can't get if figured out
 
 
85
  */
86
- protected function _getResizedImage($product, $storeId)
87
  {
88
  $helper = Mage::helper('eems_display/config');
89
  try {
@@ -100,31 +97,55 @@ class EbayEnterprise_Display_Model_Products extends Mage_Core_Model_Abstract
100
  );
101
  } catch (Exception $e) {
102
  $imageUrl = '';
103
- Mage::log('Error sizing Image URL for ' . $product->getSku(), $e->getMessage());
104
  }
105
  return $imageUrl;
106
  }
107
  /**
108
  * Compile the product data for Fetchback into
109
  * an array that can be put into a CSV.
110
- * @return array
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  */
112
- protected function _getProductData($storeId)
113
  {
114
- $data = array();
115
- $products = $this->_getProductCollection($storeId);
116
- $helper = Mage::helper('eems_display');
117
- foreach($products as $collectedProduct) {
118
- $product = Mage::getModel('catalog/product')->setStoreId($storeId)->load($collectedProduct->getId());
119
- $data[] = array(
120
- $product->getSku(),
121
- $helper->cleanString($product->getName()),
122
- $helper->cleanString($product->getShortDescription()),
123
- $product->getPrice(),
124
- $this->_getResizedImage($product, $storeId),
125
- $product->getProductUrl(),
126
- );
 
 
 
 
 
 
 
 
 
 
 
127
  }
128
- return $data;
129
  }
130
  }
1
  <?php
2
+ /**
3
+ * Copyright (c) 2014 eBay Enterprise, Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the eBay Enterprise
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+ *
13
+ * @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ * @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
  class EbayEnterprise_Display_Model_Products extends Mage_Core_Model_Abstract
19
  {
20
  const CSV_FIELD_DELIMITER = ',';
35
  }
36
  }
37
  /**
38
+ * Writes an array as a string into the resource fh
39
+ * @param $fh resource handle
40
+ * @param $dataRow array of values to be written
41
+ * @return int length of string written, or false on failure
42
  */
43
+ protected function _writeCsvRow($fh, array $dataRow)
44
  {
45
+ return fputcsv($fh, $dataRow, self::CSV_FIELD_DELIMITER, self::CSV_FIELD_ENCLOSURE);
 
 
 
 
 
 
 
 
 
46
  }
47
  /**
48
  * Processes output files for one Store Group. Each store that has a
49
  * non-empty SiteId and is enabled gets a feed output. File name
50
  * is StoreId.csv and it's placed in the configured feed file path.
51
+ * @param $stores array of Mage_Core_Model_Store(s) to process
52
+ * @return self
53
  */
54
+ protected function _processStores(array $stores)
55
  {
56
+ $helper = Mage::helper('eems_display/config');
57
+ $dirName = $helper->getFeedFilePath();
58
  foreach ($stores as $store) {
59
  $storeId = $store->getId();
60
  $siteId = $helper->getSiteId($storeId);
61
  if (empty($siteId) || !$helper->getIsEnabled($storeId)) {
62
+ // If this store doesn't have a site id, or isn't enabled for Display, skip it
63
+ continue;
64
+ }
65
+ $fh = fopen($dirName . DS . $storeId . '.csv', 'w');
66
+ if ($fh === false) {
67
+ // If we can't open the output file, complain to log and skip this store
68
+ Mage::log("Cannot open file for writing in {$dirName}.");
69
  continue;
70
  }
71
+ $this->_writeCsvRow($fh, array('Id', 'Name', 'Description', 'Price', 'Image URL', 'Page URL'));
72
+ $this->_writeDataRows($fh, $storeId);
73
+ fclose($fh);
 
 
 
74
  }
75
  return $this;
76
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  /**
78
  * Gets the product image URL, ensuring that it gets resized
79
+ * @param $product One Mage_Catalog_Model_Product from a Collection
80
+ * @param $storeId int which store Id this is for
81
+ * @return image url, or blank if we can't get it figured out
82
  */
83
+ protected function _getResizedImage(Mage_Catalog_Model_Product $product, $storeId)
84
  {
85
  $helper = Mage::helper('eems_display/config');
86
  try {
97
  );
98
  } catch (Exception $e) {
99
  $imageUrl = '';
100
+ Mage::log("Error sizing Image URL for {$product->getSku()}: {$e->getMessage()}");
101
  }
102
  return $imageUrl;
103
  }
104
  /**
105
  * Compile the product data for Fetchback into
106
  * an array that can be put into a CSV.
107
+ * @param $fh resource handle
108
+ * @param $storeId Store id
109
+ * @return self
110
+ *
111
+ * The collection is formed thus:
112
+ * 1. Since we are working with multiple stores, we use Mage:getResourceModel('catalog/product_collection') instead of
113
+ * Mage::getModel('catalog/product')->getCollection() because the latter will load some store context we
114
+ * prefer to control explicitly.
115
+ * 2. setStore() is a method that will set up store context we do need. It does not set filtering.
116
+ * 3. addAttributeToSelect() to get only the fields we need. Each product's _data will contain only these fields.
117
+ * 4. addFieldToFilter() basically our 'where' clauses
118
+ * 5. addStoreFilter() called without arguments defaults to the store most recently setStore()'d. Admin store is explicitly
119
+ * ignored by addStoreFilter().
120
+ * 6. setPageSize() in order to limit collection's use of memory. This is the number of products we'll load at once.
121
  */
122
+ protected function _writeDataRows($fh, $storeId)
123
  {
124
+ $helper = Mage::helper('eems_display');
125
+ $products = Mage::getResourceModel('catalog/product_collection')
126
+ ->setStore($storeId)
127
+ ->addAttributeToSelect(array('sku', 'name', 'short_description', 'price', 'url_key'))
128
+ ->addFieldToFilter('visibility', array('neq'=>Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE))
129
+ ->addFieldToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED)
130
+ ->addStoreFilter()
131
+ ->setPageSize(Mage::helper('eems_display/config')->getProductFeedPageSize());
132
+
133
+ $lastPage = $products->getLastPageNumber();
134
+ for($page = 1; $page <= $lastPage; $page++) {
135
+ $products->setCurPage($page);
136
+ foreach ($products as $product) {
137
+ $this->_writeCsvRow($fh,
138
+ array(
139
+ $product->getSku(),
140
+ $helper->cleanString($product->getName()),
141
+ $helper->cleanString($product->getShortDescription()),
142
+ $product->getPrice(),
143
+ $this->_getResizedImage($product, $storeId),
144
+ $product->getProductUrl(),
145
+ ));
146
+ }
147
+ $products->clear();
148
  }
149
+ return $this;
150
  }
151
  }
app/code/community/EbayEnterprise/Display/controllers/IndexController.php CHANGED
@@ -1,4 +1,20 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * There is no index action for this controller. You must use 'retrieve?id=' to retrieve
4
  * an existing feed. If we decide later we want to create feeds upon request via this
@@ -36,8 +52,7 @@ class EbayEnterprise_Display_IndexController extends Mage_Core_Controller_Front_
36
  {
37
  $this->getResponse()
38
  ->setHeader('Content-Type', 'text/csv')
39
- ->appendBody($contents)
40
- ->sendResponse();
41
  }
42
  /**
43
  * Send not found.
@@ -45,7 +60,6 @@ class EbayEnterprise_Display_IndexController extends Mage_Core_Controller_Front_
45
  protected function _sendNotFound()
46
  {
47
  $this->getResponse()
48
- ->setRawHeader('HTTP/1.1, 404')
49
- ->sendResponse();
50
  }
51
  }
1
  <?php
2
+ /**
3
+ * Copyright (c) 2014 eBay Enterprise, Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the eBay Enterprise
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+ *
13
+ * @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ * @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
  /**
19
  * There is no index action for this controller. You must use 'retrieve?id=' to retrieve
20
  * an existing feed. If we decide later we want to create feeds upon request via this
52
  {
53
  $this->getResponse()
54
  ->setHeader('Content-Type', 'text/csv')
55
+ ->appendBody($contents);
 
56
  }
57
  /**
58
  * Send not found.
60
  protected function _sendNotFound()
61
  {
62
  $this->getResponse()
63
+ ->setRawHeader('HTTP/1.1, 404');
 
64
  }
65
  }
app/code/community/EbayEnterprise/Display/etc/adminhtml.xml CHANGED
@@ -1,4 +1,19 @@
1
  <?xml version="1.0"?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  <config>
3
  <acl>
4
  <resources>
1
  <?xml version="1.0"?>
2
+ <!--
3
+ Copyright (c) 2014 eBay Enterprise, Inc.
4
+
5
+ NOTICE OF LICENSE
6
+
7
+ This source file is subject to the eBay Enterprise
8
+ Magento Extensions End User License Agreement
9
+ that is bundled with this package in the file LICENSE.md.
10
+ It is also available through the world-wide-web at this URL:
11
+ http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+
13
+ @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+
16
+ -->
17
  <config>
18
  <acl>
19
  <resources>
app/code/community/EbayEnterprise/Display/etc/config.xml CHANGED
@@ -1,4 +1,19 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  <config>
3
  <modules>
4
  <EbayEnterprise_Display>
@@ -8,7 +23,9 @@
8
  <default>
9
  <marketing_solutions>
10
  <eems_display>
11
- <!-- These are values you can change in the admin interface: -->
 
 
12
  <!-- Disabled by default: -->
13
  <enabled>0</enabled>
14
  <!-- Site Id provided by EEMS Display -->
@@ -21,7 +38,7 @@
21
  <!-- As per spec, 150x150: -->
22
  <height>150</height>
23
  <width>150</width>
24
- <!-- 1 = do not distort, 150x150 is a constraint: -->
25
  <keep_aspect_ratio>1</keep_aspect_ratio>
26
  </image>
27
  </feed>
1
  <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ Copyright (c) 2014 eBay Enterprise, Inc.
4
+
5
+ NOTICE OF LICENSE
6
+
7
+ This source file is subject to the eBay Enterprise
8
+ Magento Extensions End User License Agreement
9
+ that is bundled with this package in the file LICENSE.md.
10
+ It is also available through the world-wide-web at this URL:
11
+ http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+
13
+ @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+
16
+ -->
17
  <config>
18
  <modules>
19
  <EbayEnterprise_Display>
23
  <default>
24
  <marketing_solutions>
25
  <eems_display>
26
+ <!-- This value can be changed in admin interface: -->
27
+ <product_feed_buffer>1024</product_feed_buffer>
28
+ <!-- These are values you can change in the admin interface: -->
29
  <!-- Disabled by default: -->
30
  <enabled>0</enabled>
31
  <!-- Site Id provided by EEMS Display -->
38
  <!-- As per spec, 150x150: -->
39
  <height>150</height>
40
  <width>150</width>
41
+ <!-- 1 = do not distort, 150x150 is a constraint: -->
42
  <keep_aspect_ratio>1</keep_aspect_ratio>
43
  </image>
44
  </feed>
app/code/community/EbayEnterprise/Display/etc/system.xml CHANGED
@@ -1,4 +1,19 @@
1
  <?xml version="1.0" encoding="utf-8"?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  <config>
3
  <tabs>
4
  <ebayenterprise translate="label" module="eems_display">
@@ -66,6 +81,17 @@
66
  <show_in_store>1</show_in_store>
67
  <depends><enabled>1</enabled></depends>
68
  </product_feed_url>
 
 
 
 
 
 
 
 
 
 
 
69
  </fields>
70
  </eems_display>
71
  </groups>
1
  <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+ Copyright (c) 2014 eBay Enterprise, Inc.
4
+
5
+ NOTICE OF LICENSE
6
+
7
+ This source file is subject to the eBay Enterprise
8
+ Magento Extensions End User License Agreement
9
+ that is bundled with this package in the file LICENSE.md.
10
+ It is also available through the world-wide-web at this URL:
11
+ http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+
13
+ @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+
16
+ -->
17
  <config>
18
  <tabs>
19
  <ebayenterprise translate="label" module="eems_display">
81
  <show_in_store>1</show_in_store>
82
  <depends><enabled>1</enabled></depends>
83
  </product_feed_url>
84
+ <product_feed_buffer translate="label">
85
+ <label>Product Feed Buffer Size</label>
86
+ <comment><![CDATA[Maximum number of products in memory at a time while creating the feed.]]></comment>
87
+ <sort_order>500</sort_order>
88
+ <validate>validate-digits</validate>
89
+ <frontend_type>text</frontend_type>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>0</show_in_website>
92
+ <show_in_store>0</show_in_store>
93
+ <depends><enabled>1</enabled></depends>
94
+ </product_feed_buffer>
95
  </fields>
96
  </eems_display>
97
  </groups>
app/code/community/EbayEnterprise/Display/sql/eemsdisplay_setup/install-1.0.0.0.php CHANGED
@@ -1,4 +1,20 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  $this->startSetup();
3
  Mage::log(sprintf('[ %s ] Installing EEMS Display 1.0.0.0', get_class($this)), Zend_Log::INFO);
4
  $this->endSetup();
1
  <?php
2
+ /**
3
+ * Copyright (c) 2014 eBay Enterprise, Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the eBay Enterprise
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+ *
13
+ * @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ * @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
  $this->startSetup();
19
  Mage::log(sprintf('[ %s ] Installing EEMS Display 1.0.0.0', get_class($this)), Zend_Log::INFO);
20
  $this->endSetup();
app/design/frontend/base/default/layout/eems_display.xml CHANGED
@@ -1,11 +1,26 @@
1
  <?xml version="1.0"?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  <layout version="0.1.0">
3
 
4
  <default translate="label">
5
  <label>Default Layout</label>
6
  <update handle="eems_display_beacon"/>
7
  </default>
8
-
9
  <catalog_product_view>
10
  <reference name="eems_display.beacon">
11
  <action method="setPageType"><type>product</type></action>
@@ -23,7 +38,7 @@
23
  <action method="setPageType"><type>checkout_success</type></action>
24
  </reference>
25
  </checkout_onepage_success>
26
-
27
  <checkout_multishipping_success>
28
  <reference name="eems_display.beacon">
29
  <action method="setPageType"><type>checkout_success</type></action>
1
  <?xml version="1.0"?>
2
+ <!--
3
+ Copyright (c) 2014 eBay Enterprise, Inc.
4
+
5
+ NOTICE OF LICENSE
6
+
7
+ This source file is subject to the eBay Enterprise
8
+ Magento Extensions End User License Agreement
9
+ that is bundled with this package in the file LICENSE.md.
10
+ It is also available through the world-wide-web at this URL:
11
+ http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+
13
+ @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+
16
+ -->
17
  <layout version="0.1.0">
18
 
19
  <default translate="label">
20
  <label>Default Layout</label>
21
  <update handle="eems_display_beacon"/>
22
  </default>
23
+
24
  <catalog_product_view>
25
  <reference name="eems_display.beacon">
26
  <action method="setPageType"><type>product</type></action>
38
  <action method="setPageType"><type>checkout_success</type></action>
39
  </reference>
40
  </checkout_onepage_success>
41
+
42
  <checkout_multishipping_success>
43
  <reference name="eems_display.beacon">
44
  <action method="setPageType"><type>checkout_success</type></action>
app/design/frontend/base/default/template/eems_display/beacon.phtml CHANGED
@@ -1,3 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php if ($this->showBeacon()):?>
2
  <script>
3
  (function (d,i) {
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2014 eBay Enterprise, Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the eBay Enterprise
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+ *
13
+ * @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ * @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+ ?>
18
+
19
  <?php if ($this->showBeacon()):?>
20
  <script>
21
  (function (d,i) {
app/etc/modules/EbayEnterprise_Display.xml CHANGED
@@ -1,4 +1,19 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  <config>
3
  <modules>
4
  <EbayEnterprise_Display>
1
  <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ Copyright (c) 2014 eBay Enterprise, Inc.
4
+
5
+ NOTICE OF LICENSE
6
+
7
+ This source file is subject to the eBay Enterprise
8
+ Magento Extensions End User License Agreement
9
+ that is bundled with this package in the file LICENSE.md.
10
+ It is also available through the world-wide-web at this URL:
11
+ http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf
12
+
13
+ @copyright Copyright (c) 2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
14
+ @license http://www.ebayenterprise.com/files/pdf/Magento_Connect_Extensions_EULA_050714.pdf eBay Enterprise Magento Extensions End User License Agreement
15
+
16
+ -->
17
  <config>
18
  <modules>
19
  <EbayEnterprise_Display>
package.xml CHANGED
@@ -1,19 +1,22 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>eBay_Enterprise_Display_Extension</name>
4
- <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>eBay Enterprise Display Extension.</summary>
10
  <description>eBay Enterprise Display Extension.</description>
11
- <notes>DE1435 Remove CR/LF Characters Using Regex&#xD;
12
- US12310 Update Versioning Scheme</notes>
 
 
 
13
  <authors><author><name>Michael A. Smith</name><user>msmith3</user><email>msmith3@ebay.com</email></author><author><name>Michael Phang</name><user>mphang</user><email>mphang@ebay.com</email></author><author><name>Scott van Brug</name><user>svanbrug</user><email>svanbrug@ebay.com</email></author><author><name>Mike West</name><user>micwest</user><email>micwest@ebay.com</email></author><author><name>Reginald Gabriel</name><user>rgabriel</user><email>rgabriel@ebay.com</email></author></authors>
14
- <date>2014-06-06</date>
15
- <time>16:50:49</time>
16
- <contents><target name="magecommunity"><dir name="EbayEnterprise"><dir name="Display"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Feedurl.php" hash="82241e7e509b9c27dc734c8728e501f5"/></dir></dir></dir></dir></dir><file name="Beacon.php" hash="b272092167ffa1f7f08be5b3715b7968"/></dir><dir name="controllers"><file name="IndexController.php" hash="197cb073d339eb76e6dbcf2167107a93"/></dir><dir name="etc"><file name="adminhtml.xml" hash="e1208b50586829c2e6c6536dd062ef0c"/><file name="config.xml" hash="5c8237485eb9c7c77fea466e26f41bd9"/><file name="system.xml" hash="55731b868ba01e966120cd53235b4407"/></dir><dir name="Helper"><file name="Config.php" hash="f831ae412417e253a57f37d6d3423e50"/><file name="Data.php" hash="47cdce2767164d8400a1b22d60afb3f0"/></dir><dir name="Model"><file name="Email.php" hash="2252c80035c9515650cd49e2c52e3645"/><file name="Products.php" hash="49b8beb5bdfe7359424353f9d1fc1045"/><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><file name="Feedurl.php" hash="aa1810a7c67e0b35e732ff5155f81a6b"/><file name="Siteidchecksum.php" hash="f72b7dc6d0294faafcfc51e8ec46a222"/></dir></dir></dir></dir><dir name="Error"><file name="Exception.php" hash="65df9f687c4746431f9316baca3b5495"/></dir></dir><dir name="sql"><dir name="eemsdisplay_setup"><file name="install-1.0.0.0.php" hash="a9c02c7e94cdad9965ffa62571276ba2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="eems_display.xml" hash="7f823afa4c46cc316e198d5ff80eaa6b"/></dir><dir name="template"><dir name="eems_display"><file name="beacon.phtml" hash="4937e1a21b75f436b6a013fdcea59be9"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="EbayEnterprise_Display.xml" hash="ae74ae5088d96d6300c544a031d4c0c6"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="eemsdisplay_installed.html" hash="609fa6fc13a7a3f444bd0c256e207e7f"/></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.3.0</min><max>5.3.99</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>eBay_Enterprise_Display_Extension</name>
4
+ <version>1.0.4</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>eBay Enterprise Display Extension.</summary>
10
  <description>eBay Enterprise Display Extension.</description>
11
+ <notes>Fix cron schedule&#xD;
12
+ Fix redundant SQL loads&#xD;
13
+ Fix product feed to filter out disabled, out-of-stock and invisible products&#xD;
14
+ Optimize memory use when loading large catalogs to generate the product feed&#xD;
15
+ Fix Feed Retrieve Action, was sending feed twice </notes>
16
  <authors><author><name>Michael A. Smith</name><user>msmith3</user><email>msmith3@ebay.com</email></author><author><name>Michael Phang</name><user>mphang</user><email>mphang@ebay.com</email></author><author><name>Scott van Brug</name><user>svanbrug</user><email>svanbrug@ebay.com</email></author><author><name>Mike West</name><user>micwest</user><email>micwest@ebay.com</email></author><author><name>Reginald Gabriel</name><user>rgabriel</user><email>rgabriel@ebay.com</email></author></authors>
17
+ <date>2014-07-17</date>
18
+ <time>19:24:09</time>
19
+ <contents><target name="magecommunity"><dir name="EbayEnterprise"><dir name="Display"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Feedurl.php" hash="1a6f87067e5c90df4cb132a1c72c3720"/></dir></dir></dir></dir></dir><file name="Beacon.php" hash="3d7df7c99cbe14c3674f9ea1de9107b2"/></dir><dir name="controllers"><file name="IndexController.php" hash="bc9e0c1cff733c5ea12844749b23a271"/></dir><dir name="etc"><file name="adminhtml.xml" hash="61452f231ec0789cb099942114e40c66"/><file name="config.xml" hash="fdb4f449ed520e32917c89600d656c88"/><file name="system.xml" hash="6e6e2ccdfe9ebc924e9bc65679e927e0"/></dir><dir name="Helper"><file name="Config.php" hash="de07adc521b32768a9eff54df7d40a7f"/><file name="Data.php" hash="1f997035771cdbf3d52fac20b8170730"/></dir><dir name="Model"><file name="Email.php" hash="620442ee4fe546ccd6ccdbb87d17c713"/><file name="Products.php" hash="4c76f2399cc602ddc25fd1e2596b9bdc"/><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><file name="Feedurl.php" hash="00ef9f57e98b04a3308a75211aad8097"/><file name="Siteidchecksum.php" hash="ac3010688f91814d9d444daa647a3c93"/></dir></dir></dir></dir><dir name="Error"><file name="Exception.php" hash="2ae00aee170e687215c97258b81dbfab"/></dir></dir><dir name="sql"><dir name="eemsdisplay_setup"><file name="install-1.0.0.0.php" hash="d9a06b88ea97d71e99c012fb7d119710"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="eems_display.xml" hash="cdbd95c5ed75c1386b53340f32e5c0ab"/></dir><dir name="template"><dir name="eems_display"><file name="beacon.phtml" hash="f71564437f7a7ad4cda16057a6f5acbb"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="EbayEnterprise_Display.xml" hash="d943248b29e4d9d0e0566c12b62c6402"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="eemsdisplay_installed.html" hash="609fa6fc13a7a3f444bd0c256e207e7f"/></dir></dir></dir></target></contents>
20
  <compatible/>
21
  <dependencies><required><php><min>5.3.0</min><max>5.3.99</max></php></required></dependencies>
22
  </package>