shoppingfeeder - Version 1.2.1

Version Notes

This version has a number of major updates, including:
- Reducing payload on unchanged products
- Enhanced support for configurable products, providing child products as variants
- Updated attribute support to enable attribute mapping in ShoppingFeeder

Features include:
- One-click feed export to numerous channels
- Built-in order tracking
- Click & referral tracking
- Historical order importing for reporting and ROI analysis

Download this release

Release Info

Developer ShoppingFeeder
Extension shoppingfeeder
Version 1.2.1
Comparing to
See all releases


Code changes from version 1.2.0 to 1.2.1

app/code/community/ShoppingFeeder/Service/Model/Offers.php CHANGED
@@ -163,23 +163,39 @@ class ShoppingFeeder_Service_Model_Offers extends Mage_Core_Model_Abstract
163
  $urlHashParts = array();
164
 
165
  // Collect options applicable to the configurable product
166
- foreach ($variantOptions['refactoredOptions'][$variant->getId()] as $attributeCode => $option) {
167
- $variantOptionsTitle[] = $option['value'];
 
 
168
 
169
- //add these configured attributes to the set of parent's attributes
170
- $usefulAttributes[$attributeCode] = $option['value'];
171
 
172
- $variantPrice += $option['price'];
173
 
174
- $urlHashParts[] = $option['attributeId'].'='.$option['valueId'];
 
175
  }
176
 
177
  $variantOptionsTitle = implode(' / ', $variantOptionsTitle);
178
  $title = $data['name'] . ' - ' . $variantOptionsTitle;
179
  $sku = $variant->getData('sku');
180
  $price = $variantPrice;
181
- $imageUrl = $p['image_url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).
182
- 'catalog/product'.$variant->getImage();
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  $productUrl = $product->getProductUrl().'#'.implode('&', $urlHashParts);
184
 
185
  // var_dump($variantOptionsTitle);
@@ -192,8 +208,10 @@ class ShoppingFeeder_Service_Model_Offers extends Mage_Core_Model_Abstract
192
  $title = $data['name'];
193
  $sku = $data['sku'];
194
  $price = $product->getPrice();
 
195
  $imageUrl = $p['image_url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).
196
- 'catalog/product'.$product->getImage();
 
197
  $productUrl = $product->getProductUrl();
198
  }
199
 
@@ -239,7 +257,10 @@ class ShoppingFeeder_Service_Model_Offers extends Mage_Core_Model_Abstract
239
  $p['internal_update_time'] = isset($usefulAttributes['updated_at']) ? $usefulAttributes['updated_at'] : '';
240
 
241
  $p['image_url'] = $imageUrl;
242
- $p['image_modified_time'] = date("c", filemtime($product->getMediaConfig()->getMediaPath($product->getImage())));
 
 
 
243
  $p['availability'] = ($stockItem->getIsInStock())?'in stock':'out of stock';
244
  $p['quantity'] = $stockItem->getQty();
245
  $p['condition'] = '';
@@ -250,7 +271,10 @@ class ShoppingFeeder_Service_Model_Offers extends Mage_Core_Model_Abstract
250
  {
251
  $galleryImage = array();
252
  $galleryImage['url'] = $image['url'];
253
- $galleryImage['image_modified_time'] = date("c", filemtime($image['path']));
 
 
 
254
  $imageGallery[] = $galleryImage;
255
  }
256
  $p['extra_images'] = $imageGallery;
@@ -267,6 +291,9 @@ class ShoppingFeeder_Service_Model_Offers extends Mage_Core_Model_Abstract
267
  ->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED)
268
  ->addAttributeToFilter('visibility', Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);
269
 
 
 
 
270
  if (!is_null($page))
