Antidot_Antidot - Version 1.1.0

Version Notes

Fix facet with ampersand configuration for search engine > facets
Replace "-" with "&afs:feed" to separate feeds in url (compatibility with AFS 7.7)
Fix empty facet id sent when performing an empty query to afs to get facets list
Add description node for variants
Add cdata for variant name
Prevent to export empty categories node
Add cdata for variant name
Add variant details for grouped products

Download this release

Release Info

Developer Antidot
Extension Antidot_Antidot
Version 1.1.0
Comparing to
See all releases


Code changes from version 1.0.19 to 1.1.0

Files changed (113) hide show
  1. app/code/community/MDN/Antidot/Block/Catalog/Layer/Filter/Attribute.php +2 -2
  2. app/code/community/MDN/Antidot/Block/Catalog/Layer/Filter/Boolean.php +2 -2
  3. app/code/community/MDN/Antidot/Block/Catalog/Layer/Filter/Category.php +2 -2
  4. app/code/community/MDN/Antidot/Block/Catalog/Layer/Filter/Decimal.php +2 -2
  5. app/code/community/MDN/Antidot/Block/Catalog/Layer/Filter/Price.php +2 -2
  6. app/code/community/MDN/Antidot/Block/Catalog/Layer/View.php +2 -2
  7. app/code/community/MDN/Antidot/Block/Catalogsearch/Category.php +2 -2
  8. app/code/community/MDN/Antidot/Block/Catalogsearch/Layer.php +2 -2
  9. app/code/community/MDN/Antidot/Block/Catalogsearch/Layer/Filter/Attribute.php +2 -2
  10. app/code/community/MDN/Antidot/Block/Catalogsearch/Result.php +2 -2
  11. app/code/community/MDN/Antidot/Block/Html/Select.php +2 -2
  12. app/code/community/MDN/Antidot/Block/System/Config/Button/AfsStore.php +54 -0
  13. app/code/community/MDN/Antidot/Block/System/Config/Button/PushArticles.php +2 -2
  14. app/code/community/MDN/Antidot/Block/System/Config/Button/PushBrands.php +0 -36
  15. app/code/community/MDN/Antidot/Block/System/Config/Button/PushCategories.php +2 -2
  16. app/code/community/MDN/Antidot/Block/System/Config/Button/PushProducts.php +2 -2
  17. app/code/community/MDN/Antidot/Block/System/Config/Button/RestoreTemplate.php +2 -2
  18. app/code/community/MDN/Antidot/Block/System/Config/Button/ShowXml.php +2 -2
  19. app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/Additional.php +2 -2
  20. app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/ArticleAdditional.php +2 -2
  21. app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/ArticleIdentifier.php +2 -2
  22. app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/DefaultSort.php +2 -2
  23. app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/Facet.php +2 -2
  24. app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/Identifier.php +2 -2
  25. app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/ProductAdditionalFacet.php +2 -2
  26. app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/ProductAdditionalField.php +2 -2
  27. app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/ProductIdentifier.php +2 -2
  28. app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/Sort.php +2 -2
  29. app/code/community/MDN/Antidot/Block/System/Config/Form/Field/CategoryAttribute.php +2 -2
  30. app/code/community/MDN/Antidot/Block/System/Config/Form/Field/ProductAttribute.php +2 -2
  31. app/code/community/MDN/Antidot/Block/System/Config/Html/Export.php +2 -2
  32. app/code/community/MDN/Antidot/Block/System/Config/Html/ShowXml.php +2 -2
  33. app/code/community/MDN/Antidot/Block/System/Config/Html/Version.php +2 -2
  34. app/code/community/MDN/Antidot/Helper/Antidot.php +2 -2
  35. app/code/community/MDN/Antidot/Helper/CatalogSearch/Data.php +2 -2
  36. app/code/community/MDN/Antidot/Helper/Compress.php +2 -2
  37. app/code/community/MDN/Antidot/Helper/Data.php +4 -4
  38. app/code/community/MDN/Antidot/Helper/LogExport.php +2 -2
  39. app/code/community/MDN/Antidot/Helper/Url.php +2 -2
  40. app/code/community/MDN/Antidot/Helper/XmlWriter.php +3 -3
  41. app/code/community/MDN/Antidot/Model/Catalog/Layer.php +2 -2
  42. app/code/community/MDN/Antidot/Model/Catalog/Layer/Filter/Attribute.php +2 -2
  43. app/code/community/MDN/Antidot/Model/Catalog/Layer/Filter/Boolean.php +2 -2
  44. app/code/community/MDN/Antidot/Model/Catalog/Layer/Filter/Category.php +2 -2
  45. app/code/community/MDN/Antidot/Model/Catalog/Layer/Filter/Decimal.php +2 -2
  46. app/code/community/MDN/Antidot/Model/Catalog/Layer/Filter/Item.php +28 -11
  47. app/code/community/MDN/Antidot/Model/Catalog/Layer/Filter/Price.php +2 -2
  48. app/code/community/MDN/Antidot/Model/Catalogsearch/Layer.php +2 -2
  49. app/code/community/MDN/Antidot/Model/Catalogsearch/Layer/Filter/Attribute.php +2 -2
  50. app/code/community/MDN/Antidot/Model/Catalogsearch/Resource/Attribute.php +2 -2
  51. app/code/community/MDN/Antidot/Model/Export/Abstract.php +26 -2
  52. app/code/community/MDN/Antidot/Model/Export/Article.php +4 -18
  53. app/code/community/MDN/Antidot/Model/Export/Brand.php +0 -130
  54. app/code/community/MDN/Antidot/Model/Export/Category.php +19 -11
  55. app/code/community/MDN/Antidot/Model/Export/Product.php +109 -72
  56. app/code/community/MDN/Antidot/Model/Observer.php +165 -38
  57. app/code/community/MDN/Antidot/Model/Resource/Advanced.php +2 -2
  58. app/code/community/MDN/Antidot/Model/Resource/Catalog/Product/Collection.php +2 -2
  59. app/code/community/MDN/Antidot/Model/Resource/Engine/Abstract.php +2 -2
  60. app/code/community/MDN/Antidot/Model/Resource/Engine/Antidot.php +24 -5
  61. app/code/community/MDN/Antidot/Model/Search/Abstract.php +6 -5
  62. app/code/community/MDN/Antidot/Model/Search/Search.php +2 -2
  63. app/code/community/MDN/Antidot/Model/Search/Suggest.php +2 -2
  64. app/code/community/MDN/Antidot/Model/System/Config/ArticleAttribute.php +2 -2
  65. app/code/community/MDN/Antidot/Model/System/Config/Backend/Engine.php +2 -2
  66. app/code/community/MDN/Antidot/Model/System/Config/CategoryAttribute.php +2 -2
  67. app/code/community/MDN/Antidot/Model/System/Config/Dir.php +2 -2
  68. app/code/community/MDN/Antidot/Model/System/Config/DisableEnable.php +2 -2
  69. app/code/community/MDN/Antidot/Model/System/Config/Engine.php +2 -2
  70. app/code/community/MDN/Antidot/Model/System/Config/Facet.php +2 -2
  71. app/code/community/MDN/Antidot/Model/System/Config/Number.php +2 -2
  72. app/code/community/MDN/Antidot/Model/System/Config/Options.php +2 -2
  73. app/code/community/MDN/Antidot/Model/System/Config/ProductAttribute.php +2 -2
  74. app/code/community/MDN/Antidot/Model/System/Config/PromoteRedirect.php +2 -2
  75. app/code/community/MDN/Antidot/Model/System/Config/Sort.php +18 -13
  76. app/code/community/MDN/Antidot/Model/System/Config/Suggest/Type.php +2 -2
  77. app/code/community/MDN/Antidot/Model/System/Config/WSStatus.php +2 -2
  78. app/code/community/MDN/Antidot/Model/Transport.php +2 -2
  79. app/code/community/MDN/Antidot/Model/Transport/Abstract.php +2 -2
  80. app/code/community/MDN/Antidot/Model/Transport/File.php +2 -2
  81. app/code/community/MDN/Antidot/Model/Transport/Ftp.php +2 -2
  82. app/code/community/MDN/Antidot/Model/Transport/Http.php +2 -2
  83. app/code/community/MDN/Antidot/Model/Transport/Interface.php +2 -2
  84. app/code/community/MDN/Antidot/Test/Block/System/Config/Button/AfsStore.php +90 -0
  85. app/code/community/MDN/Antidot/Test/Model/Export/Article.php +23 -0
  86. app/code/community/MDN/Antidot/Test/Model/Export/Category.php +46 -0
  87. app/code/community/MDN/Antidot/Test/Model/Export/Product.php +543 -0
  88. app/code/community/MDN/Antidot/Test/Model/Export/Product/fixtures/testWriteImageUrl.yaml +90 -0
  89. app/code/community/MDN/Antidot/Test/Model/Export/Product/fixtures/testWriteProductUrl.yaml +90 -0
  90. app/code/community/MDN/Antidot/Test/Model/Export/Product/fixtures/testWriteProperties.yaml +80 -0
  91. app/code/community/MDN/Antidot/Test/Model/Export/Product/fixtures/testWriteXml.yaml +116 -0
  92. app/code/community/MDN/Antidot/Test/Model/Export/Product/providers/testWriteImageUrl.yaml +9 -0
  93. app/code/community/MDN/Antidot/Test/Model/Export/Product/providers/testWriteProductUrl.yaml +9 -0
  94. app/code/community/MDN/Antidot/Test/Model/Observer.php +144 -0
  95. app/code/community/MDN/Antidot/Test/Model/Observer/fixtures/testGetDefaultContext.yaml +85 -0
  96. app/code/community/MDN/Antidot/Test/Model/Observer/providers/testGetOwnerForFilename.yaml +9 -0
  97. app/code/community/MDN/Antidot/Test/Model/Resource/Engine/Antidot.php +42 -0
  98. app/code/community/MDN/Antidot/Test/Model/System/Config/Sort.php +68 -0
  99. app/code/community/MDN/Antidot/Test/Model/System/Config/Sort/expectations/testToOptionArray.yaml +44 -0
  100. app/code/community/MDN/Antidot/Test/Model/System/Config/Sort/fixtures/testToOptionArray1.yaml +4 -0
  101. app/code/community/MDN/Antidot/Test/Model/System/Config/Sort/fixtures/testToOptionArray2.yaml +4 -0
  102. app/code/community/MDN/Antidot/Test/Model/System/Config/Sort/fixtures/testToOptionArray3.yaml +4 -0
  103. app/code/community/MDN/Antidot/Test/PHPUnitUtil.php +18 -0
  104. app/code/community/MDN/Antidot/controllers/Admin/PushController.php +33 -9
  105. app/code/community/MDN/Antidot/controllers/Front/SearchController.php +2 -2
  106. app/code/community/MDN/Antidot/etc/config.xml +76 -31
  107. app/code/community/MDN/Antidot/etc/system.xml +13 -6
  108. i18n/i18n.php +13 -0
  109. package.xml +4 -4
  110. shell/antidotExport.php +15 -2
  111. shell/antidotExportCategory.php +14 -1
  112. shell/antidotExportInc.php +14 -1
  113. shell/antidotExportProduct.php +14 -1
