roihunter_easy - Version 1.0.8

Version Notes

Created 3rd April, 2017 Compatibility: 1.9.2.4 - Set storeID i Product feed

Download this release

Release Info

Developer ROI Hunter
Extension roihunter_easy
Version 1.0.8
Comparing to
See all releases


Code changes from version 1.0.5 to 1.0.8

app/code/community/Businessfactory/Roihuntereasy/Block/Adminhtml/Admin.php CHANGED
@@ -13,28 +13,38 @@ class Businessfactory_Roihuntereasy_Block_Adminhtml_Admin extends Mage_Adminhtml
13
  return Mage::getIsDeveloperMode() ? "developer" : "production";
14
  }
15
 
16
- public function getStoreBaseUrl()
17
  {
18
- $storeId = Mage::app()
19
  ->getWebsite(true)
20
  ->getDefaultGroup()
21
- ->getDefaultStoreId();
22
- return Mage::app()->getStore($storeId)->getBaseUrl();
 
 
 
 
 
23
  }
24
 
25
  public function getStoreName()
26
  {
27
- return $this->store->getFrontendName();
28
  }
29
 
30
  public function getStoreLogo()
31
  {
32
- return $this->store->getLogoSrc();
33
  }
34
 
35
  public function getStoreCurrency()
36
  {
37
- return $this->store->getCurrentCurrencyCode();
 
 
 
 
 
38
  }
39
 
40
  public function getStoreLanguage()
13
  return Mage::getIsDeveloperMode() ? "developer" : "production";
14
  }
15
 
16
+ public function getDefaultStoreId()
17
  {
18
+ return Mage::app()
19
  ->getWebsite(true)
20
  ->getDefaultGroup()
21
+ ->getDefaultStoreId();;
22
+ }
23
+
24
+ public function getStoreBaseUrl()
25
+ {
26
+
27
+ return Mage::app()->getStore($this->getDefaultStoreId())->getBaseUrl();
28
  }
29
 
30
  public function getStoreName()
31
  {
32
+ return Mage::app()->getStore($this->getDefaultStoreId())->getFrontendName();
33
  }
34
 
35
  public function getStoreLogo()
36
  {
37
+ return Mage::app()->getStore($this->getDefaultStoreId())->getLogoSrc();
38
  }
39
 
40
  public function getStoreCurrency()
41
  {
42
+ return Mage::app()->getStore($this->getDefaultStoreId())->getCurrentCurrencyCode();
43
+ }
44
+
45
+ public function getPluginVersion()
46
+ {
47
+ return (string) Mage::getConfig()->getNode()->modules->Businessfactory_Roihuntereasy->version;
48
  }
49
 
50
  public function getStoreLanguage()
app/code/community/Businessfactory/Roihuntereasy/Model/Cron.php CHANGED
@@ -190,10 +190,18 @@ class Businessfactory_Roihuntereasy_Model_Cron extends Mage_Core_Model_Abstract
190
  $collection->addAttributeToFilter('visibility', $visibility);
191
  $collection->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED);
192
 
 
193
  $collection->addUrlRewrite();
 
 
 
 
 
194
 
195
  $collection->load();
196
 
 
 
197
  return $collection;
198
  }
199
 
@@ -228,8 +236,15 @@ class Businessfactory_Roihuntereasy_Model_Cron extends Mage_Core_Model_Abstract
228
  {
229
  $xmlWriter->writeElement('g:title', $_product->getName());
230
  $xmlWriter->writeElement('g:description', $this->get_description($_product));
231
- $xmlWriter->writeElement('g:link', $_product->getProductUrl());
232
- $xmlWriter->writeElement('g:brand', $_product->getAttributeText('manufacturer'));
 
 
 
 
 
 
 
233
 
234
  $xmlWriter->writeElement('g:condition', 'new');
235
  // TODO add more attributes if needed.
@@ -297,8 +312,17 @@ class Businessfactory_Roihuntereasy_Model_Cron extends Mage_Core_Model_Abstract
297
 
298
  $xmlWriter->writeElement('g:price', $_product->getPrice());
299
  $xmlWriter->writeElement('g:sale_price', $_product->getSpecialPrice());
300
- $xmlWriter->writeElement('g:size', $_product->getAttributeText('size'));
301
- $xmlWriter->writeElement('g:color', $_product->getAttributeText('color'));
 
 
 
 
 
 
 
 
 
302
  $xmlWriter->writeElement('g:availability', $this->do_isinstock($_product));
303
  }
