Mage_Codi - Version 4.1.5

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.1.5
Comparing to
See all releases


Code changes from version 4.1.4 to 4.1.5

app/code/community/Mage/CodiScript/Model/Files.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- // 2014-04-01
3
  class ConfiguredProductLine{
4
  public $optionIds = array();
5
  public $line = NULL;
@@ -27,6 +27,7 @@ class Mage_CodiScript_Model_Files extends Mage_Core_Model_Abstract {
27
  public $ignoreexcludedimages = FALSE;
28
  public $ignoreassprodimages = FALSE;
29
  public $includecustomfields = FALSE;
 
30
  public $start = 0;
31
  public $pageSize = 1000000000;
32
  public $address = FALSE;
@@ -551,13 +552,44 @@ memory_get_usage ".memory_get_usage()." / ".memory_get_usage(TRUE)."
551
  echo "
552
  ";
553
  }
 
 
 
 
554
  $ConfigurableAttributes = $product->getTypeInstance( true )->getConfigurableAttributes( $product );
555
- if($this->_DEBUG){
556
- foreach( $ConfigurableAttributes as $attribute ){
557
- $configurableProdAttribute = $attribute->getProductAttribute();
558
- foreach ( $configurableProdAttribute->getSource()->getAllOptions() as $option )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
559
  echo "variation option: ".$option['value' ]."=>".$option['label' ]."
560
  ";
 
 
 
 
 
 
 
 
561
  }
562
  }
563
  $UsedProducts = array();
@@ -589,7 +621,6 @@ memory_get_usage ".memory_get_usage()." / ".memory_get_usage(TRUE)."
589
  $attributes = $UsedProduct->getAttributes();
590
  $ItemAttributes = "";
591
  foreach( $ConfigurableAttributes as $attribute ){
592
- $attribute->setStoreId( $this->StoreId );
593
  $configurableProdAttribute = $attribute->getProductAttribute();
594
  if( empty( $configurableProdAttribute ) ){
595
  $label = $attribute->getLabel();
@@ -609,6 +640,9 @@ memory_get_usage ".memory_get_usage()." / ".memory_get_usage(TRUE)."
609
  break;
610
  }
611
  }
 
 
 
612
  if($this->_DEBUG) echo "config attr code=".$AttributeCode." label=".$AttributeLabel." id=".$AttribId." value=".$AttributeValue."
613
  ";
614
  if( !empty( $ItemAttributes ) )
@@ -716,16 +750,7 @@ memory_get_usage ".memory_get_usage()." / ".memory_get_usage(TRUE)."
716
  ."\t" //ItemDescription
717
  ."\t" //ItemLink
718
  ."\t" .$this->_cleanStr( $ItemAttributes ) //ItemAttributes
719
- ."\t" .$itemImages //ItemitemGraphic
720
- ."\t" .$productName //ProductName
721
- ."\t" .$ProductDescription
722
- ."\t" .$prodImages //ProductGraphic
723
- ."\t" .$ProductURL //ProductLink
724
- ."\t" .$ProductAttributes //ProductAttributes
725
- ."\t" .$Manufacturer //Manufacturer
726
- ."\t" //Category
727
- ."\t" .$Reviews //Reviews
728
- ."\t" .$shortDescription;
729
  $cpLines[] = $cpLine;
730
  unset( $UsedProduct );
731
  }
@@ -754,6 +779,35 @@ memory_get_usage ".memory_get_usage()." / ".memory_get_usage(TRUE)."
754
  $this->_fill( $attrNumber, $optNumbers, $optionIds, $optionIds2 );
755
  // if( $this->_DEBUG ) foreach( $optionIds2 as $optionIdLine ) echo "ordered option ids: ".var_export( $optionIdLine, true )."
756
  //";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
757
  $ProducttoString = "";
758
  $sequence = 1;