app/code/community/MDN/Antidot/Block/Catalog/Layer/Filter/Attribute.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalog_Layer_Filter_Attribute extends Mage_Catalog_Block_Layer_Filter_Abstract
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalog_Layer_Filter_Attribute extends Mage_Catalog_Block_Layer_Filter_Abstract
app/code/community/MDN/Antidot/Block/Catalog/Layer/Filter/Boolean.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalog_Layer_Filter_Boolean extends MDN_Antidot_Block_Catalog_Layer_Filter_Attribute
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalog_Layer_Filter_Boolean extends MDN_Antidot_Block_Catalog_Layer_Filter_Attribute
app/code/community/MDN/Antidot/Block/Catalog/Layer/Filter/Category.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalog_Layer_Filter_Category extends Mage_Catalog_Block_Layer_Filter_Abstract
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalog_Layer_Filter_Category extends Mage_Catalog_Block_Layer_Filter_Abstract
app/code/community/MDN/Antidot/Block/Catalog/Layer/Filter/Decimal.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalog_Layer_Filter_Decimal extends Mage_Catalog_Block_Layer_Filter_Abstract
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalog_Layer_Filter_Decimal extends Mage_Catalog_Block_Layer_Filter_Abstract
app/code/community/MDN/Antidot/Block/Catalog/Layer/Filter/Price.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalog_Layer_Filter_Price extends Mage_Catalog_Block_Layer_Filter_Abstract
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalog_Layer_Filter_Price extends Mage_Catalog_Block_Layer_Filter_Abstract
app/code/community/MDN/Antidot/Block/Catalog/Layer/View.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalog_Layer_View extends Mage_Catalog_Block_Layer_View
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalog_Layer_View extends Mage_Catalog_Block_Layer_View
app/code/community/MDN/Antidot/Block/Catalogsearch/Category.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalogsearch_Category extends Mage_Core_Block_Template
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalogsearch_Category extends Mage_Core_Block_Template
app/code/community/MDN/Antidot/Block/Catalogsearch/Layer.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalogsearch_Layer extends Mage_CatalogSearch_Block_Layer
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalogsearch_Layer extends Mage_CatalogSearch_Block_Layer
app/code/community/MDN/Antidot/Block/Catalogsearch/Layer/Filter/Attribute.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalogsearch_Layer_Filter_Attribute extends Mage_Catalog_Block_Layer_Filter_Abstract
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Catalogsearch_Layer_Filter_Attribute extends Mage_Catalog_Block_Layer_Filter_Abstract
app/code/community/MDN/Antidot/Block/Catalogsearch/Result.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_CatalogSearch_Result extends Mage_CatalogSearch_Block_Result
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_CatalogSearch_Result extends Mage_CatalogSearch_Block_Result
app/code/community/MDN/Antidot/Block/Html/Select.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Html_Select extends Mage_Core_Block_Html_Select
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_Html_Select extends Mage_Core_Block_Html_Select
app/code/community/MDN/Antidot/Block/System/Config/Button/AfsStore.php ADDED
@@ -0,0 +1,54 @@
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
+ */
16
+ class MDN_Antidot_Block_System_Config_Button_AfsStore extends Mage_Adminhtml_Block_System_Config_Form_Field
17
+ {
18
+
19
+ /*
20
+ * The AfsStore Back-Office can be translated in theses locales
21
+ */
22
+ protected $afsStoreLocales = array('en', 'fr');
23
+
24
+ /**
25
+ * {@inherit}
26
+ */
27
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
28
+ {
29
+ $this->setElement($element);
30
+ $url = 'https://bo-store.afs-antidot.net/';
31
+
32
+ /*
33
+ * we get the magento back-office session language to determine
34
+ * the locale of the AfsStore Back-office link
35
+ */
36
+ $locale = Mage::getSingleton('adminhtml/session')->getLocale();
37
+ $locArr = explode('_',$locale);
38
+ $urlLocale = array_shift($locArr);
39
+ if (in_array($urlLocale, $this->afsStoreLocales)) {
40
+ $url .= $urlLocale;
41
+ } else {
42
+ $url .= 'en';
43
+ }
44
+
45
+ $html = $this->getLayout()->createBlock('adminhtml/widget_button')
46
+ ->setType('button')
47
+ ->setClass('scalable')
48
+ ->setLabel(Mage::helper('Antidot')->__('Analytics, Synonyms, Promote'))
49
+ ->setOnClick("window.open('$url')")
50
+ ->toHtml();
51
+
52
+ return $html;
53
+ }
54
+ }
app/code/community/MDN/Antidot/Block/System/Config/Button/PushArticles.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Button_PushArticles extends Mage_Adminhtml_Block_System_Config_Form_Field
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Button_PushArticles extends Mage_Adminhtml_Block_System_Config_Form_Field
app/code/community/MDN/Antidot/Block/System/Config/Button/PushBrands.php DELETED
@@ -1,36 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Magento
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Open Software License (OSL 3.0)
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- *
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
- */
16
- class MDN_Antidot_Block_System_Config_Button_PushBrands extends Mage_Adminhtml_Block_System_Config_Form_Field
17
- {
18
-
19
- /**
20
- * {@inherit}
21
- */
22
- protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
23
- {
24
- $this->setElement($element);
25
- $url = $this->getUrl('Antidotadmin/Admin_Push/Brand');
26
-
27
- $html = $this->getLayout()->createBlock('adminhtml/widget_button')
28
- ->setType('button')
29
- ->setClass('scalable')
30
- ->setLabel(Mage::helper('Antidot')->__('Push'))
31
- ->setOnClick("setLocation('$url')")
32
- ->toHtml();
33
-
34
- return $html;
35
- }
36
- }
app/code/community/MDN/Antidot/Block/System/Config/Button/PushCategories.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Button_PushCategories extends Mage_Adminhtml_Block_System_Config_Form_Field
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Button_PushCategories extends Mage_Adminhtml_Block_System_Config_Form_Field
app/code/community/MDN/Antidot/Block/System/Config/Button/PushProducts.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Button_PushProducts extends Mage_Adminhtml_Block_System_Config_Form_Field
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Button_PushProducts extends Mage_Adminhtml_Block_System_Config_Form_Field
app/code/community/MDN/Antidot/Block/System/Config/Button/RestoreTemplate.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Button_RestoreTemplate extends Mage_Adminhtml_Block_System_Config_Form_Field
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Button_RestoreTemplate extends Mage_Adminhtml_Block_System_Config_Form_Field
app/code/community/MDN/Antidot/Block/System/Config/Button/ShowXml.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Button_ShowXml extends Mage_Adminhtml_Block_System_Config_Form_Field
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Button_ShowXml extends Mage_Adminhtml_Block_System_Config_Form_Field
app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/Additional.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_Additional extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_Additional extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/ArticleAdditional.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_ArticleAdditional extends MDN_Antidot_Block_System_Config_Form_Field_Array_Additional
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_ArticleAdditional extends MDN_Antidot_Block_System_Config_Form_Field_Array_Additional
app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/ArticleIdentifier.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_ArticleIdentifier extends MDN_Antidot_Block_System_Config_Form_Field_Array_Identifier
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_ArticleIdentifier extends MDN_Antidot_Block_System_Config_Form_Field_Array_Identifier
app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/DefaultSort.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_DefaultSort extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_DefaultSort extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/Facet.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_Facet extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_Facet extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/Identifier.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_Identifier extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_Identifier extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/ProductAdditionalFacet.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_ProductAdditionalFacet extends MDN_Antidot_Block_System_Config_Form_Field_Array_Additional
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_ProductAdditionalFacet extends MDN_Antidot_Block_System_Config_Form_Field_Array_Additional
app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/ProductAdditionalField.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_ProductAdditionalField extends MDN_Antidot_Block_System_Config_Form_Field_Array_Additional
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_ProductAdditionalField extends MDN_Antidot_Block_System_Config_Form_Field_Array_Additional
app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/ProductIdentifier.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_ProductIdentifier extends MDN_Antidot_Block_System_Config_Form_Field_Array_Identifier
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_ProductIdentifier extends MDN_Antidot_Block_System_Config_Form_Field_Array_Identifier
app/code/community/MDN/Antidot/Block/System/Config/Form/Field/Array/Sort.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_Sort extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_Array_Sort extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
app/code/community/MDN/Antidot/Block/System/Config/Form/Field/CategoryAttribute.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_CategoryAttribute extends Mage_Adminhtml_Block_System_Config_Form_Field
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_CategoryAttribute extends Mage_Adminhtml_Block_System_Config_Form_Field
app/code/community/MDN/Antidot/Block/System/Config/Form/Field/ProductAttribute.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_ProductAttribute extends Mage_Adminhtml_Block_System_Config_Form_Field
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Form_Field_ProductAttribute extends Mage_Adminhtml_Block_System_Config_Form_Field
app/code/community/MDN/Antidot/Block/System/Config/Html/Export.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Html_Export extends Mage_Adminhtml_Block_System_Config_Form_Field
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Html_Export extends Mage_Adminhtml_Block_System_Config_Form_Field
app/code/community/MDN/Antidot/Block/System/Config/Html/ShowXml.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Html_ShowXml extends Mage_Adminhtml_Block_System_Config_Form_Field
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Html_ShowXml extends Mage_Adminhtml_Block_System_Config_Form_Field
app/code/community/MDN/Antidot/Block/System/Config/Html/Version.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Html_Version extends Mage_Adminhtml_Block_System_Config_Form_Field
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Block_System_Config_Html_Version extends Mage_Adminhtml_Block_System_Config_Form_Field
app/code/community/MDN/Antidot/Helper/Antidot.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Helper_Antidot extends MDN_Antidot_Helper_Data
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Helper_Antidot extends MDN_Antidot_Helper_Data
app/code/community/MDN/Antidot/Helper/CatalogSearch/Data.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Helper_CatalogSearch_Data extends Mage_CatalogSearch_Helper_Data {
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Helper_CatalogSearch_Data extends Mage_CatalogSearch_Helper_Data {
app/code/community/MDN/Antidot/Helper/Compress.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Helper_Compress extends Mage_Core_Helper_Abstract {
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Helper_Compress extends Mage_Core_Helper_Abstract {
app/code/community/MDN/Antidot/Helper/Data.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Helper_Data extends Mage_Core_Helper_Abstract
@@ -223,9 +223,9 @@ class MDN_Antidot_Helper_Data extends Mage_Core_Helper_Abstract
223
* @param $number
224
* @return float|mixed
225
*/
226
- public function round($number)
227
{
228
- $number = round($number, 2);
229
$number = str_replace(',', '.', $number);
230
$number = str_replace(' ', '', $number);
231
return $number;
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Helper_Data extends Mage_Core_Helper_Abstract
223
* @param $number
224
* @return float|mixed
225
*/
226
+ public function round($number, $precision = 2)
227
{
228
+ $number = round($number, $precision);
229
$number = str_replace(',', '.', $number);
230
$number = str_replace(' ', '', $number);
231
return $number;
app/code/community/MDN/Antidot/Helper/LogExport.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Helper_LogExport extends Mage_Core_Helper_Abstract
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Helper_LogExport extends Mage_Core_Helper_Abstract
app/code/community/MDN/Antidot/Helper/Url.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Helper_Url extends Mage_Core_Helper_Abstract
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Helper_Url extends Mage_Core_Helper_Abstract
app/code/community/MDN/Antidot/Helper/XmlWriter.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Helper_XmlWriter extends Mage_Core_Helper_Abstract
@@ -207,4 +207,4 @@ class MDN_Antidot_Helper_XmlWriter extends Mage_Core_Helper_Abstract
207
208
return $return;
209
}
210
- }
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Helper_XmlWriter extends Mage_Core_Helper_Abstract
207
208
return $return;
209
}
210
+ }
app/code/community/MDN/Antidot/Model/Catalog/Layer.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalog_Layer extends Mage_Catalog_Model_Layer
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalog_Layer extends Mage_Catalog_Model_Layer
app/code/community/MDN/Antidot/Model/Catalog/Layer/Filter/Attribute.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalog_Layer_Filter_Attribute extends Mage_Catalog_Model_Layer_Filter_Attribute
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalog_Layer_Filter_Attribute extends Mage_Catalog_Model_Layer_Filter_Attribute
app/code/community/MDN/Antidot/Model/Catalog/Layer/Filter/Boolean.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalog_Layer_Filter_Boolean extends MDN_Antidot_Model_Catalog_Layer_Filter_Attribute
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalog_Layer_Filter_Boolean extends MDN_Antidot_Model_Catalog_Layer_Filter_Attribute
app/code/community/MDN/Antidot/Model/Catalog/Layer/Filter/Category.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalog_Layer_Filter_Category extends Mage_Catalog_Model_Layer_Filter_Category
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalog_Layer_Filter_Category extends Mage_Catalog_Model_Layer_Filter_Category
app/code/community/MDN/Antidot/Model/Catalog/Layer/Filter/Decimal.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalog_Layer_Filter_Decimal extends Mage_Catalog_Model_Layer_Filter_Decimal
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalog_Layer_Filter_Decimal extends Mage_Catalog_Model_Layer_Filter_Decimal
app/code/community/MDN/Antidot/Model/Catalog/Layer/Filter/Item.php CHANGED
@@ -56,23 +56,20 @@ class MDN_Antidot_Model_Catalog_Layer_Filter_Item extends Mage_Catalog_Model_Lay
56
*/
57
public function getUrl()
58
{
59
- $values = array();
60
- if($currentValues = Mage::getSingleton('core/app')->getRequest()->getParam($this->getFilter()->getRequestVar())) {
61
- $values = explode(',', $currentValues);
62
- }
63
-
64
if(false !== $key = array_search($this->getValue(), $values)) {
65
unset($values[$key]);
66
} else {
67
$values[] = $this->getValue();
68
}
69
70
- $values = count($values) > 1 ? implode(',', $values) : current($values);
71
$query = array(
72
$this->getFilter()->getRequestVar() => (empty($values) ? null : $values),
73
Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
74
);
75
-
76
return Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$query));
77
}
78
@@ -144,8 +141,28 @@ class MDN_Antidot_Model_Catalog_Layer_Filter_Item extends Mage_Catalog_Model_Lay
144
*/
145
public function isSelected()
146
{
147
- $selected = Mage::getSingleton('core/app')->getRequest()->getParam($this->getFilter()->getRequestVar());
148
-
149
- return in_array($this->getValue(), explode(',', $selected), true);
150
- }
151
}
56
*/
57
public function getUrl()
58
{
59
+ $values = $this->getCurrentSelectedValues($this->getFilter()->getRequestVar());
60
+
61
if(false !== $key = array_search($this->getValue(), $values)) {
62
unset($values[$key]);
63
} else {
64
$values[] = $this->getValue();
65
}
66
67
+ $values = count($values) > 1 ? implode(',', $values) : array_shift($values);
68
$query = array(
69
$this->getFilter()->getRequestVar() => (empty($values) ? null : $values),
70
Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
71
);
72
+
73
return Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$query));
74
}
75
141
*/
142
public function isSelected()
143
{
144
+
145
+ $selectedArray = $this->getCurrentSelectedValues($this->getFilter()->getRequestVar());
146
+
147
+ return in_array($this->getValue(), $selectedArray, true);
148
+ }
149
+
150
+ /**
151
+ * Return array of the selected values of
152
+ * the given filter
153
+ *
154
+ * @param string $filter
155
+ * @return array
156
+ */
157
+ public function getCurrentSelectedValues($filter) {
158
+
159
+ $selected = Mage::getSingleton('core/app')->getRequest()->getParam($filter);
160
+
161
+ if ($selected) {
162
+ $antidotEngine = Mage::getResourceSingleton('Antidot/engine_Antidot');
163
+ return $antidotEngine->extractMultiSelectValues($selected);
164
+ } else {
165
+ return array();
166
+ }
167
+ }
168
}
app/code/community/MDN/Antidot/Model/Catalog/Layer/Filter/Price.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalog_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Filter_Price
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalog_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Filter_Price
app/code/community/MDN/Antidot/Model/Catalogsearch/Layer.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalogsearch_Layer extends Mage_CatalogSearch_Model_Layer
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalogsearch_Layer extends Mage_CatalogSearch_Model_Layer
app/code/community/MDN/Antidot/Model/Catalogsearch/Layer/Filter/Attribute.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalogsearch_Layer_Filter_Attribute extends MDN_Antidot_Model_Catalog_Layer_Filter_Attribute
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalogsearch_Layer_Filter_Attribute extends MDN_Antidot_Model_Catalog_Layer_Filter_Attribute
app/code/community/MDN/Antidot/Model/Catalogsearch/Resource/Attribute.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalogsearch_Resource_Attribute
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Catalogsearch_Resource_Attribute
app/code/community/MDN/Antidot/Model/Export/Abstract.php CHANGED
@@ -9,8 +9,8 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Export_Abstract extends Mage_Core_Model_Abstract
@@ -136,4 +136,28 @@ class MDN_Antidot_Model_Export_Abstract extends Mage_Core_Model_Abstract
136
137
return $this->storeLang[$storeId];
138
}
139
}
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Export_Abstract extends Mage_Core_Model_Abstract
136
137
return $this->storeLang[$storeId];
138
}
139
+
140
+ /**
141
+ * Write the xml header
142
+ *
143
+ */
144
+ protected function writeHeader($context)
145
+ {
146
+ $this->xml->push('header');
147
+ $this->xml->element('owner', $context['owner']);
148
+ $this->xml->element('feed', $this->getFeed($context));
149
+ $this->xml->element('generated_at', date('c', Mage::getModel('core/date')->timestamp(time())));
150
+ $this->xml->pop();
151
+ }
152
+
153
+ /**
154
+ * Get the value to insert in the feed tag
155
+ * @param $type (product, category, article)
156
+ * @param $context
157
+ * @return string
158
+ */
159
+ public function getFeed($context) {
160
+ return strtolower($this::TYPE) . ' ' . $context['run'] . ' v' . Mage::getConfig()->getNode()->modules->MDN_Antidot->version;
161
+ }
162
+
163
}
app/code/community/MDN/Antidot/Model/Export/Article.php CHANGED
@@ -9,16 +9,16 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Export_Article extends MDN_Antidot_Model_Export_Product
17
{
18
19
const TYPE = 'ARTICLE';
20
- const FILENAME_XML = 'articles-mdn-fr.xml';
21
- const FILENAME_ZIP = '%s_full_mdn_articles.zip';
22
const XSD = 'http://ref.antidot.net/store/latest/articles.xsd';
23
24
const imagePrefix = 'media/catalog/article';
@@ -83,20 +83,6 @@ class MDN_Antidot_Model_Export_Article extends MDN_Antidot_Model_Export_Product
83
$this->writePart($this->xml->flush(), true);
84
}
85
86
- /**
87
- * Write the xml header
88
- *
89
- * @param array $context
90
- */
91
- protected function writeHeader($context)
92
- {
93
- $this->xml->push('header');
94
- $this->xml->element('owner', $context['owner']);
95
- $this->xml->element('feed', 'article');
96
- $this->xml->element('generated_at', date('c', Mage::getModel('core/date')->timestamp(time())));
97
- $this->xml->pop();
98
- }
99
-
100
/**
101
* Write the article identifiers
102
*
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Export_Article extends MDN_Antidot_Model_Export_Product
17
{
18
19
const TYPE = 'ARTICLE';
20
+ const FILENAME_XML = 'articles-%s-fr.xml';
21
+ const FILENAME_ZIP = '%s_full_%s_articles.zip';
22
const XSD = 'http://ref.antidot.net/store/latest/articles.xsd';
23
24
const imagePrefix = 'media/catalog/article';
83
$this->writePart($this->xml->flush(), true);
84
}
85
86
/**
87
* Write the article identifiers
88
*
app/code/community/MDN/Antidot/Model/Export/Brand.php DELETED
@@ -1,130 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Magento
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Open Software License (OSL 3.0)
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- *
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
- */
16
- class MDN_Antidot_Model_Export_Brand extends MDN_Antidot_Model_Export_Abstract
17
- {
18
- const TYPE = 'BRAND';
19
- const FILENAME_XML = 'brands-mdn-fr.xml';
20
- const FILENAME_ZIP = '%s_full_mdn_brands.zip';
21
- const XSD = 'http://ref.antidot.net/store/latest/brands.xsd';
22
-
23
- const PATTERN_URL = '/brands/{brand}';
24
-
25
- protected $urlHelper;
26
-
27
- /**
28
- * Get xml
29
- *
30
- * @param type $context
31
- */
32
- public function getXml($context)
33
- {
34
- $this->initXml();
35
- $this->initFields('brand');
36
-
37
- $brandPattern = $this->getBrandPattern();
38
-
39
- $this->xml->push('brands', array('xmlns' => "http://ref.antidot.net/store/afs#"));
40
-
41
- $this->xml->push('header');
42
- $this->xml->element('owner', $context['owner']);
43
- $this->xml->element('feed', 'brand');
44
- $this->xml->element('generated_at', date('c', Mage::getModel('core/date')->timestamp(time())));
45
- $this->xml->pop();
46
-
47
- foreach($context['store_id']as $storeId) {
48
- $store = Mage::getModel('core/store')->load($storeId);
49
- foreach($this->getBrands() as $brandId => $brand) {
50
- $this->xml->push('brand', array('id' => $brandId, 'xml:lang' => $context['lang']));
51
-
52
- $this->xml->element('name', $this->xml->encloseCData($brand));
53
- $this->xml->element('url', $this->getUrl($brand, $brandPattern));
54
-
55
- $this->xml->push('websites');
56
- $this->xml->element('website', '', array('id' => $storeId, 'name' => $store->getName()));
57
- $this->xml->pop();
58
-
59
- $this->xml->pop();
60
- }
61
- }
62
-
63
- $this->xml->pop();
64
-
65
- return $this->xml->getXml();
66
- }
67
-
68
- /**
69
- * Return categories
70
- *
71
- * @param int $rootCategoryId
72
- * @param array
73
- */
74
- protected function getBrands()
75
- {
76
- $attribute = Mage::getModel('eav/config')
77
- ->getAttribute('catalog_product', 'manufacturer');
78
-
79
- $brands = array();
80
- foreach($attribute->getSource()->getAllOptions(true, true) as $option) {
81
- if(!empty($option['value'])) {
82
- $brands[$option['value']] = $option['label'];
83
- }
84
- }
85
-
86
- return $brands;
87
- }
88
-
89
- /**
90
- * Return brand url
91
- *
92
- * @param string $brand
93
- * @return string
94
- */
95
- public function getUrl($brand, $brandPattern = null)
96
- {
97
- $brandPattern = $brandPattern === null ? $this->getBrandPattern() : $brandPattern;
98
-
99
- return preg_replace('/\{brand\}/', $this->getUrlHelper()->url($brand), $brandPattern);
100
- }
101
-
102
- /**
103
- * Get the brand pattern
104
- *
105
- * @return string
106
- */
107
- protected function getBrandPattern()
108
- {
109
- $brandPattern = Mage::getStoreConfig('antidot/general/brand');
110
- if(strpos($brandPattern, '{brand}') === false) {
111
- $brandPattern = self::PATTERN_URL;
112
- }
113
-
114
- return $brandPattern;
115
- }
116
-
117
- /**
118
- * Return url Helper
119
- *
120
- * @return Antidot/Url
121
- */
122
- protected function getUrlHelper()
123
- {
124
- if($this->urlHelper === null) {
125
- $this->urlHelper = Mage::helper('Antidot/Url');
126
- }
127
-
128
- return $this->urlHelper;
129
- }
130
- }
app/code/community/MDN/Antidot/Model/Export/Category.php CHANGED
@@ -9,15 +9,15 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Export_Category extends MDN_Antidot_Model_Export_Abstract
17
{
18
const TYPE = 'CATEGORY';
19
- const FILENAME_XML = 'categories-mdn_%s-%s.xml';
20
- const FILENAME_ZIP = '%s_full_mdn_categories.zip';
21
const XSD = 'http://ref.antidot.net/store/latest/categories.xsd';
22
23
/**
@@ -27,20 +27,28 @@ class MDN_Antidot_Model_Export_Category extends MDN_Antidot_Model_Export_Abstrac
27
*/
28
public function writeXml($context, $filename)
29
{
30
$this->initXml();
31
$this->initFields('category');
32
33
$this->xml->push('categories', array('xmlns' => "http://ref.antidot.net/store/afs#"));
34
35
- $this->xml->push('header');
36
- $this->xml->element('owner', $context['owner']);
37
- $this->xml->element('feed', 'category');
38
- $this->xml->element('generated_at', date('c', Mage::getModel('core/date')->timestamp(time())));
39
- $this->xml->pop();
40
41
$nbItems = 0;
42
foreach($context['stores'] as $store) {
43
- foreach($this->getCategories($store) as $cat) {
44
45
if (!$this->getField($cat, 'name'))
46
continue;
@@ -117,4 +125,4 @@ class MDN_Antidot_Model_Export_Category extends MDN_Antidot_Model_Export_Abstrac
117
->addFieldToFilter('path', array('like' => Mage::getModel('catalog/category')->load($store->getRootCategoryId())->getPath().'/%'))
118
;
119
}
120
- }
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Export_Category extends MDN_Antidot_Model_Export_Abstract
17
{
18
const TYPE = 'CATEGORY';
19
+ const FILENAME_XML = 'categories-%s_%s-%s.xml';
20
+ const FILENAME_ZIP = '%s_full_%s_categories.zip';
21
const XSD = 'http://ref.antidot.net/store/latest/categories.xsd';
22
23
/**
27
*/
28
public function writeXml($context, $filename)
29
{
30
+ $nbTotalCategories = 0;
31
+ $context['categories'] = array();
32
+ foreach($context['stores'] as $store) {
33
+ $categories = $this->getCategories($store);
34
+ $nbTotalCategories += $categories->getSize();
35
+ $context['categories'][$store->getId()] = $categories;
36
+ }
37
+
38
+ if ($nbTotalCategories == 0) {
39
+ return 0;
40
+ }
41
+
42
$this->initXml();
43
$this->initFields('category');
44
45
$this->xml->push('categories', array('xmlns' => "http://ref.antidot.net/store/afs#"));
46
47
+ $this->writeHeader($context);
48
49
$nbItems = 0;
50
foreach($context['stores'] as $store) {
51
+ foreach($context['categories'][$store->getId()] as $cat) {
52
53
if (!$this->getField($cat, 'name'))
54
continue;
125
->addFieldToFilter('path', array('like' => Mage::getModel('catalog/category')->load($store->getRootCategoryId())->getPath().'/%'))
126
;
127
}
128
+ }
app/code/community/MDN/Antidot/Model/Export/Product.php CHANGED
@@ -9,17 +9,17 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
17
{
18
19
const TYPE = 'CATALOG';
20
- const FILENAME_XML = 'catalog-mdn_%s-%s.xml';
21
- const FILENAME_ZIP = '%s_full_mdn_catalog.zip';
22
- const FILENAME_ZIP_INC = '%s_inc_mdn_catalog.zip';
23
const XSD = 'http://ref.antidot.net/store/latest/catalog.xsd';
24
25
/*
@@ -88,7 +88,7 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
88
->joinField('qty',
89
'cataloginventory/stock_item',
90
'qty',
91
- 'product_id = entity_id',
92
'{{table}}.stock_id = 1'.$productsInStock)
93
;
94
@@ -130,15 +130,20 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
130
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
131
132
foreach($collection as $product) {
133
-
134
- //if($context['langs'] > 1) {
135
- $store = current($this->getProductStores($product, $context)); //we take the "first" store of the current lang
136
- if ($store)
137
- $product = Mage::getModel('catalog/product')->setStoreId($store->getId())->load($product->getId());
138
- //}
139
- $this->writeProduct($product, $context);
140
-
141
- $product->clearInstance(); //memory flush
142
143
}
144
$this->writePart($this->xml->flush());
@@ -204,30 +209,16 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
204
}
205
}
206
}
207
-
208
- /**
209
- * Write the xml header
210
- *
211
- */
212
- protected function writeHeader($context)
213
- {
214
- $this->xml->push('header');
215
- $this->xml->element('owner', $context['owner']);
216
- $this->xml->element('feed', 'product');
217
- $this->xml->element('generated_at', date('c', Mage::getModel('core/date')->timestamp(time())));
218
- $this->xml->pop();
219
- }
220
-
221
/**
222
* Write the product
223
*
224
* @param Product $product
225
- * @param Array $context
226
*/
227
- protected function writeProduct($product, $context)
228
{
229
- $stores = $this->getProductStores($product, $context);
230
-
231
//skip product if no websites
232
if (count($stores) == 0)
233
return;
@@ -259,11 +250,7 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
259
if ($keywords = $this->getField($product, 'keywords')) {
260
$this->xml->element('keywords', $this->xml->encloseCData($keywords));
261
}
262
- $this->writeDescriptions($product);
263
- $this->xml->element('url', $this->xml->encloseCData($product->getProductUrl()));
264
- $this->writeImageUrl($product);
265
$this->writeClassification($product, $rootCategoriesIds);
266
- $this->writeProperties($product, $stores);
267
$this->writeBrand($product);
268
$this->writeMaterials($product);
269
$this->writeColors($product);
@@ -287,7 +274,7 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
287
{
288
$this->xml->push('stores');
289
290
- /* Qty is the same for all stores, better copute it outside the loop: */
291
$qty = Mage::getModel('cataloginventory/stock_item')->loadByProduct($variantProduct)->getQty();
292
$qty = ($qty > 0 ? $qty : 0);
293
@@ -297,10 +284,12 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
297
/*
298
* reload the $variantProduct if this is a real variant or if we are on a different store
299
*/
300
if ($product->getId() != $variantProduct->getId() || $store->getId() != $product->getStoreId()) {
301
$reloadedVariantProduct = Mage::getModel('catalog/product')->setStoreId($store->getId())->load(
302
$variantProduct->getId()
303
);
304
} else {
305
$reloadedVariantProduct = $variantProduct;
306
}
@@ -310,7 +299,7 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
310
$storeContext['country'] = $this->getStoreLang($store->getId());
311
312
$operations = $this->getOperations($product, $store);
313
- $this->writePrices($reloadedVariantProduct, $product, $storeContext, $store, $operations);
314
$this->writeMarketing($reloadedVariantProduct, $operations);
315
316
$isAvailable = $reloadedVariantProduct->isSalable() || (in_array($reloadedVariantProduct->getTypeId(), $this->productMultiple) && $product->isInStock());
@@ -318,9 +307,19 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
318
319
$this->xml->element('stock', (int)$qty);
320
321
- $this->xml->element('url', $this->xml->encloseCData($reloadedVariantProduct->getProductUrl(false)));
322
$this->xml->pop();
323
324
}
325
$this->xml->pop();
326
}
@@ -354,7 +353,7 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
354
if (in_array($storeId, $this->enabledStores))
355
$stores[] = $context['stores'][$storeId];
356
}
357
-
358
return $stores;
359
}
360
@@ -458,26 +457,46 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
458
}
459
}
460
}
461
-
462
/**
463
* Write the product urls
464
*
465
* @param Product $product
466
* @param string $urlImg
467
*/
468
protected function writeImageUrl($product, $urlImg = true)
469
{
470
- try {
471
if ($product->getThumbnail() && ($product->getThumbnail() != 'no_selection')) {
472
- $this->xml->element('url_thumbnail', $this->xml->encloseCData(Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getThumbnail())));
473
}
474
- } catch(Exception $e) {}
475
476
try {
477
if ($urlImg && $product->getImage() && ($product->getImage() != 'no_selection')) {
478
- $this->xml->element('url_image', $this->xml->encloseCData(Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getImage())));
479
}
480
- } catch(Exception $e) {}
481
}
482
483
/**
@@ -684,9 +703,8 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
684
* Write the product properties
685
*
686
* @param Product $product
687
- * @param array $stores List product store
688
*/
689
- protected function writeProperties($product, $stores)
690
{
691
$properties = array();
692
if(!empty($this->fields['properties'])) {
@@ -697,16 +715,20 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
697
698
$attribute = $product->getResource()->getAttribute($property['value']);
699
if ($attribute) {
700
$value = $attribute->getFrontend()->getValue($product);
701
- $label = $attribute->getStoreLabel();
702
- if (!$label) {
703
- $labels = $attribute->getStoreLabels();
704
- if (isset($labels[current($stores)->getId()])) {
705
- $label = $labels[current($stores)->getId()];
706
- }
707
- }
708
-
709
- $labels = array();
710
switch($attribute->getfrontend_input())
711
{
712
case 'multiselect':
@@ -723,15 +745,18 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
723
break;
724
default:
725
$optionName = $value;
726
- if(!empty($this->propertyLabel[$property['value']]['options'][$id]['per_store'][current($stores)->getId()])) {
727
- $optionName = $this->propertyLabel[$property['value']]['options'][$id]['per_store'][current($stores)->getId()];
728
}
729
- $value = is_bool($value) ? (int)$value : $value;
730
- $properties[] = array(
731
- 'name' => $property['value'],
732
- 'display_name' => substr($label, 0, self::FACET_MAX_LENGTH),
733
- 'label' => substr($optionName, 0, self::FACET_MAX_LENGTH),
734
- 'autocomplete' => ($property['autocomplete'] == 1 ? 'on' : 'off'));
735
break;
736
}
737
} else {
@@ -756,7 +781,7 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
756
*
757
* @param Product $product
758
*/
759
- protected function writePrices($product, $parentProduct, $context, $store, $operations)
760
{
761
$prices = ($this->getPrices($parentProduct->getId(), $store->getWebsiteId()));
762
@@ -775,7 +800,7 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
775
$attributes = array('currency' => $context['currency'], 'type' => 'PRICE_FINAL', 'vat_included' => 'true', 'country' => strtoupper($context['country']));
776
if (isset($priceCut))
777
{
778
- $off = (int)(($priceCut - $price) / $priceCut * 100);
779
$attributes['off'] = $off;
780
}
781
$this->xml->element(
@@ -789,7 +814,7 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
789
$priceCut = Mage::helper('directory')->currencyConvert($priceCut, Mage::app()->getStore()->getCurrentCurrencyCode(), $store->getCurrentCurrencyCode());
790
$this->xml->element(
791
'price',
792
- Mage::helper('Antidot')->round($priceCut, 2),
793
array('currency' => $context['currency'], 'type' => 'PRICE_CUT', 'vat_included' => 'true', 'country' => strtoupper($context['country']))
794
);
795
@@ -798,6 +823,16 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
798
$this->xml->pop();
799
}
800
801
/**
802
* Return product special price (if exists)
803
*
@@ -858,7 +893,10 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
858
$result['min_price'] = $product->getPrice();
859
$result['price'] = $product->getPrice();
860
$result['final_price'] = $product->getPrice();
861
- $product->clearInstance();
862
}
863
864
return $result;
@@ -1002,13 +1040,12 @@ class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
1002
$this->writeDescriptions($variantProduct);
1003
$this->writeStore($product, $stores, $variantProduct);
1004
$this->writeIdentifiers($variantProduct);
1005
- $this->writeProperties($variantProduct, $stores);
1006
$this->writeMaterials($variantProduct);
1007
$this->writeColors($variantProduct);
1008
$this->writeModels($variantProduct);
1009
$this->writeSizes($variantProduct);
1010
$this->writeGenders($product);
1011
- $this->writeImageUrl($variantProduct);
1012
$this->writeMisc($variantProduct);
1013
}
1014
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Export_Product extends MDN_Antidot_Model_Export_Abstract
17
{
18
19
const TYPE = 'CATALOG';
20
+ const FILENAME_XML = 'catalog-%s_%s-%s.xml';
21
+ const FILENAME_ZIP = '%s_full_%s_catalog.zip';
22
+ const FILENAME_ZIP_INC = '%s_inc_%s_catalog.zip';
23
const XSD = 'http://ref.antidot.net/store/latest/catalog.xsd';
24
25
/*
88
->joinField('qty',
89
'cataloginventory/stock_item',
90
'qty',
91
+ 'product_id=entity_id', // warning : no spaces between = and entity_id , magento1.5 isn't robust enought
92
'{{table}}.stock_id = 1'.$productsInStock)
93
;
94
130
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
131
132
foreach($collection as $product) {
133
+
134
+ $stores = $this->getProductStores($product, $context);
135
+ if ($store = current($stores)) { //we take the "first" store of the current lang
136
+ $product = Mage::getModel('catalog/product')->setStoreId($store->getId())->load(
137
+ $product->getId()
138
+ );
139
+
140
+ $this->writeProduct($product, $stores);
141
+
142
+ $product->clearInstance(); //memory flush
143
+ $product = null;
144
+ unset($product);
145
+ gc_collect_cycles();
146
+ }
147
148
}
149
$this->writePart($this->xml->flush());
209
}
210
}
211
}
212
+
213
/**
214
* Write the product
215
*
216
* @param Product $product
217
+ * @param Array $stores
218
*/
219
+ protected function writeProduct($product, $stores)
220
{
221
+
222
//skip product if no websites
223
if (count($stores) == 0)
224
return;
250
if ($keywords = $this->getField($product, 'keywords')) {
251
$this->xml->element('keywords', $this->xml->encloseCData($keywords));
252
}
253
$this->writeClassification($product, $rootCategoriesIds);
254
$this->writeBrand($product);
255
$this->writeMaterials($product);
256
$this->writeColors($product);
274
{
275
$this->xml->push('stores');
276
277
+ /* Qty is the same for all stores, better compute it outside the loop: */
278
$qty = Mage::getModel('cataloginventory/stock_item')->loadByProduct($variantProduct)->getQty();
279
$qty = ($qty > 0 ? $qty : 0);
280
284
/*
285
* reload the $variantProduct if this is a real variant or if we are on a different store
286
*/
287
+ $reloaded = false;
288
if ($product->getId() != $variantProduct->getId() || $store->getId() != $product->getStoreId()) {
289
$reloadedVariantProduct = Mage::getModel('catalog/product')->setStoreId($store->getId())->load(
290
$variantProduct->getId()
291
);
292
+ $reloaded = true;
293
} else {
294
$reloadedVariantProduct = $variantProduct;
295
}
299
$storeContext['country'] = $this->getStoreLang($store->getId());
300
301
$operations = $this->getOperations($product, $store);
302
+ $this->writePrices($reloadedVariantProduct, $product, $storeContext, $store);
303
$this->writeMarketing($reloadedVariantProduct, $operations);
304
305
$isAvailable = $reloadedVariantProduct->isSalable() || (in_array($reloadedVariantProduct->getTypeId(), $this->productMultiple) && $product->isInStock());
307
308
$this->xml->element('stock', (int)$qty);
309
310
+ $this->writeProductUrl($reloadedVariantProduct);
311
+ $this->writeImageUrl($reloadedVariantProduct);
312
+
313
$this->xml->pop();
314
315
+ if ($reloaded) {
316
+ $reloadedVariantProduct->clearInstance(); //memory flush
317
+ $reloadedVariantProduct = null;
318
+ unset($reloadedVariantProduct);
319
+ gc_collect_cycles();
320
+ }
321
+
322
+
323
}
324
$this->xml->pop();
325
}
353
if (in_array($storeId, $this->enabledStores))
354
$stores[] = $context['stores'][$storeId];
355
}
356
+
357
return $stores;
358
}
359
457
}
458
}
459
}
460
+
461
/**
462
* Write the product urls
463
+ *
464
+ * @param Product $product
465
+ * @param string $urlImg
466
+ */
467
+ protected function writeProductUrl($product)
468
+ {
469
+ $this->xml->element('url', $this->xml->encloseCData($product->getProductUrl(false)));
470
+ }
471
+
472
+
473
+ /**
474
+ * Write the product images urls
475
*
476
* @param Product $product
477
* @param string $urlImg
478
*/
479
protected function writeImageUrl($product, $urlImg = true)
480
{
481
+
482
+ //Set the current store to generate correct URls (even in unit tests)
483
+ Mage::app()->setCurrentStore($product->getStoreId());
484
+
485
+ try {
486
if ($product->getThumbnail() && ($product->getThumbnail() != 'no_selection')) {
487
+ $this->xml->element('url_thumbnail', $this->xml->encloseCData(Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getThumbnail())));
488
}
489
+ } catch(Exception $e) {
490
+ Mage::log($e, Zend_Log::ERR, 'antidot.log');
491
+ }
492
493
try {
494
if ($urlImg && $product->getImage() && ($product->getImage() != 'no_selection')) {
495
+ $this->xml->element('url_image', $this->xml->encloseCData(Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getImage())));
496
}
497
+ } catch(Exception $e) {
498
+ Mage::log($e, Zend_Log::ERR, 'antidot.log');
499
+ }
500
}
501
502
/**
703
* Write the product properties
704
*
705
* @param Product $product
706
*/
707
+ protected function writeProperties($product)
708
{
709
$properties = array();
710
if(!empty($this->fields['properties'])) {
715
716
$attribute = $product->getResource()->getAttribute($property['value']);
717
if ($attribute) {
718
+ $attribute->setStoreId($product->getStoreId());
719
$value = $attribute->getFrontend()->getValue($product);
720
+ $label = $attribute->getFrontendLabel(); // we use Admin label as default value
721
+ $labels = $attribute->getStoreLabels();
722
+ if (isset($labels[$product->getStoreId()])) {
723
+ $label = $labels[$product->getStoreId()];
724
+ }
725
+ /**
726
+ * Note : we don't use $attribute->getStoreLabel() method because
727
+ * $product->getResource() is a singleton which cache the attributes
728
+ * then the attribute (and his store label) is loaded for the first store
729
+ * processed, and we get wrong label for the next stores.
730
+ * Flush this cache would be less performance
731
+ */
732
switch($attribute->getfrontend_input())
733
{
734
case 'multiselect':
745
break;
746
default:
747
$optionName = $value;
748
+ if(!empty($this->propertyLabel[$property['value']]['options'][$id]['per_store'][$product->getStoreId()])) {
749
+ $optionName = $this->propertyLabel[$property['value']]['options'][$id]['per_store'][$product->getStoreId()];
750
}
751
+ //do not insert the properties tag if it has no value (in label attribute) :
752
+ if ($optionName) {
753
+ $properties[] = array(
754
+ 'name' => $property['value'],
755
+ 'display_name' => substr($label, 0, self::FACET_MAX_LENGTH),
756
+ 'label' => substr($optionName, 0, self::FACET_MAX_LENGTH),
757
+ 'autocomplete' => ($property['autocomplete'] == 1 ? 'on' : 'off')
758
+ );
759
+ }
760
break;
761
}
762
} else {
781
*
782
* @param Product $product
783
*/
784
+ protected function writePrices($product, $parentProduct, $context, $store)
785
{
786
$prices = ($this->getPrices($parentProduct->getId(), $store->getWebsiteId()));
787
800
$attributes = array('currency' => $context['currency'], 'type' => 'PRICE_FINAL', 'vat_included' => 'true', 'country' => strtoupper($context['country']));
801
if (isset($priceCut))
802
{
803
+ $off = $this->computePriceOff($priceCut, $price);
804
$attributes['off'] = $off;
805
}
806
$this->xml->element(
814
$priceCut = Mage::helper('directory')->currencyConvert($priceCut, Mage::app()->getStore()->getCurrentCurrencyCode(), $store->getCurrentCurrencyCode());
815
$this->xml->element(
816
'price',
817
+ Mage::helper('Antidot')->round($priceCut),
818
array('currency' => $context['currency'], 'type' => 'PRICE_CUT', 'vat_included' => 'true', 'country' => strtoupper($context['country']))
819
);
820
823
$this->xml->pop();
824
}
825
826
+ /**
827
+ * Return The price reduction percentage
828
+ *
829
+ * @param $priceCut
830
+ * @param $price
831
+ */
832
+ protected function computePriceOff($priceCut, $price) {
833
+ return round(($priceCut - $price) / $priceCut * 100);
834
+ }
835
+
836
/**
837
* Return product special price (if exists)
838
*
893
$result['min_price'] = $product->getPrice();
894
$result['price'] = $product->getPrice();
895
$result['final_price'] = $product->getPrice();
896
+ $product->clearInstance(); //memory flush
897
+ $product = null;
898
+ unset($product);
899
+ gc_collect_cycles();
900
}
901
902
return $result;
1040
$this->writeDescriptions($variantProduct);
1041
$this->writeStore($product, $stores, $variantProduct);
1042
$this->writeIdentifiers($variantProduct);
1043
+ $this->writeProperties($variantProduct);
1044
$this->writeMaterials($variantProduct);
1045
$this->writeColors($variantProduct);
1046
$this->writeModels($variantProduct);
1047
$this->writeSizes($variantProduct);
1048
$this->writeGenders($product);
1049
$this->writeMisc($variantProduct);
1050
}
1051
app/code/community/MDN/Antidot/Model/Observer.php CHANGED
@@ -9,14 +9,15 @@
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
- * @copyright Copyright (c) 2009 Maison du Logiciel (http://www.maisondulogiciel.com)
13
- * @author : Olivier ZIMMERMANN
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Observer extends Mage_Core_Model_Abstract
17
{
18
const GENERATE_FULL = 'FULL';
19
const GENERATE_INC = 'INC';
20
21
/**
22
* @var string @tmpDirectory
@@ -48,9 +49,52 @@ class MDN_Antidot_Model_Observer extends Mage_Core_Model_Abstract
48
$this->begin = microtime(true);
49
$this->initTmpDirectory();
50
51
- ini_set('memory_limit', '1024M');
52
}
53
54
/**
55
* Init the tmp directory
56
*/
@@ -77,26 +121,26 @@ class MDN_Antidot_Model_Observer extends Mage_Core_Model_Abstract
77
/**
78
* Generate the full catalog file
79
*/
80
- public function catalogFullExport()
81
{
82
$this->log('FULL EXPORT');
83
- $this->generate(Mage::getModel('Antidot/Export_Product'), self::GENERATE_FULL);
84
}
85
86
/**
87
* Generate the inc catalog file
88
*/
89
- public function catalogIncExport()
90
{
91
- $this->generate(Mage::getModel('Antidot/Export_Product'), self::GENERATE_INC);
92
}
93
94
/**
95
* Generate the category file
96
*/
97
- public function categoriesFullExport()
98
{
99
- $this->generate(Mage::getModel('Antidot/Export_Category'), self::GENERATE_FULL);
100
}
101
102
/**
@@ -106,7 +150,7 @@ class MDN_Antidot_Model_Observer extends Mage_Core_Model_Abstract
106
* @param string $type
107
* @throws Exception
108
*/
109
- protected function generate($exportModel, $type)
110
{
111
$this->type = $exportModel::TYPE;
112
$this->log('start');
@@ -118,12 +162,13 @@ class MDN_Antidot_Model_Observer extends Mage_Core_Model_Abstract
118
try
119
{
120
121
- $files = array();
122
- foreach($this->getDefaultContext() as $context) {
123
$this->log('generate '.$exportModel::TYPE.' '.$context['owner']);
124
$context['store_id'] = array_keys($context['stores']);
125
126
- $filename = $this->tmpDirectory.sprintf($exportModel::FILENAME_XML, $type, $context['lang']);
127
$items = $exportModel->writeXml($context, $filename, $type);
128
if($items === 0) {
129
$this->log('No items to export');
@@ -131,30 +176,31 @@ class MDN_Antidot_Model_Observer extends Mage_Core_Model_Abstract
131
}
132
133
$log['items']+= $items;
134
- if ($this->schemaValidate($filename, $exportModel::XSD)) {
135
- $this->log('Schema validated');
136
$files[] = $filename;
137
} else {
138
$this->fileError($filename);
139
140
- $errors = Mage::helper('Antidot/XmlWriter')->getErrors();
141
- $this->log('xml schema not valid '.print_r($errors, true));
142
- Mage::helper('Antidot')->sendMail('Export failed', print_r($errors, true));
143
- foreach($errors as $error)
144
$log['error'][] = $error;
145
continue;
146
}
147
}
148
149
if($log['items'] === 0) {
150
$this->log('No items available, cancel export');
151
- return;
152
}
153
154
$log['reference'] = 'unknown';
155
if(!empty($files)) {
156
$this->log('Compress files');
157
$filenameZip = $type === self::GENERATE_INC ? $exportModel::FILENAME_ZIP_INC : $exportModel::FILENAME_ZIP;
158
$filename = $this->compress($files, $filenameZip);
159
$log['reference'] = md5($filename);
160
$this->send($filename);
@@ -163,8 +209,11 @@ class MDN_Antidot_Model_Observer extends Mage_Core_Model_Abstract
163
} else {
164
$log['status'] = 'FAILED';
165
$lastError = current(Mage::helper('Antidot/XmlWriter')->getErrors());
166
- if ($lastError)
167
- $log['error'][] = $lastError;
168
}
169
170
if(file_exists($filename)) {
@@ -184,6 +233,15 @@ class MDN_Antidot_Model_Observer extends Mage_Core_Model_Abstract
184
$this->log('end');
185
186
Mage::helper('Antidot/LogExport')->add($log['reference'], $type, $exportModel::TYPE, $log['begin'], $log['end'], $log['items'], $log['status'], implode(',', $log['error']));
187
}
188
189
/**
@@ -223,7 +281,7 @@ class MDN_Antidot_Model_Observer extends Mage_Core_Model_Abstract
223
{
224
$this->log('compress the file');
225
226
- $compressFile = dirname(current($files)).'/'.sprintf($compressFile, date('YmdHis'));
227
Mage::helper('Antidot/Compress')->zip($files, $compressFile);
228
229
return $compressFile;
@@ -246,27 +304,61 @@ class MDN_Antidot_Model_Observer extends Mage_Core_Model_Abstract
246
247
/**
248
* Check if the xml file is valid
249
*
250
* @param string $filename xml file
251
* @param string $xsd xsd file
252
- * @return boolean
253
*/
254
protected function schemaValidate($filename, $xsd)
255
{
256
//disable schema validation
257
if (Mage::getStoreConfig('antidot/xsd_verification/disable') == 1)
258
{
259
$this->log('schema validation is DISABLED');
260
- return true;
261
}
262
263
- libxml_use_internal_errors(true);
264
- $this->log('schema validate');
265
-
266
- $xml = new DOMDocument();
267
- $xml->load($filename);
268
-
269
- return $xml->schemaValidate($xsd);
270
}
271
272
/**
@@ -275,7 +367,7 @@ class MDN_Antidot_Model_Observer extends Mage_Core_Model_Abstract
275
* @todo retrieve these data from the db
276
* @return array
277
*/
278
- private function getDefaultContext()
279
{
280
$listStore = array();
281
foreach (Mage::app()->getStores() as $store) {
@@ -284,12 +376,16 @@ class MDN_Antidot_Model_Observer extends Mage_Core_Model_Abstract
284
$listStore[$lang][$store->getId()] = $store;
285
}
286
}
287
-
288
$listContext = array();
289
- $context['website_ids'] = array();
290
foreach($listStore as $lang => $stores) {
291
- $defaultOwner = 'AFS@Store for Magento v'.Mage::getConfig()->getNode()->modules->MDN_Antidot->version;
292
- $context['owner'] = Mage::getStoreConfig('antidot/general/owner') === '' ? $defaultOwner : Mage::getStoreConfig('antidot/general/owner');
293
$context['lang'] = $lang;
294
$context['stores'] = $stores;
295
foreach ($stores as $store) {
@@ -319,4 +415,35 @@ class MDN_Antidot_Model_Observer extends Mage_Core_Model_Abstract
319
320
Mage::log($message, null, 'antidot.log');
321
}
322
- }
9
* It is also available through the world-wide-web at this URL:
10
* http://opensource.org/licenses/osl-3.0.php
11
*
12
+ * @copyright Copyright (c) 2015 Antidot (http://www.antidot.net)
13
+ * @author : Antidot devmagento@antidot.net
14
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
*/
16
class MDN_Antidot_Model_Observer extends Mage_Core_Model_Abstract
17
{
18
const GENERATE_FULL = 'FULL';
19
const GENERATE_INC = 'INC';
20
+ const MINIMUM_MEMORY_LIMIT = '2048M';
21
22
/**
23
* @var string @tmpDirectory
49
$this->begin = microtime(true);
50
$this->initTmpDirectory();
51
52
+ /*
53
+ * If the default memory limit is below 2048M set it to 2048M
54
+ * else if it is above 2048M let it as it is
55
+ */
56
+ if ($this->return_bytes(ini_get('memory_limit')) < $this->return_bytes(self::MINIMUM_MEMORY_LIMIT)) {
57
+ ini_set('memory_limit', self::MINIMUM_MEMORY_LIMIT);
58
+ }
59
+
60
}
61
62
+ /**
63
+ * Gives the value in bytes
64
+ */
65
+ protected function return_bytes ($val)
66
+ {
67
+ if(empty($val))return 0;
68
+
69
+ $val = trim($val);
70
+
71
+ preg_match('#([0-9]+)[\s]*([a-z]+)#i', $val, $matches);
72
+
73
+ $last = '';
74
+ if(isset($matches[2])){
75
+ $last = $matches[2];
76
+ }
77
+
78
+ if(isset($matches[1])){
79
+ $val = (int) $matches[1];
80
+ }
81
+
82
+ switch (strtolower($last))
83
+ {
84
+ case 'g':
85
+ case 'gb':
86
+ $val *= 1024;
87
+ case 'm':
88
+ case 'mb':
89
+ $val *= 1024;
90
+ case 'k':
91
+ case 'kb':
92
+ $val *= 1024;
93
+ }
94
+
95
+ return (int) $val;
96
+ }
97
+
98
/**
99
* Init the tmp directory
100
*/
121
/**
122
* Generate the full catalog file
123
*/
124
+ public function catalogFullExport($runContext = 'cron')
125
{
126
$this->log('FULL EXPORT');
127
+ return $this->generate(Mage::getModel('Antidot/Export_Product'), self::GENERATE_FULL, $runContext);
128
}
129
130
/**
131
* Generate the inc catalog file
132
*/
133
+ public function catalogIncExport($runContext = 'cron')
134
{
135
+ return $this->generate(Mage::getModel('Antidot/Export_Product'), self::GENERATE_INC, $runContext);
136
}
137
138
/**
139
* Generate the category file
140
*/
141
+ public function categoriesFullExport($runContext = 'cron')
142
{
143
+ return $this->generate(Mage::getModel('Antidot/Export_Category'), self::GENERATE_FULL, $runContext);
144
}
145
146
/**
150
* @param string $type
151
* @throws Exception
152
*/
153
+ protected function generate($exportModel, $type, $runContext)
154
{
155
$this->type = $exportModel::TYPE;
156
$this->log('start');
162
try
163
{
164
165
+ $owner = $this->getOwnerForFilename(Mage::getStoreConfig('antidot/general/owner'));
166
+ $files = array();
167
+ foreach($this->getDefaultContext($runContext) as $context) {
168
$this->log('generate '.$exportModel::TYPE.' '.$context['owner']);
169
$context['store_id'] = array_keys($context['stores']);
170
171
+ $filename = $this->tmpDirectory.sprintf($exportModel::FILENAME_XML, $owner, $type, $context['lang']);
172
$items = $exportModel->writeXml($context, $filename, $type);
173
if($items === 0) {
174
$this->log('No items to export');
176
}
177
178
$log['items']+= $items;
179
+ $validationErrors = $this->schemaValidate($filename, $exportModel::XSD);
180
+ if (count($validationErrors)==0) {
181
$files[] = $filename;
182
} else {
183
+
184
$this->fileError($filename);
185
186
+ foreach ($validationErrors as $error) {
187
$log['error'][] = $error;
188
+ }
189
continue;
190
+
191
}
192
}
193
194
if($log['items'] === 0) {
195
$this->log('No items available, cancel export');
196
+ return 0;
197
}
198
199
$log['reference'] = 'unknown';
200
if(!empty($files)) {
201
$this->log('Compress files');
202
$filenameZip = $type === self::GENERATE_INC ? $exportModel::FILENAME_ZIP_INC : $exportModel::FILENAME_ZIP;
203
+ $filenameZip = sprintf($filenameZip, date('YmdHis'), $owner);
204
$filename = $this->compress($files, $filenameZip);
205
$log['reference'] = md5($filename);
206
$this->send($filename);
209
} else {
210
$log['status'] = 'FAILED';
211
$lastError = current(Mage::helper('Antidot/XmlWriter')->getErrors());
212
+ if ($lastError) {
213
+ $log['error'][] = $lastError;
214
+ } else {
215
+ $log['error'][] = 'No file to export';
216
+ }
217
}
218
219
if(file_exists($filename)) {
233
$this->log('end');
234
235
Mage::helper('Antidot/LogExport')->add($log['reference'], $type, $exportModel::TYPE, $log['begin'], $log['end'], $log['items'], $log['status'], implode(',', $log['error']));
236
+
237
+ if ( count($log['error']) ) {
238
+ //send error alert mail
239
+ Mage::helper('Antidot')->sendMail('Export failed', print_r($log['error'], true));
240
+ //throw Exception in order to dispay error message in UI
241
+ Mage::throwException(implode(',', $log['error']));
242
+ }
243
+
244
+ return $log['items'];
245
}
246
247
/**
281
{
282
$this->log('compress the file');
283
284
+ $compressFile = dirname(current($files)).'/'.$compressFile;
285
Mage::helper('Antidot/Compress')->zip($files, $compressFile);
286
287
return $compressFile;
304
305
/**
306
* Check if the xml file is valid
307
+ * Returns array of error message, empty if schema is valid
308
*
309
* @param string $filename xml file
310
* @param string $xsd xsd file
311
+ * @return array
312
*/
313
protected function schemaValidate($filename, $xsd)
314
{
315
+ $errors = array();
316
+
317
//disable schema validation
318
if (Mage::getStoreConfig('antidot/xsd_verification/disable') == 1)
319
{
320
$this->log('schema validation is DISABLED');
321
+ } else {
322
+
323
+ libxml_use_internal_errors(true);
324
+ $this->log('schema validate');
325
+
326
+ $xml = new DOMDocument();
327
+ $xml->load($filename);
328
+
329
+ try {
330
+
331
+ if ($xml->schemaValidate($xsd)) {
332
+ $this->log('Schema validated');
333
+ } else {
334
+
335
+ $errors = Mage::helper('Antidot/XmlWriter')->getErrors();
336
+
337
+ $match = array();
338
+ if (preg_match('#Warning 1549: failed to load external entity "(.*)\.xsd"#', $errors[0], $match)) {
339
+ $errors = array();
340
+ //In case XSD is not reacheable, disable the schema validation
341
+ $this->log('failed to load external entity '.$match[1].'.xsd, schema validation is DISABLED');
342
+ $this->log('Schema validated');
343
+ }
344
+ }
345
+
346
+ } catch (Exception $e) {
347
+ $match = array();
348
+ if (preg_match(
349
+ "#Warning: DOMDocument::schemaValidate\(http://(.*)\.xsd\): failed to open stream:#",
350
+ $e->getMessage(),
351
+ $match
352
+ )) {
353
+ //In case xsd is not reacheable, disable the schema validation
354
+ $this->log('http://'.$match[1].'.xsd is not reacheable, schema validation is DISABLED');
355
+ } else {
356
+ throw $e;
357
+ }
358
+ }
359
}
360
+ return $errors;
361
362
}
363
364
/**
367
* @todo retrieve these data from the db
368
* @return array
369
*/
370
+ private function getDefaultContext($runContext)
371
{
372
$listStore = array();
373
foreach (Mage::app()->getStores() as $store) {
376
$listStore[$lang][$store->getId()] = $store;
377
}
378
}
379
+ $owner = 'AFS@Store for Magento v'.Mage::getConfig()->getNode()->modules->MDN_Antidot->version;
380
+ if (Mage::getStoreConfig('antidot/general/owner')) {
381
+ $owner = Mage::getStoreConfig('antidot/general/owner');
382