304
 
190
  $collection->addAttributeToFilter('visibility', $visibility);
191
  $collection->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED);
192
 
193
+ // setting correct Product URL
194
  $collection->addUrlRewrite();
195
+ $storeId = Mage::app()
196
+ ->getDefaultGroup()
197
+ ->getDefaultStoreId();
198
+ $collection->setStoreId($storeId);
199
+ Mage::app()->setCurrentStore($storeId);
200
 
201
  $collection->load();
202
 
203
+ Mage::log("Default store ID: " . $storeId, null, 'cron.log');
204
+
205
  return $collection;
206
  }
207
 
236
  {
237
  $xmlWriter->writeElement('g:title', $_product->getName());
238
  $xmlWriter->writeElement('g:description', $this->get_description($_product));
239
+ // Product URL
240
+ // $_product->getData('request_path') can return product handle like - aviator-sunglasses.html
241
+ $xmlWriter->writeElement('g:link', $_product->getUrlInStore());
242
+
243
+ // replaced getAttributeText with safer option
244
+ $attributeCode = 'manufacturer';
245
+ if ($_product->getData($attributeCode) !== null){
246
+ $xmlWriter->writeElement('g:brand', $_product->getAttributeText($attributeCode));
247
+ }
248
 
249
  $xmlWriter->writeElement('g:condition', 'new');
250
  // TODO add more attributes if needed.
312
 
313
  $xmlWriter->writeElement('g:price', $_product->getPrice());
314
  $xmlWriter->writeElement('g:sale_price', $_product->getSpecialPrice());
315
+ // replaced getAttributeText with safer option
316
+ $attributeCode = 'color';
317
+ if ($_product->getData($attributeCode) !== null){
318
+ $xmlWriter->writeElement('g:color', $_product->getAttributeText($attributeCode));
319
+ }
320
+ // replaced getAttributeText with safer option
321
+ $attributeCode = 'size';
322
+ if ($_product->getData($attributeCode) !== null){
323
+ $xmlWriter->writeElement('g:size', $_product->getAttributeText($attributeCode));
324
+ }
325
+
326
  $xmlWriter->writeElement('g:availability', $this->do_isinstock($_product));
327
  }
328
 
app/code/community/Businessfactory/Roihuntereasy/controllers/StoredetailsController.php CHANGED
@@ -28,7 +28,7 @@ class Businessfactory_Roihuntereasy_StoredetailsController extends Mage_Core_Con
28
  }
29
 
30
  /**
31
- * http://store.com/roihuntereasy/storedetails/check
32
  */
33
  public function debugAction()
34
  {
@@ -74,7 +74,7 @@ class Businessfactory_Roihuntereasy_StoredetailsController extends Mage_Core_Con
74
 
75
  $resultData = $_SERVER;
76
  $resultData['Magento_Mode'] = Mage::getIsDeveloperMode() ? "developer" : "production";;
77
- $resultData['Php_Version'] = phpversion();
78
  $resultData['Magento_Version'] = Mage::getVersion();
79
  $resultData['ROI_Hunter_Easy_Version'] = (string) Mage::getConfig()->getNode()->modules->Businessfactory_Roihuntereasy->version;
80
 
28
  }
29
 
30
  /**
31
+ * http://store.com/roihuntereasy/storedetails/debug
32
  */
33
  public function debugAction()