759
  foreach( $optionIds2 as $optionIdLine ){
@@ -772,7 +826,8 @@ memory_get_usage ".memory_get_usage()." / ".memory_get_usage(TRUE)."
772
  // if( $this->_DEBUG ) echo "option ids: ".var_export( $cpLine->optionIds, true )."
773
  //";
774
  $ProducttoString .= $cpLine->line
775
- ."\t". $sequence
 
776
  ."\n";
777
  $cpLine->line = FALSE;
778
  $sequence++;
1
  <?php
2
+ // 2014-08-06
3
  class ConfiguredProductLine{
4
  public $optionIds = array();
5
  public $line = NULL;
27
  public $ignoreexcludedimages = FALSE;
28
  public $ignoreassprodimages = FALSE;
29
  public $includecustomfields = FALSE;
30
+ public $importoptionsasattributes = FALSE;
31
  public $start = 0;
32
  public $pageSize = 1000000000;
33
  public $address = FALSE;
552
  echo "
553
  ";
554
  }
555
+ $usedConfigurableAttributes = FALSE;
556
+ if( $this->importoptionsasattributes ){
557
+ $usedConfigurableAttributes = array();
558
+ }
559
  $ConfigurableAttributes = $product->getTypeInstance( true )->getConfigurableAttributes( $product );
560
+ foreach( $ConfigurableAttributes as $attribute ){
561
+ $attribute->setStoreId( $this->StoreId );
562
+ $configurableProdAttribute = $attribute->getProductAttribute();
563
+ if( empty( $configurableProdAttribute ) ){
564
+ $label = $attribute->getLabel();
565
+ echo "WARNING: no product attribute for configurable attribute ".$label."
566
+ ";
567
+ continue;
568
+ }
569
+ $AttributeLabel = $configurableProdAttribute->getFrontend()->getLabel();
570
+ if($this->_DEBUG){
571
+ echo "configurable prod attr: ".$AttributeLabel."
572
+ ";
573
+ }
574
+ if( $this->importoptionsasattributes ){
575
+ $usedConfigurableAttributes[ $AttributeLabel ] = array();
576
+ if($this->_DEBUG){
577
+ echo "created usedConfigurableAttributes array for \"".$AttributeLabel."\"
578
+ ";
579
+ }
580
+ }
581
+ foreach ( $configurableProdAttribute->getSource()->getAllOptions() as $option ) {
582
+ if($this->_DEBUG){
583
  echo "variation option: ".$option['value' ]."=>".$option['label' ]."
584
  ";
585
+ }
586
+ if( $this->importoptionsasattributes ){
587
+ $usedConfigurableAttributes[ $AttributeLabel ][ $option['label' ] ] = FALSE;
588
+ if($this->_DEBUG){
589
+ echo "created usedConfigurableAttributes label \"".$option['label' ]."\"
590
+ ";
591
+ }
592
+ }
593
  }
594
  }
595
  $UsedProducts = array();
621
  $attributes = $UsedProduct->getAttributes();
622
  $ItemAttributes = "";
623
  foreach( $ConfigurableAttributes as $attribute ){
 
624
  $configurableProdAttribute = $attribute->getProductAttribute();
625
  if( empty( $configurableProdAttribute ) ){
626
  $label = $attribute->getLabel();
640
  break;
641
  }
642
  }
643
+ if( $this->importoptionsasattributes && trim( $AttributeValue ) ){
644
+ $usedConfigurableAttributes[ $AttributeLabel ][ $AttributeValue ] = TRUE;
645
+ }
646
  if($this->_DEBUG) echo "config attr code=".$AttributeCode." label=".$AttributeLabel." id=".$AttribId." value=".$AttributeValue."
647
  ";
648
  if( !empty( $ItemAttributes ) )
750
  ."\t" //ItemDescription
751
  ."\t" //ItemLink
752
  ."\t" .$this->_cleanStr( $ItemAttributes ) //ItemAttributes
753
+ ."\t" .$itemImages; //ItemitemGraphic
 
 
 
 
 
 
 
 
 
754
  $cpLines[] = $cpLine;
755
  unset( $UsedProduct );
756
  }
779
  $this->_fill( $attrNumber, $optNumbers, $optionIds, $optionIds2 );
780
  // if( $this->_DEBUG ) foreach( $optionIds2 as $optionIdLine ) echo "ordered option ids: ".var_export( $optionIdLine, true )."
781
  //";
782
+ // supplement prod attrs
783
+ if( $this->importoptionsasattributes ){
784
+ foreach ( $usedConfigurableAttributes as $attrName => $attrValues ){
785
+ if( !empty( $ProductAttributes ) )
786
+ $ProductAttributes .= "|";
787
+ $ProductAttributes .= $attrName."=";
788
+ $valCount = 0;
789
+ foreach ( $attrValues as $attrValue => $used ){
790
+ if( $used ){
791
+ if( $valCount > 0 ){
792
+ $ProductAttributes .= "<br />";
793
+ }
794
+ $ProductAttributes .= $attrValue;
795
+ $valCount++;
796
+ }
797
+ }
798
+ }
799
+ }
800
+ // build prod part
801
+ $prodLine = "\t" .$productName //ProductName
802
+ ."\t" .$ProductDescription
803
+ ."\t" .$prodImages //ProductGraphic
804
+ ."\t" .$ProductURL //ProductLink
805
+ ."\t" .$ProductAttributes //ProductAttributes
806
+ ."\t" .$Manufacturer //Manufacturer
807
+ ."\t" //Category
808
+ ."\t" .$Reviews //Reviews
809
+ ."\t" .$shortDescription
810
+ ."\t";
811
  $ProducttoString = "";
812
  $sequence = 1;
