Mage_Codi - Version 4.2.6

Version Notes

Please contact our support desk if you have any problems.

Download this release

Release Info

Developer Magento Core Team
Extension Mage_Codi
Version 4.2.6
Comparing to
See all releases


Code changes from version 4.2.5 to 4.2.6

app/code/community/Mage/CodiScript/Model/Files.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- // 2015-04-27
3
  class ConfiguredProductLine{
4
  public $optionIds = array();
5
  public $line = NULL;
@@ -61,6 +61,7 @@ class Mage_CodiScript_Model_Files extends Mage_Core_Model_Abstract {
61
  public $importoptionsasattributes = FALSE;
62
  public $importoptionsassku = FALSE;
63
  public $instockonly = FALSE;
 
64
  public $start = 0;
65
  public $pageSize = 1000000000;
66
  public $address = FALSE;
@@ -73,6 +74,7 @@ class Mage_CodiScript_Model_Files extends Mage_Core_Model_Abstract {
73
  public $unCatPosition;
74
  public $catpathmap;
75
  public $catmap;
 
76
  public $_DEBUG;
77
  const TAG_P_CLOSE = '</p>';
78
  const TAG_P = '<p>';
@@ -142,8 +144,18 @@ memory_get_usage ".memory_get_usage()." / ".memory_get_usage(TRUE)."
142
  ";
143
  if( $product->isConfigurable() )
144
  echo $this->ProducttoStringConfigurable( $product );
145
- else if( $product->isGrouped() )
146
- echo $this->ProducttoStringGrouped( $product );
 
 
 
 
 
 
 
 
 
 
147
  else
148
  echo $this->ProducttoStringSimple( $product );
149
  unset( $product );
@@ -1751,7 +1763,7 @@ ProdRPrice=".$ProdRPrice." ProdSPrice=".$ProdSPrice."
1751
  $qty = substr( $qty, 0, strlen( $qty ) - strlen( $tail ) );
1752
  return $qty;
1753
  }
1754
-
1755
  private function _getTierPrices( &$product ){
1756
  $res="";
1757
  $prices = $product->getFormatedTierPrice();
@@ -1929,6 +1941,9 @@ ProdRPrice=".$ProdRPrice." ProdSPrice=".$ProdSPrice."
1929
 
1930
  // Class=CatalogProject
1931
  public function renderCatalogProject(){
 
 
 
1932
  $this->productTypeConfigurableModel = Mage::getModel('catalog/product_type_configurable');
1933
  $categories = Mage::getModel('catalog/category')
1934
  ->setStoreId( $this->StoreId )
@@ -1989,7 +2004,13 @@ Products: ".count( $prodIds )."
1989
  }
1990
  $index++;
1991
  $product = Mage::getModel('catalog/product')->setStoreId( $this->StoreId )->load( $productId );
1992
- echo $product->isConfigurable() ? $this->CatalogProjectStringConfigurable( $product ) : $this->CatalogProjectStringSimple( $product );
 
 
 
 
 
 
1993
  unset( $product );
1994
  if( $this->_DEBUG ) echo "#".$count.": memory_get_usage ".memory_get_usage()." / ".memory_get_usage(TRUE)."
1995
  ";
@@ -2017,7 +2038,7 @@ Products: ".count( $prodIds )."
2017
  }
2018
  }
2019
 
2020
- private function CatalogProjectStringSimple( &$product ){
2021
  $ProducttoString = "";
2022
  $categoryIds = $product->getCategoryIds();
2023
  $listed = FALSE;
@@ -2061,6 +2082,68 @@ Products: ".count( $prodIds )."
2061
  return $ProducttoString;
2062
  }
2063
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2064
  private function CatalogProjectStringConfigurable( &$product ){
2065
  $UsedProductIds = $this->productTypeConfigurableModel->getUsedProductIds($product);
2066
  $countUsedProductIds = count( $UsedProductIds );
1
  <?php
2
+ // 2015-05-08
3
  class ConfiguredProductLine{
4
  public $optionIds = array();
5
  public $line = NULL;
61
  public $importoptionsasattributes = FALSE;
62
  public $importoptionsassku = FALSE;
63
  public $instockonly = FALSE;
64
+ public $splitgroupedproducts = FALSE;
65
  public $start = 0;
66
  public $pageSize = 1000000000;
67
  public $address = FALSE;
74
  public $unCatPosition;
75
  public $catpathmap;
76
  public $catmap;
77
+ public $catpositions = FALSE;
78
  public $_DEBUG;
79
  const TAG_P_CLOSE = '</p>';
80
  const TAG_P = '<p>';
144
  ";
145
  if( $product->isConfigurable() )
146
  echo $this->ProducttoStringConfigurable( $product );
147
+ else if( $product->isGrouped() ){
148
+ if( $this->splitgroupedproducts ){
149
+ $AssociatedProductIds = $this->productTypeGroupedModel->getAssociatedProductIds( $product );
150
+ $UsedProducts = array();
151
+ foreach( $AssociatedProductIds as $UsedProductid ){
152
+ $_product = Mage::getModel('catalog/product')->setStoreId( $this->StoreId )->load( $UsedProductid );
153
+ echo $this->ProducttoStringSimple( $_product );
154
+ }
155
+ } else {
156
+ echo $this->ProducttoStringGrouped( $product );
157
+ }
158
+ }
159
  else
160
  echo $this->ProducttoStringSimple( $product );
161
  unset( $product );
1763
  $qty = substr( $qty, 0, strlen( $qty ) - strlen( $tail ) );
1764
  return $qty;
1765
  }
1766
+
1767
  private function _getTierPrices( &$product ){
1768
  $res="";
1769
  $prices = $product->getFormatedTierPrice();
1941
 
1942
  // Class=CatalogProject
1943
  public function renderCatalogProject(){
1944
+ if( $this->splitgroupedproducts ){
1945
+ $this->productTypeGroupedModel = Mage::getModel('catalog/product_type_grouped');
1946
+ }
1947
  $this->productTypeConfigurableModel = Mage::getModel('catalog/product_type_configurable');
1948
  $categories = Mage::getModel('catalog/category')
1949
  ->setStoreId( $this->StoreId )
2004
  }
2005
  $index++;
2006
  $product = Mage::getModel('catalog/product')->setStoreId( $this->StoreId )->load( $productId );
2007
+ if( $product->isConfigurable() ){
2008
+ echo $this->CatalogProjectStringConfigurable( $product );
2009
+ } else if( $product->isGrouped() && $this->splitgroupedproducts ){
2010
+ echo $this->CatalogProjectStringGroupedAsSimple( $product );
2011
+ } else {
2012
+ echo $this->CatalogProjectStringGroupedOrSimple( $product );
2013
+ }
2014
  unset( $product );
2015
  if( $this->_DEBUG ) echo "#".$count.": memory_get_usage ".memory_get_usage()." / ".memory_get_usage(TRUE)."
2016
  ";
2038
  }
2039
  }
2040
 
2041
+ private function CatalogProjectStringGroupedOrSimple( &$product ){
2042
  $ProducttoString = "";
2043
  $categoryIds = $product->getCategoryIds();
2044
  $listed = FALSE;
2082
  return $ProducttoString;
2083
  }
2084
 
2085
+ private function CatalogProjectStringGroupedAsSimple( &$product ){
2086
+ $ProducttoString = "";
2087
+ $categoryIds = $product->getCategoryIds();
2088
+ $listed = FALSE;
2089
+ if( $categoryIds ){
2090
+ $prodNames = array();
2091
+ $AssociatedProductIds = $this->productTypeGroupedModel->getAssociatedProductIds( $product );
2092
+ foreach( $AssociatedProductIds as $UsedProductid ){
2093
+ $UsedProduct = Mage::getModel('catalog/product')->setStoreId( $this->StoreId )->load( $UsedProductid );
2094
+ if( $UsedProduct->getStatus() == 1 ){
2095
+ $prodName = $UsedProduct->getName();
2096
+ $prodNames[] = $UsedProduct->getId().'#$#'.$this->_cleanStr( $prodName );
2097
+ } else {
2098
+ if( $this->_DEBUG ) echo "sku=".$UsedProduct->getSku()." enabled=".$UsedProduct->getStatus()." - bypassed.
2099
+ ";
2100
+ }
2101
+ unset( $UsedProduct );
2102
+ }
2103
+ if( count( $prodNames ) == 0 )
2104
+ return $ProducttoString;
2105
+ foreach( $categoryIds as $k => $category_id ){
2106
+ if( !isset( $this->catmap[ $category_id ] ) ){
2107
+ if( $this->_DEBUG ) echo "No category: ".$category_id."
2108
+ ";
2109
+ continue;
2110
+ }
2111
+ $category = $this->catmap[ $category_id ];
2112
+ $hpath = $this->catpathmap[ $category_id ];
2113
+ $position = "";
2114
+ $positions = $category->getProductsPosition();
2115
+ if( count( $positions ) > 0 )
2116
+ $position = $positions[ $product->getId() ];
2117
+ foreach( $prodNames as $prodName ){
2118
+ $ProducttoString .= $prodName //ProductKey
2119
+ . "\t" . $prodName //Product Name
2120
+ . "\t" . $position //Prod Sequence
2121
+ . "\tGeneral" //Proj Name
2122
+ . "\t" . $hpath //Hirarachi Path
2123
+ . "\t" //Proj Flag
2124
+ . "\t" //Proj Prod layout
2125
+ . "\n";
2126
+ $position += 0.001;
2127
+ }
2128
+ $listed = TRUE;
2129
+ }
2130
+ }
2131
+ if( !$listed ){
2132
+ foreach( $prodNames as $prodName ){
2133
+ $ProducttoString .= $prodName //ProductKey
2134
+ . "\t" . $prodName //Product Name
2135
+ . "\t" . $this->unCatPosition //Prod Sequence
2136
+ . "\tGeneral" //Proj Name
2137
+ . "\tUncategorized" //Hirarachi Path
2138
+ . "\t" //Proj Flag
2139
+ . "\t" //Proj Prod layout
2140
+ . "\n";
2141
+ $this->unCatPosition++;
2142
+ }
2143
+ }
2144
+ return $ProducttoString;
2145
+ }
2146
+
2147
  private function CatalogProjectStringConfigurable( &$product ){
2148
  $UsedProductIds = $this->productTypeConfigurableModel->getUsedProductIds($product);
2149
  $countUsedProductIds = count( $UsedProductIds );
app/code/community/Mage/CodiScript/controllers/IndexController.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- define("__VERSION__","2015-04-27");
3
  define("__SCRIPTNAME__",basename(__FILE__));
4
 
5
  class Mage_CodiScript_IndexController extends Mage_Core_Controller_Front_Action{
@@ -81,6 +81,7 @@ if( $Class=="DataFile" ){
81
  $importoptionsasattributes = ( isset( $_REQUEST["importoptionsasattributes"] ) && $_REQUEST["importoptionsasattributes"] == "1" );
82
  $importoptionsassku = ( isset($_REQUEST["importoptionsassku"]) && $_REQUEST["importoptionsassku"] == "1" );
83
  $instockonly = isset($_REQUEST["instockonly"])? trim( $_REQUEST["instockonly"] ) : FALSE;
 
84
  $start = isset( $_REQUEST["start"] ) ? intval( $_REQUEST["start"] ) : 0;
85
  $pageSize = isset( $_REQUEST["pageSize"] ) ? intval( $_REQUEST["pageSize"] ) : 1000000000;
86
  if( $_DEBUG ) echo "enablereviews=".$enablereviews."
@@ -104,6 +105,7 @@ includecustomfields=".( $includecustomfields ? implode( ",", array_keys( $includ
104
  importoptionsasattributes=".$importoptionsasattributes."
105
  importoptionsassku=".$importoptionsassku."
106
  instockonly=".$instockonly."
 
107
  start=".$start."
108
  pageSize=".$pageSize."
109
  ";
@@ -114,6 +116,7 @@ pageSize=".$pageSize."
114
  } else if( $Class=="CatalogProject" ){
115
  $ignoretopcategory = ( isset($_REQUEST["ignoretopcategory"]) && $_REQUEST["ignoretopcategory"] == "1" );
116
  $instockonly = isset($_REQUEST["instockonly"])? trim( $_REQUEST["instockonly"] ) : FALSE;
 
117
  $start = isset($_REQUEST["start"]) ? intval( $_REQUEST["start"] ) : 0;
118
  $pageSize = isset($_REQUEST["pageSize"]) ? intval( $_REQUEST["pageSize"] ) : 1000000000;
119
  if($_DEBUG) echo "ignoretopcategory=".$ignoretopcategory."
@@ -191,6 +194,7 @@ if( $Class=="DataFile" ){
191
  $cfModel->importoptionsasattributes = $importoptionsasattributes;
192
  $cfModel->importoptionsassku = $importoptionsassku;
193
  $cfModel->instockonly = $instockonly;
 
194
  $cfModel->start = $start;
195
  $cfModel->pageSize = $pageSize;
196
  if($cfModel->includetaxes)
@@ -200,6 +204,7 @@ if( $Class=="DataFile" ){
200
  } else if( $Class=="CatalogProject" ){
201
  $cfModel->ignoretopcategory = $ignoretopcategory;
202
  $cfModel->instockonly = $instockonly;
 
203
  $cfModel->start = $start;
204
  $cfModel->pageSize = $pageSize;
205
  }
@@ -236,6 +241,9 @@ executed in ".( time() - $started_time )." sec.
236
  ";
237
  die();
238
  /* RELEASE NOTES
 
 
 
239
  * 2015-04-27
240
  * Added rendering of group tier prices in case of "Get group prices" and "Publish tiered pricing" both checked
241
  *
1
  <?php
2
+ define("__VERSION__","2015-05-08");
3
  define("__SCRIPTNAME__",basename(__FILE__));
4
 
5
  class Mage_CodiScript_IndexController extends Mage_Core_Controller_Front_Action{
81
  $importoptionsasattributes = ( isset( $_REQUEST["importoptionsasattributes"] ) && $_REQUEST["importoptionsasattributes"] == "1" );
82
  $importoptionsassku = ( isset($_REQUEST["importoptionsassku"]) && $_REQUEST["importoptionsassku"] == "1" );
83
  $instockonly = isset($_REQUEST["instockonly"])? trim( $_REQUEST["instockonly"] ) : FALSE;
84
+ $splitgroupedproducts = isset($_REQUEST["splitgroupedproducts"])? trim( $_REQUEST["splitgroupedproducts"] ) : FALSE;
85
  $start = isset( $_REQUEST["start"] ) ? intval( $_REQUEST["start"] ) : 0;
86
  $pageSize = isset( $_REQUEST["pageSize"] ) ? intval( $_REQUEST["pageSize"] ) : 1000000000;
87
  if( $_DEBUG ) echo "enablereviews=".$enablereviews."
105
  importoptionsasattributes=".$importoptionsasattributes."
106
  importoptionsassku=".$importoptionsassku."
107
  instockonly=".$instockonly."
108
+ splitgroupedproducts=".$splitgroupedproducts."
109
  start=".$start."
110
  pageSize=".$pageSize."
111
  ";
116
  } else if( $Class=="CatalogProject" ){
117
  $ignoretopcategory = ( isset($_REQUEST["ignoretopcategory"]) && $_REQUEST["ignoretopcategory"] == "1" );
118
  $instockonly = isset($_REQUEST["instockonly"])? trim( $_REQUEST["instockonly"] ) : FALSE;
119
+ $splitgroupedproducts = isset($_REQUEST["splitgroupedproducts"])? trim( $_REQUEST["splitgroupedproducts"] ) : FALSE;
120
  $start = isset($_REQUEST["start"]) ? intval( $_REQUEST["start"] ) : 0;
121
  $pageSize = isset($_REQUEST["pageSize"]) ? intval( $_REQUEST["pageSize"] ) : 1000000000;
122
  if($_DEBUG) echo "ignoretopcategory=".$ignoretopcategory."
194
  $cfModel->importoptionsasattributes = $importoptionsasattributes;
195
  $cfModel->importoptionsassku = $importoptionsassku;
196
  $cfModel->instockonly = $instockonly;
197
+ $cfModel->splitgroupedproducts = $splitgroupedproducts;
198
  $cfModel->start = $start;
199
  $cfModel->pageSize = $pageSize;
200
  if($cfModel->includetaxes)
204
  } else if( $Class=="CatalogProject" ){
205
  $cfModel->ignoretopcategory = $ignoretopcategory;
206
  $cfModel->instockonly = $instockonly;
207
+ $cfModel->splitgroupedproducts = $splitgroupedproducts;
208
  $cfModel->start = $start;
209
  $cfModel->pageSize = $pageSize;
210
  }
241
  ";
242
  die();
243
  /* RELEASE NOTES
244
+ * 2015-05-08
245
+ * Added rendering of products associated with grouped prodict as separate products
246
+ *
247
  * 2015-04-27
248
  * Added rendering of group tier prices in case of "Get group prices" and "Publish tiered pricing" both checked
249
  *
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_Codi</name>
4
- <version>4.2.5</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Extension to connect to the Catalog-on-Demand service for making print catalogs, brochures, and flyers.</description>
11
  <notes>Please contact our support desk if you have any problems.</notes>
12
  <authors><author><name>catalogondemand</name><user>auto-converted</user><email>timh@catalog-on-demand.com</email></author></authors>
13
- <date>2015-04-27</date>
14
- <time>22:05:59</time>
15
- <contents><target name="magecommunity"><dir name="Mage"><dir name="CodiScript"><dir name="Helper"><file name="Data.php" hash="3f99660cb06a9dc09f024b9993d43a3f"/></dir><dir name="Model"><file name="Files.php" hash="c7a925b0fed1463285100af77190b475"/></dir><dir name="controllers"><file name="IndexController.php" hash="6fe00f8f97ee8389036194d96b3ad028"/></dir><dir name="etc"><file name="adminhtml.xml" hash="40ab0bd86928c5ba175988926a9f6aee"/><file name="config.xml" hash="b960e9bd106f0c94559baa2bc5761e18"/><file name="system.xml" hash="1b5e5b18bfdce6b85e304fb4ef877274"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_CodiScript.xml" hash="f0502cac7918fc798b3b02d3d4b7e7fd"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="codiscript.xml" hash="066f99333a6054e11943a75413f65ff0"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="codi"><file name="password_validation.js" hash="7223aeed118bb5774c73f951460ae0b0"/></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Mage_CodiScript.csv" hash="183fc591065ced83f878a4c3e23f854c"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_Codi</name>
4
+ <version>4.2.6</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
10
  <description>Extension to connect to the Catalog-on-Demand service for making print catalogs, brochures, and flyers.</description>
11
  <notes>Please contact our support desk if you have any problems.</notes>
12
  <authors><author><name>catalogondemand</name><user>auto-converted</user><email>timh@catalog-on-demand.com</email></author></authors>
13
+ <date>2015-05-08</date>
14
+ <time>12:35:04</time>
15
+ <contents><target name="magecommunity"><dir name="Mage"><dir name="CodiScript"><dir name="Helper"><file name="Data.php" hash="3f99660cb06a9dc09f024b9993d43a3f"/></dir><dir name="Model"><file name="Files.php" hash="94ff1a30086e35ce29631092de844b07"/></dir><dir name="controllers"><file name="IndexController.php" hash="7ca7661ffe4eb29095f827dc9b66dd07"/></dir><dir name="etc"><file name="adminhtml.xml" hash="40ab0bd86928c5ba175988926a9f6aee"/><file name="config.xml" hash="b960e9bd106f0c94559baa2bc5761e18"/><file name="system.xml" hash="1b5e5b18bfdce6b85e304fb4ef877274"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_CodiScript.xml" hash="f0502cac7918fc798b3b02d3d4b7e7fd"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="codiscript.xml" hash="066f99333a6054e11943a75413f65ff0"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="codi"><file name="password_validation.js" hash="7223aeed118bb5774c73f951460ae0b0"/></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Mage_CodiScript.csv" hash="183fc591065ced83f878a4c3e23f854c"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>