34
  {
74
 
75
  $resultData = $_SERVER;
76
  $resultData['Magento_Mode'] = Mage::getIsDeveloperMode() ? "developer" : "production";;
77
+ $resultData['PHP_Version'] = phpversion();
78
  $resultData['Magento_Version'] = Mage::getVersion();
79
  $resultData['ROI_Hunter_Easy_Version'] = (string) Mage::getConfig()->getNode()->modules->Businessfactory_Roihuntereasy->version;
80
 
app/code/community/Businessfactory/Roihuntereasy/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Businessfactory_Roihuntereasy>
5
- <version>1.0.5</version>
6
  </Businessfactory_Roihuntereasy>
7
  </modules>
8
  <admin>
2
  <config>
3
  <modules>
4
  <Businessfactory_Roihuntereasy>
5
+ <version>1.0.8</version>
6
  </Businessfactory_Roihuntereasy>
7
  </modules>
8
  <admin>
app/design/adminhtml/default/default/template/businessfactory_roihuntereasy/admin.phtml CHANGED
@@ -15,7 +15,8 @@
15
  var errors = "<?php echo($this->getMainItemEntry() ? $this->getMainItemEntry()->getErrors() : null); ?>";
16
  var creationState = "<?php echo($this->getMainItemEntry() ? $this->getMainItemEntry()->getCreationState() : null); ?>";
17
  var magentoMode = "<?php echo $this->getDevelopmentMode(); ?>";
18
-
 
19
  console.log("mode: " + magentoMode);
20
  console.log("baseUrl: " + storeUrl);
21
 
@@ -28,7 +29,8 @@
28
  "storeCurrency": storeCurrency,
29
  "storeLanguage": storeLanguage,
30
  "storeCountry": storeCountry,
31
- "magentoMode": magentoMode,
 
32
 
33
  // Database part
34
  "customerId": customerId,
15
  var errors = "<?php echo($this->getMainItemEntry() ? $this->getMainItemEntry()->getErrors() : null); ?>";
16
  var creationState = "<?php echo($this->getMainItemEntry() ? $this->getMainItemEntry()->getCreationState() : null); ?>";
17
  var magentoMode = "<?php echo $this->getDevelopmentMode(); ?>";
18
+ var pluginVersion = "magento_" + "<?php echo $this->getPluginVersion(); ?>";
19
+
20
  console.log("mode: " + magentoMode);
21
  console.log("baseUrl: " + storeUrl);
22
 
29
  "storeCurrency": storeCurrency,
30
  "storeLanguage": storeLanguage,
31
  "storeCountry": storeCountry,
32
+ "storeMode": magentoMode,
33
+ "pluginVersion": pluginVersion,
34
 
35
  // Database part
36
  "customerId": customerId,
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>roihunter_easy</name>
4
- <version>1.0.5</version>
5
  <stability>stable</stability>
6
  <license>AFL 3.0</license>
7
  <channel>community</channel>
@@ -40,11 +40,11 @@ Extension update: 0.00 &amp;#x20AC;&amp;#xD;&#xD;
40
  No support fee&amp;#xD;&#xD;
41
  No contract duration&amp;#xD;&#xD;
42
  * Extension do not cover your Google Adwords Ad Spend. </description>
43
- <notes>Created 15th March, 2017 Compatibility: 1.9.2.4 - BaseUrl with store code</notes>
44
  <authors><author><name>ROI Hunter</name><user>MAG003490427</user><email>petr.skornok@b.cz</email></author></authors>
45
- <date>2017-03-16</date>
46
- <time>14:11:46</time>
47
- <contents><target name="magecommunity"><dir name="Businessfactory"><dir name="Roihuntereasy"><dir name="Block"><file name="AddedToCartAnalytics.php" hash="eeb701f487b06ed82e0754aefb192fab"/><dir name="Adminhtml"><file name="Admin.php" hash="2b33d562e7edb07d3a33a9f4d1652c9d"/><dir name="System"><dir name="Config"><file name="Cronbutton.php" hash="a07a6cfbd52a9a96fb4ec78cc8270924"/><file name="Resetbutton.php" hash="7721bb62feafe5d9d2951e70bfb0c30e"/></dir></dir></dir><file name="CategoryViewAnalytics.php" hash="8a47d9b4b0ad88c2e3fc1aa38258c465"/><file name="CheckoutAnalytics.php" hash="831094424cf896e6644d66b0c70c3688"/><file name="Database.php" hash="4333ce4f66b762097cb50b4f04a7a4d2"/><file name="ProductViewAnalytics.php" hash="033e6702927d92ae5f2d388f00b46bd5"/></dir><dir name="Helper"><file name="Data.php" hash="05ee8de6f74805d4a2b4643b0b0fe33a"/></dir><dir name="Model"><file name="AddedToCartObserver.php" hash="4e6d394f8f0902904e357f441aca6289"/><file name="CheckoutObserver.php" hash="2468bfbdf1083205a0e3aba14d2b7510"/><file name="Cron.php" hash="d1e3bb04cbf1f9dd0cce907dbd724dc3"/><file name="Main.php" hash="06766b59391b52aaa701d8bf01e80d1a"/><file name="Options.php" hash="f6ecd5ab10cfcc5e0948b236bb873932"/><dir name="Resource"><dir name="Main"><file name="Collection.php" hash="9b66b73b312ac16e270c1435a789fdb9"/></dir><file name="Main.php" hash="1432c450ff554fb5057d1d6c4fd26c3c"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="RoihuntereasyController.php" hash="687380dafaffd792a281e2bfd653d027"/></dir><file name="CronController.php" hash="f160c324b60ce92b249731bb97aa1e75"/><file name="FeedController.php" hash="e185b7550c6ef091b5fbcf51f315dc5a"/><file name="IndexController.php" hash="33c2a22770591cbeb7fb394d3654d904"/><file name="ResetController.php" hash="1a6c578829957c0a2ec2a4085ed5a089"/><file name="RoihuntereasyController.php" hash="b2b37f613badb75be2198e6643ef8d85"/><file name="StoredetailsController.php" hash="c3373d35eb7113dc6191e1ad2438b145"/></dir><dir name="etc"><file name="adminhtml.xml" hash="bbab6af370448895030570a657469a15"/><file name="config.xml" hash="19c9d6c837551ad3886229f61a85ba07"/><file name="system.xml" hash="718ea25db00b6a500b8783f9c8e1ba5c"/></dir><dir name="sql"><dir name="businessfactory_roihuntereasy_setup"><file name="install-1.0.0.php" hash="f490ddfd229eb5680e68fb7ec55a5820"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="businessfactory_roihuntereasy.xml" hash="fa2e345d2461459e15c641731d1b114a"/></dir><dir name="template"><dir name="businessfactory_roihuntereasy"><file name="admin.phtml" hash="85afee6d3f1d3c1eb46e644ce1eba324"/><dir name="system"><dir name="config"><file name="cronbutton.phtml" hash="758b97b5da81c92aaeb175e4b0142288"/><file name="resetbutton.phtml" hash="7aedce71c5d21bfce1a08c77e603143d"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="businessfactory_roihuntereasy.xml" hash="e1379f4d0a022d6740d0a6d96fd9fbed"/></dir><dir name="template"><dir name="businessfactory_roihuntereasy"><file name="added_to_cart_view_analytics.phtml" hash="8679d7940136d046ce46d2bc9aa2b522"/><file name="category_view_analytics.phtml" hash="420fe9c183c444e655250efa0b037da4"/><file name="checkout_analytics.phtml" hash="f06507f3867d78e0e6f1791fc210797d"/><file name="index.phtml" hash="a69cff3727b7bba2be7154b94b86ff08"/><file name="product_view_analytics.phtml" hash="a9ce50a31d64edcc70b2bbabd2ebf227"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Businessfactory_Roihuntereasy.xml" hash="d46e92b8a1b158bfdc47b9daa3274a3d"/></dir></target></contents>
48
  <compatible/>
49
  <dependencies><required><php><min>5.5.0</min><max>7.0.0</max></php></required></dependencies>
50
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>roihunter_easy</name>
4
+ <version>1.0.8</version>
5
  <stability>stable</stability>
6
  <license>AFL 3.0</license>
7
  <channel>community</channel>
40
  No support fee&amp;#xD;&#xD;
41
  No contract duration&amp;#xD;&#xD;
42
  * Extension do not cover your Google Adwords Ad Spend. </description>
43
+ <notes>Created 3rd April, 2017 Compatibility: 1.9.2.4 - Set storeID i Product feed</notes>
44
  <authors><author><name>ROI Hunter</name><user>MAG003490427</user><email>petr.skornok@b.cz</email></author></authors>
45
+ <date>2017-04-03</date>
46
+ <time>08:52:53</time>
47
+ <contents><target name="magecommunity"><dir name="Businessfactory"><dir name="Roihuntereasy"><dir name="Block"><file name="AddedToCartAnalytics.php" hash="eeb701f487b06ed82e0754aefb192fab"/><dir name="Adminhtml"><file name="Admin.php" hash="091758eba688f453d63463953c114faf"/><dir name="System"><dir name="Config"><file name="Cronbutton.php" hash="a07a6cfbd52a9a96fb4ec78cc8270924"/><file name="Resetbutton.php" hash="7721bb62feafe5d9d2951e70bfb0c30e"/></dir></dir></dir><file name="CategoryViewAnalytics.php" hash="8a47d9b4b0ad88c2e3fc1aa38258c465"/><file name="CheckoutAnalytics.php" hash="831094424cf896e6644d66b0c70c3688"/><file name="Database.php" hash="4333ce4f66b762097cb50b4f04a7a4d2"/><file name="ProductViewAnalytics.php" hash="033e6702927d92ae5f2d388f00b46bd5"/></dir><dir name="Helper"><file name="Data.php" hash="05ee8de6f74805d4a2b4643b0b0fe33a"/></dir><dir name="Model"><file name="AddedToCartObserver.php" hash="4e6d394f8f0902904e357f441aca6289"/><file name="CheckoutObserver.php" hash="2468bfbdf1083205a0e3aba14d2b7510"/><file name="Cron.php" hash="0235e608b6c7786655761dd1e449a923"/><file name="Main.php" hash="06766b59391b52aaa701d8bf01e80d1a"/><file name="Options.php" hash="f6ecd5ab10cfcc5e0948b236bb873932"/><dir name="Resource"><dir name="Main"><file name="Collection.php" hash="9b66b73b312ac16e270c1435a789fdb9"/></dir><file name="Main.php" hash="1432c450ff554fb5057d1d6c4fd26c3c"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="RoihuntereasyController.php" hash="687380dafaffd792a281e2bfd653d027"/></dir><file name="CronController.php" hash="f160c324b60ce92b249731bb97aa1e75"/><file name="FeedController.php" hash="e185b7550c6ef091b5fbcf51f315dc5a"/><file name="IndexController.php" hash="33c2a22770591cbeb7fb394d3654d904"/><file name="ResetController.php" hash="1a6c578829957c0a2ec2a4085ed5a089"/><file name="RoihuntereasyController.php" hash="b2b37f613badb75be2198e6643ef8d85"/><file name="StoredetailsController.php" hash="9b1173503bec12f154dc7566c50227ce"/></dir><dir name="etc"><file name="adminhtml.xml" hash="bbab6af370448895030570a657469a15"/><file name="config.xml" hash="388e7f336c81f251b2984988b3c986ce"/><file name="system.xml" hash="718ea25db00b6a500b8783f9c8e1ba5c"/></dir><dir name="sql"><dir name="businessfactory_roihuntereasy_setup"><file name="install-1.0.0.php" hash="f490ddfd229eb5680e68fb7ec55a5820"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="businessfactory_roihuntereasy.xml" hash="fa2e345d2461459e15c641731d1b114a"/></dir><dir name="template"><dir name="businessfactory_roihuntereasy"><file name="admin.phtml" hash="75f444e06a86afe1b111f9f8c5fb6904"/><dir name="system"><dir name="config"><file name="cronbutton.phtml" hash="758b97b5da81c92aaeb175e4b0142288"/><file name="resetbutton.phtml" hash="7aedce71c5d21bfce1a08c77e603143d"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="businessfactory_roihuntereasy.xml" hash="e1379f4d0a022d6740d0a6d96fd9fbed"/></dir><dir name="template"><dir name="businessfactory_roihuntereasy"><file name="added_to_cart_view_analytics.phtml" hash="8679d7940136d046ce46d2bc9aa2b522"/><file name="category_view_analytics.phtml" hash="420fe9c183c444e655250efa0b037da4"/><file name="checkout_analytics.phtml" hash="f06507f3867d78e0e6f1791fc210797d"/><file name="index.phtml" hash="a69cff3727b7bba2be7154b94b86ff08"/><file name="product_view_analytics.phtml" hash="a9ce50a31d64edcc70b2bbabd2ebf227"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Businessfactory_Roihuntereasy.xml" hash="d46e92b8a1b158bfdc47b9daa3274a3d"/></dir></target></contents>
48
  <compatible/>
49
  <dependencies><required><php><min>5.5.0</min><max>7.0.0</max></php></required></dependencies>
50
  </package>