813
  foreach( $optionIds2 as $optionIdLine ){
826
  // if( $this->_DEBUG ) echo "option ids: ".var_export( $cpLine->optionIds, true )."
827
  //";
828
  $ProducttoString .= $cpLine->line
829
+ .$prodLine
830
+ .$sequence
831
  ."\n";
832
  $cpLine->line = FALSE;
833
  $sequence++;
app/code/community/Mage/CodiScript/controllers/IndexController.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- define("__VERSION__","2014-04-01");
3
  define("__SCRIPTNAME__",basename(__FILE__));
4
 
5
  class Mage_CodiScript_IndexController extends Mage_Core_Controller_Front_Action{
@@ -77,6 +77,7 @@ if( $Class=="DataFile" ){
77
  $includecustomfields[ strtolower( $part ) ] = TRUE;
78
  }
79
  }
 
80
  $start = isset($_REQUEST["start"]) ? intval( $_REQUEST["start"] ) : 0;
81
  $pageSize = isset($_REQUEST["pageSize"]) ? intval( $_REQUEST["pageSize"] ) : 1000000000;
82
  if($_DEBUG) echo "enablereviews=".$enablereviews."
@@ -96,6 +97,7 @@ includespecialpricedateto=".$includespecialpricedateto."
96
  ignoreexcludedimages=".$ignoreexcludedimages."
97
  ignoreassprodimages=".$ignoreassprodimages."
98
  includecustomfields=".( $includecustomfields ? implode( ",", array_keys( $includecustomfields ) ) : $includecustomfields )."
 
99
  start=".$start."
100
  pageSize=".$pageSize."
101
  ";
@@ -175,6 +177,7 @@ if($Class=="DataFile"){
175
  $cfModel->ignoreexcludedimages = $ignoreexcludedimages;
176
  $cfModel->ignoreassprodimages = $ignoreassprodimages;
177
  $cfModel->includecustomfields = $includecustomfields;
 
178
  $cfModel->start = $start;
179
  $cfModel->pageSize = $pageSize;
180
  if($cfModel->includetaxes)
@@ -219,6 +222,9 @@ executed in ".( time() - $started_time )." sec.
219
  ";
220
  die();
221
  /* RELEASE NOTES
 
 
 
222
  * 2014-04-01
223
  * 1. Group prices retrieval implemented (Magento 1.7+)
224
  * 2. Obsoleted getpricefromchild option
1
  <?php
2
+ define("__VERSION__","2014-08-06");
3
  define("__SCRIPTNAME__",basename(__FILE__));
4
 
5
  class Mage_CodiScript_IndexController extends Mage_Core_Controller_Front_Action{
77
  $includecustomfields[ strtolower( $part ) ] = TRUE;
78
  }
79
  }
80
+ $importoptionsasattributes = ( isset($_REQUEST["importoptionsasattributes"]) && $_REQUEST["importoptionsasattributes"] == "1" );
81
  $start = isset($_REQUEST["start"]) ? intval( $_REQUEST["start"] ) : 0;
82
  $pageSize = isset($_REQUEST["pageSize"]) ? intval( $_REQUEST["pageSize"] ) : 1000000000;
83
  if($_DEBUG) echo "enablereviews=".$enablereviews."
97
  ignoreexcludedimages=".$ignoreexcludedimages."
98
  ignoreassprodimages=".$ignoreassprodimages."
99
  includecustomfields=".( $includecustomfields ? implode( ",", array_keys( $includecustomfields ) ) : $includecustomfields )."
100
+ importoptionsasattributes=".$importoptionsasattributes."
101
  start=".$start."
102
  pageSize=".$pageSize."
103
  ";
177
  $cfModel->ignoreexcludedimages = $ignoreexcludedimages;
178
  $cfModel->ignoreassprodimages = $ignoreassprodimages;
179
  $cfModel->includecustomfields = $includecustomfields;
180
+ $cfModel->importoptionsasattributes = $importoptionsasattributes;
181
  $cfModel->start = $start;
182
  $cfModel->pageSize = $pageSize;
183
  if($cfModel->includetaxes)
222
  ";
223
  die();
224
  /* RELEASE NOTES
225
+ * 2014-08-06
226
+ * 1. Added importoptionsasattributes option / processing
227
+ *
228
  * 2014-04-01
229
  * 1. Group prices retrieval implemented (Magento 1.7+)
230
  * 2. Obsoleted getpricefromchild option
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_Codi</name>
4
- <version>4.1.4</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>2014-04-14</date>
14
- <time>21:54:05</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="f78c0934848688fd4182292eda9dd2ed"/></dir><dir name="controllers"><file name="IndexController.php" hash="2e93cf805b354d2b2215d8996098dd89"/></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.1.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
  <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>2014-08-07</date>
14
+ <time>21:24:42</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="ac6849b70ed3a7cdc0c7761a1d070672"/></dir><dir name="controllers"><file name="IndexController.php" hash="dab7d64910993ce8d38edfc120eabc58"/></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>