271
  {
272
  $offset = ($page * $numPerPage) - $numPerPage;
@@ -294,9 +321,10 @@ class ShoppingFeeder_Service_Model_Offers extends Mage_Core_Model_Abstract
294
  /** @var Mage_Catalog_Model_Product_Type_Configurable $configModel */
295
  $configModel = Mage::getModel('catalog/product_type_configurable');
296
 
297
- $variants = array_pop($configModel->getChildrenIds($product->getId()));
 
298
 
299
- if (count($variants) > 0)
300
  {
301
  $parent = $product;
302
 
@@ -317,6 +345,7 @@ class ShoppingFeeder_Service_Model_Offers extends Mage_Core_Model_Abstract
317
  $valueId = $option['id'];
318
  foreach ($option['products'] as $productId)
319
  {
 
320
  $variantAttributes[$productId][$code]['value'] = $value;
321
  $variantAttributes[$productId][$code]['price'] = $price;
322
  $variantAttributes[$productId][$code]['valueId'] = $valueId;
@@ -327,10 +356,10 @@ class ShoppingFeeder_Service_Model_Offers extends Mage_Core_Model_Abstract
327
  $variantOptions['refactoredOptions'] = $variantAttributes;
328
 
329
 
330
- foreach ($variants as $variantId)
331
  {
332
  /** @var Mage_Catalog_Model_Product $variant */
333
- $variant = Mage::getModel('catalog/product')->load($variantId);
334
 
335
  $productData = $this->getProductInfo($variant, $parent, $variantOptions, $lastUpdate);
336
  if (!empty($productData))
163
  $urlHashParts = array();
164
 
165
  // Collect options applicable to the configurable product
166
+ if (isset($variantOptions['refactoredOptions'][$variant->getId()]))
167
+ {
168
+ foreach ($variantOptions['refactoredOptions'][$variant->getId()] as $attributeCode => $option) {
169
+ $variantOptionsTitle[] = $option['value'];
170
 
171
+ //add these configured attributes to the set of parent's attributes
172
+ $usefulAttributes[$attributeCode] = $option['value'];
173
 
174
+ $variantPrice += $option['price'];
175
 
176
+ $urlHashParts[] = $option['attributeId'].'='.$option['valueId'];
177
+ }
178
  }
179
 
180
  $variantOptionsTitle = implode(' / ', $variantOptionsTitle);
181
  $title = $data['name'] . ' - ' . $variantOptionsTitle;
182
  $sku = $variant->getData('sku');
183
  $price = $variantPrice;
184
+ $variantImage = $variant->getImage();
185
+ if (!is_null($variantImage) && !empty($variantImage))
186
+ {
187
+ $imageFile = $variant->getImage();
188
+ $imageUrl = $p['image_url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).
189
+ 'catalog/product'.$imageFile;
190
+ $imageLocalPath = $variant->getMediaConfig()->getMediaPath($imageFile);
191
+ }
192
+ else
193
+ {
194
+ $imageFile = $product->getImage();
195
+ $imageUrl = $p['image_url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).
196
+ 'catalog/product'.$imageFile;
197
+ $imageLocalPath = $product->getMediaConfig()->getMediaPath($imageFile);
198
+ }
199
  $productUrl = $product->getProductUrl().'#'.implode('&', $urlHashParts);
200
 
201
  // var_dump($variantOptionsTitle);
208
  $title = $data['name'];
209
  $sku = $data['sku'];
210
  $price = $product->getPrice();
211
+ $imageFile = $product->getImage();
212
  $imageUrl = $p['image_url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).
213
+ 'catalog/product'.$imageFile;
214
+ $imageLocalPath = $product->getMediaConfig()->getMediaPath($imageFile);
215
  $productUrl = $product->getProductUrl();
216
  }
217
 
257
  $p['internal_update_time'] = isset($usefulAttributes['updated_at']) ? $usefulAttributes['updated_at'] : '';
258
 
259
  $p['image_url'] = $imageUrl;
260
+ if (file_exists($imageLocalPath))
261
+ {
262
+ $p['image_modified_time'] = date("c", filemtime($imageLocalPath));
263
+ }
264
  $p['availability'] = ($stockItem->getIsInStock())?'in stock':'out of stock';
265
  $p['quantity'] = $stockItem->getQty();
266
  $p['condition'] = '';
271
  {
272
  $galleryImage = array();
273
  $galleryImage['url'] = $image['url'];
274
+ if (file_exists($image['path']))
275
+ {
276
+ $galleryImage['image_modified_time'] = date("c", filemtime($image['path']));
277
+ }
278
  $imageGallery[] = $galleryImage;
279
  }
280
  $p['extra_images'] = $imageGallery;
291
  ->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED)
292
  ->addAttributeToFilter('visibility', Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);
293
 
294
+ $store='french';
295
+ $collection->addStoreFilter(Mage::app()->getStore($store)->getId());
296
+
297
  if (!is_null($page))
298
  {
299
  $offset = ($page * $numPerPage) - $numPerPage;
321
  /** @var Mage_Catalog_Model_Product_Type_Configurable $configModel */
322
  $configModel = Mage::getModel('catalog/product_type_configurable');
323
 
324
+ //$children = $configModel->getChildrenIds($product->getId());
325
+ $children = $configModel->getUsedProducts(null,$product);
326
 
327
+ if (count($children) > 0)
328
  {
329
  $parent = $product;
330
 
345
  $valueId = $option['id'];
346
  foreach ($option['products'] as $productId)
347
  {
348
+ //$children[] = $productId;
349
  $variantAttributes[$productId][$code]['value'] = $value;
350
  $variantAttributes[$productId][$code]['price'] = $price;
351
  $variantAttributes[$productId][$code]['valueId'] = $valueId;
356
  $variantOptions['refactoredOptions'] = $variantAttributes;
357
 
358
 
359
+ foreach ($children as $variant)
360
  {
361
  /** @var Mage_Catalog_Model_Product $variant */
362
+ //$variant = Mage::getModel('catalog/product')->load($variantId);
363
 
364
  $productData = $this->getProductInfo($variant, $parent, $variantOptions, $lastUpdate);
365
  if (!empty($productData))
app/code/community/ShoppingFeeder/Service/controllers/VersionController.php CHANGED
@@ -5,7 +5,7 @@ require_once(Mage::getModuleDir('Controller','ShoppingFeeder_Service').DS.'Contr
5
 
6
  class ShoppingFeeder_Service_VersionController extends Mage_Core_Controller_Front_Action
7
  {
8
- protected static $_version = '1.1.6';
9
 
10
  public function indexAction()
11
  {
5
 
6
  class ShoppingFeeder_Service_VersionController extends Mage_Core_Controller_Front_Action
7
  {
8
+ protected static $_version = '1.2.1';
9
 
10
  public function indexAction()
11
  {
app/code/community/ShoppingFeeder/Service/etc/config.xml CHANGED
@@ -9,7 +9,7 @@
9
  <config>
10
  <modules>
11
  <ShoppingFeeder_Service>
12
- <version>1.0.0</version>
13
  </ShoppingFeeder_Service>
14
  </modules>
15
  <global>
9
  <config>
10
  <modules>
11
  <ShoppingFeeder_Service>
12
+ <version>1.2.1</version>
13
  </ShoppingFeeder_Service>
14
  </modules>
15
  <global>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>shoppingfeeder</name>
4
- <version>1.2.0</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
@@ -27,9 +27,9 @@ Features include:&#xD;
27
  - Click &amp; referral tracking&#xD;
28
  - Historical order importing for reporting and ROI analysis</notes>
29
  <authors><author><name>ShoppingFeeder</name><user>shoppingfeeder</user><email>support@shoppingfeeder.com</email></author></authors>
30
- <date>2015-04-13</date>
31
- <time>08:25:15</time>
32
- <contents><target name="mageetc"><dir name="modules"><file name="ShoppingFeeder_Service.xml" hash="90b374109c2d1281ddf527f24fa7d914"/></dir></target><target name="magecommunity"><dir name="ShoppingFeeder"><dir name="Service"><dir name="Block"><dir name="Adminhtml"><file name="Service.php" hash="e94d54bc342dc2941753ad635c0454a3"/></dir><file name="Service.php" hash="48874f0e80ce70686b81eb5380e9f498"/></dir><dir name="Controller"><file name="FrontAuth.php" hash="2dc20fec996f1c02ad8b9374af432ec0"/></dir><dir name="Helper"><file name="Data.php" hash="17589bd08352e497806bef9884972300"/></dir><dir name="Model"><file name="Auth.php" hash="2cff17b0750ff70695b32524627b2aaf"/><file name="Observer.php" hash="79c5aa286d8bfacbe5b4c759b8b0c5f1"/><file name="Offers.php" hash="45ca08e63a13a46795d8e3025cfa47e7"/><file name="Orders.php" hash="682845c908726831937d648ec966db9f"/></dir><dir name="controllers"><file name="AttributesController.php" hash="163472c6ed07a2d9fea4c933a5b6f446"/><file name="FeedController.php" hash="6d469ec267e6e03c6d3a66821bd24848"/><file name="OrdersController.php" hash="07d47f30b9740c9dbb3cebbc54ca915f"/><file name="TestController.php" hash="77604f9f9660c4bcd8ad166160945c85"/><file name="VersionController.php" hash="af8303ea5297a3499f183ae1787f6d2b"/></dir><dir name="etc"><file name="config.xml" hash="51fe66a6abd05e684e66c8b90241a9dc"/><file name="system.xml" hash="9681c74fa8886143197932690616e2dd"/></dir></dir></dir></target></contents>
33
  <compatible/>
34
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
35
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>shoppingfeeder</name>
4
+ <version>1.2.1</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
27
  - Click &amp; referral tracking&#xD;
28
  - Historical order importing for reporting and ROI analysis</notes>
29
  <authors><author><name>ShoppingFeeder</name><user>shoppingfeeder</user><email>support@shoppingfeeder.com</email></author></authors>
30
+ <date>2015-04-30</date>
31
+ <time>08:07:48</time>
32
+ <contents><target name="mageetc"><dir name="modules"><file name="ShoppingFeeder_Service.xml" hash="90b374109c2d1281ddf527f24fa7d914"/></dir></target><target name="magecommunity"><dir name="ShoppingFeeder"><dir name="Service"><dir name="Block"><dir name="Adminhtml"><file name="Service.php" hash="e94d54bc342dc2941753ad635c0454a3"/></dir><file name="Service.php" hash="48874f0e80ce70686b81eb5380e9f498"/></dir><dir name="Controller"><file name="FrontAuth.php" hash="2dc20fec996f1c02ad8b9374af432ec0"/></dir><dir name="Helper"><file name="Data.php" hash="17589bd08352e497806bef9884972300"/></dir><dir name="Model"><file name="Auth.php" hash="2cff17b0750ff70695b32524627b2aaf"/><file name="Observer.php" hash="79c5aa286d8bfacbe5b4c759b8b0c5f1"/><file name="Offers.php" hash="2c60d235650767989b933d202d7604d0"/><file name="Orders.php" hash="682845c908726831937d648ec966db9f"/></dir><dir name="controllers"><file name="AttributesController.php" hash="163472c6ed07a2d9fea4c933a5b6f446"/><file name="FeedController.php" hash="6d469ec267e6e03c6d3a66821bd24848"/><file name="OrdersController.php" hash="07d47f30b9740c9dbb3cebbc54ca915f"/><file name="TestController.php" hash="77604f9f9660c4bcd8ad166160945c85"/><file name="VersionController.php" hash="c12a5643372ec4d8c17d6caf11ebb9a6"/></dir><dir name="etc"><file name="config.xml" hash="de0e54dbd281b21e508c044c238d1162"/><file name="system.xml" hash="9681c74fa8886143197932690616e2dd"/></dir></dir></dir></target></contents>
33
  <compatible/>
34
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
35
  </package>