Mage_Codi - Version 4.0.3

Version Notes

Adds ability to optionally include long description. Please contact our support desk if you have any problems.

Download this release

Release Info

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


Code changes from version 4.0.2 to 4.0.3

app/code/community/Mage/CodiScript/Model/Files.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  class Mage_CodiScript_Model_Files extends Mage_Core_Model_Abstract {
3
  public $version = VERSION;
4
  public $Store;
@@ -9,6 +10,7 @@ class Mage_CodiScript_Model_Files extends Mage_Core_Model_Abstract {
9
  public $enablereviews = FALSE;
10
  public $ignoretopcategory = FALSE;
11
  public $includeshortdescription = FALSE;
 
12
  public $getpricefromfromchild = FALSE;
13
  public $publishtieredpricing = FALSE;
14
  public $includetaxes = FALSE;
@@ -76,30 +78,34 @@ memory_get_usage ".memory_get_usage()." / ".memory_get_usage(TRUE)."
76
  $ProducttoString = "";
77
  $AssociatedProductIds = $this->productTypeGroupedModel->getAssociatedProductIds( $product );
78
  $ProductDescription = "";
79
- $shortDescription = $product->getShortDescription();
80
- if( !empty( $shortDescription ) ){
81
- $shortDescription = $this->cleanStr( $shortDescription );
82
- if( strpos( $shortDescription, self::TAG_P ) !== false ){
83
- $new = strlen( $shortDescription );
84
- $pos = strrpos( $shortDescription, self::TAG_P_CLOSE ) + 4;
85
- if( $new != $pos )
86
- $shortDescription = substr( $shortDescription, 0, $pos ).self::TAG_P.substr( $shortDescription, $pos ).self::TAG_P_CLOSE;
87
- } else
88
- $shortDescription = self::TAG_P.$shortDescription .self::TAG_P_CLOSE;
 
 
 
 
89
  }
90
- if( $this->includeshortdescription && !empty( $shortDescription ) )
91
- $ProductDescription = $shortDescription;
92
- $longDescription = $product->getDescription();
93
- if( !empty( $longDescription ) ){
94
- $longDescription = $this->cleanStr( $longDescription );
95
- if( strpos( $longDescription, self::TAG_P ) !== false ){
96
- $new = strlen( $longDescription );
97
- $pos = strrpos( $longDescription, self::TAG_P_CLOSE ) + 4;
98
- if( $new != $pos )
99
- $longDescription = substr( $longDescription, 0, $pos ).self::TAG_P.substr( $longDescription, $pos ).self::TAG_P_CLOSE;
100
- } else
101
- $longDescription = self::TAG_P.$longDescription.self::TAG_P_CLOSE;
102
- $ProductDescription .= $longDescription;
103
  }
104
  $attributes = $product->getAttributes();
105
  $Manufacturer = "";
@@ -227,30 +233,34 @@ item thumbnail : ".$UsedProduct->getThumbnail()."
227
  $ProducttoString = "";
228
  $UsedProductIds = $this->productTypeConfigurableModel->getUsedProductIds($product);
229
  $ProductDescription = "";
230
- $shortDescription = $product->getShortDescription();
231
- if( !empty( $shortDescription ) ){
232
- $shortDescription = $this->cleanStr( $shortDescription );
233
- if( strpos( $shortDescription, self::TAG_P ) !== false ){
234
- $new = strlen( $shortDescription );
235
- $pos = strrpos( $shortDescription, self::TAG_P_CLOSE ) + 4;
236
- if( $new != $pos )
237
- $shortDescription = substr( $shortDescription, 0, $pos ).self::TAG_P.substr( $shortDescription, $pos ).self::TAG_P_CLOSE;
238
- } else
239
- $shortDescription = self::TAG_P.$shortDescription .self::TAG_P_CLOSE;
 
 
 
 
240
  }
241
- if( $this->includeshortdescription && !empty( $shortDescription ) )
242
- $ProductDescription = $shortDescription;
243
- $longDescription = $product->getDescription();
244
- if( !empty( $longDescription ) ){
245
- $longDescription = $this->cleanStr( $longDescription );
246
- if( strpos( $longDescription, self::TAG_P ) !== false ){
247
- $new = strlen( $longDescription );
248
- $pos = strrpos( $longDescription, self::TAG_P_CLOSE ) + 4;
249
- if( $new != $pos )
250
- $longDescription = substr( $longDescription, 0, $pos ).self::TAG_P.substr( $longDescription, $pos ).self::TAG_P_CLOSE;
251
- } else
252
- $longDescription = self::TAG_P.$longDescription.self::TAG_P_CLOSE;
253
- $ProductDescription .= $longDescription;
254
  }
255
  $attributes = $product->getAttributes();
256
  $Manufacturer = "";
@@ -392,30 +402,34 @@ item thumbnail : ".$UsedProduct->getThumbnail()."
392
  }
393
  public function ProducttoStringSimple( &$product ){
394
  $ProductDescription = "";
395
- $shortDescription = $product->getShortDescription();
396
- if( !empty( $shortDescription ) ){
397
- $shortDescription = $this->cleanStr( $shortDescription );
398
- if( strpos( $shortDescription, self::TAG_P ) !== false ){
399
- $new = strlen( $shortDescription );
400
- $pos = strrpos( $shortDescription, self::TAG_P_CLOSE ) + 4;
401
- if( $new != $pos )
402
- $shortDescription = substr( $shortDescription, 0, $pos ).self::TAG_P.substr( $shortDescription, $pos ).self::TAG_P_CLOSE;
403
- } else
404
- $shortDescription = self::TAG_P.$shortDescription .self::TAG_P_CLOSE;
 
 
 
 
405
  }
406
- if( $this->includeshortdescription && !empty( $shortDescription ) )
407
- $ProductDescription = $shortDescription;
408
- $longDescription = $product->getDescription();
409
- if( !empty( $longDescription ) ){
410
- $longDescription = $this->cleanStr( $longDescription );
411
- if( strpos( $longDescription, self::TAG_P ) !== false ){
412
- $new = strlen( $longDescription );
413
- $pos = strrpos( $longDescription, self::TAG_P_CLOSE ) + 4;
414
- if( $new != $pos )
415
- $longDescription = substr( $longDescription, 0, $pos ).self::TAG_P.substr( $longDescription, $pos ).self::TAG_P_CLOSE;
416
- } else
417
- $longDescription = self::TAG_P.$longDescription.self::TAG_P_CLOSE;
418
- $ProductDescription .= $longDescription;
419
  }
420
  if($this->_DEBUG) echo "product image : ".$product->getImage()."
421
  product small image: ".$product->getSmallImage()."
1
  <?php
2
+ // 2013-02-04
3
  class Mage_CodiScript_Model_Files extends Mage_Core_Model_Abstract {
4
  public $version = VERSION;
5
  public $Store;
10
  public $enablereviews = FALSE;
11
  public $ignoretopcategory = FALSE;
12
  public $includeshortdescription = FALSE;
13
+ public $includelongdescription = TRUE;
14
  public $getpricefromfromchild = FALSE;
15
  public $publishtieredpricing = FALSE;
16
  public $includetaxes = FALSE;
78
  $ProducttoString = "";
79
  $AssociatedProductIds = $this->productTypeGroupedModel->getAssociatedProductIds( $product );
80
  $ProductDescription = "";
81
+ $shortDescription = "";
82
+ if( $this->includeshortdescription ){
83
+ $shortDescription = $product->getShortDescription();
84
+ if( !empty( $shortDescription ) ){
85
+ $shortDescription = $this->cleanStr( $shortDescription );
86
+ if( strpos( $shortDescription, self::TAG_P ) !== false ){
87
+ $new = strlen( $shortDescription );
88
+ $pos = strrpos( $shortDescription, self::TAG_P_CLOSE ) + 4;
89
+ if( $new != $pos )
90
+ $shortDescription = substr( $shortDescription, 0, $pos ).self::TAG_P.substr( $shortDescription, $pos ).self::TAG_P_CLOSE;
91
+ } else
92
+ $shortDescription = self::TAG_P.$shortDescription .self::TAG_P_CLOSE;
93
+ $ProductDescription = $shortDescription;
94
+ }
95
  }
96
+ if( $this->includelongdescription ){
97
+ $longDescription = $product->getDescription();
98
+ if( !empty( $longDescription ) ){
99
+ $longDescription = $this->cleanStr( $longDescription );
100
+ if( strpos( $longDescription, self::TAG_P ) !== false ){
101
+ $new = strlen( $longDescription );
102
+ $pos = strrpos( $longDescription, self::TAG_P_CLOSE ) + 4;
103
+ if( $new != $pos )
104
+ $longDescription = substr( $longDescription, 0, $pos ).self::TAG_P.substr( $longDescription, $pos ).self::TAG_P_CLOSE;
105
+ } else
106
+ $longDescription = self::TAG_P.$longDescription.self::TAG_P_CLOSE;
107
+ $ProductDescription .= $longDescription;
108
+ }
109
  }
110
  $attributes = $product->getAttributes();
111
  $Manufacturer = "";
233
  $ProducttoString = "";
234
  $UsedProductIds = $this->productTypeConfigurableModel->getUsedProductIds($product);
235
  $ProductDescription = "";
236
+ $shortDescription = "";
237
+ if( $this->includeshortdescription ){
238
+ $shortDescription = $product->getShortDescription();
239
+ if( !empty( $shortDescription ) ){
240
+ $shortDescription = $this->cleanStr( $shortDescription );
241
+ if( strpos( $shortDescription, self::TAG_P ) !== false ){
242
+ $new = strlen( $shortDescription );
243
+ $pos = strrpos( $shortDescription, self::TAG_P_CLOSE ) + 4;
244
+ if( $new != $pos )
245
+ $shortDescription = substr( $shortDescription, 0, $pos ).self::TAG_P.substr( $shortDescription, $pos ).self::TAG_P_CLOSE;
246
+ } else
247
+ $shortDescription = self::TAG_P.$shortDescription .self::TAG_P_CLOSE;
248
+ $ProductDescription = $shortDescription;
249
+ }
250
  }
251
+ if( $this->includelongdescription ){
252
+ $longDescription = $product->getDescription();
253
+ if( !empty( $longDescription ) ){
254
+ $longDescription = $this->cleanStr( $longDescription );
255
+ if( strpos( $longDescription, self::TAG_P ) !== false ){
256
+ $new = strlen( $longDescription );
257
+ $pos = strrpos( $longDescription, self::TAG_P_CLOSE ) + 4;
258
+ if( $new != $pos )
259
+ $longDescription = substr( $longDescription, 0, $pos ).self::TAG_P.substr( $longDescription, $pos ).self::TAG_P_CLOSE;
260
+ } else
261
+ $longDescription = self::TAG_P.$longDescription.self::TAG_P_CLOSE;
262
+ $ProductDescription .= $longDescription;
263
+ }
264
  }
265
  $attributes = $product->getAttributes();
266
  $Manufacturer = "";
402
  }
403
  public function ProducttoStringSimple( &$product ){
404
  $ProductDescription = "";
405
+ $shortDescription = "";
406
+ if( $this->includeshortdescription ){
407
+ $shortDescription = $product->getShortDescription();
408
+ if( !empty( $shortDescription ) ){
409
+ $shortDescription = $this->cleanStr( $shortDescription );
410
+ if( strpos( $shortDescription, self::TAG_P ) !== false ){
411
+ $new = strlen( $shortDescription );
412
+ $pos = strrpos( $shortDescription, self::TAG_P_CLOSE ) + 4;
413
+ if( $new != $pos )
414
+ $shortDescription = substr( $shortDescription, 0, $pos ).self::TAG_P.substr( $shortDescription, $pos ).self::TAG_P_CLOSE;
415
+ } else
416
+ $shortDescription = self::TAG_P.$shortDescription .self::TAG_P_CLOSE;
417
+ $ProductDescription = $shortDescription;
418
+ }
419
  }
420
+ if( $this->includelongdescription ){
421
+ $longDescription = $product->getDescription();
422
+ if( !empty( $longDescription ) ){
423
+ $longDescription = $this->cleanStr( $longDescription );
424
+ if( strpos( $longDescription, self::TAG_P ) !== false ){
425
+ $new = strlen( $longDescription );
426
+ $pos = strrpos( $longDescription, self::TAG_P_CLOSE ) + 4;
427
+ if( $new != $pos )
428
+ $longDescription = substr( $longDescription, 0, $pos ).self::TAG_P.substr( $longDescription, $pos ).self::TAG_P_CLOSE;
429
+ } else
430
+ $longDescription = self::TAG_P.$longDescription.self::TAG_P_CLOSE;
431
+ $ProductDescription .= $longDescription;
432
+ }
433
  }
434
  if($this->_DEBUG) echo "product image : ".$product->getImage()."
435
  product small image: ".$product->getSmallImage()."
app/code/community/Mage/CodiScript/controllers/IndexController.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- define("VERSION","2012-12-07");
3
 
4
  class Mage_CodiScript_IndexController extends Mage_Core_Controller_Front_Action{
5
  public function indexAction(){
@@ -51,6 +51,7 @@ if( $Class=="DataFile" ){
51
  $enablereviews = ( isset($_REQUEST["enablereviews"]) && $_REQUEST["enablereviews"] == "1" );
52
  $ignoretopcategory = ( isset($_REQUEST["ignoretopcategory"]) && $_REQUEST["ignoretopcategory"] == "1" );
53
  $includeshortdescription = ( isset($_REQUEST["includeshortdescription"]) && $_REQUEST["includeshortdescription"] == "1" );
 
54
  $getpricefromfromchild = ( isset($_REQUEST["getpricefromfromchild"]) && $_REQUEST["getpricefromfromchild"] == "1" );
55
  $publishtieredpricing = ( isset($_REQUEST["publishtieredpricing"]) && $_REQUEST["publishtieredpricing"] == "1" );
56
  $quantitylabel = isset($_REQUEST["quantitylabel"]) ? $_REQUEST["quantitylabel"] : "Quantity";
@@ -61,6 +62,7 @@ if( $Class=="DataFile" ){
61
  if($_DEBUG) echo "enablereviews=".$enablereviews."
62
  ignoretopcategory=".$ignoretopcategory."
63
  includeshortdescription=".$includeshortdescription."
 
64
  getpricefromfromchild=".$getpricefromfromchild."
65
  publishtieredpricing=".$publishtieredpricing."
66
  quantitylabel=".$quantitylabel."
@@ -129,6 +131,7 @@ if($Class=="DataFile"){
129
  $cfModel->enablereviews = $enablereviews;
130
  $cfModel->ignoretopcategory = $ignoretopcategory;
131
  $cfModel->includeshortdescription = $includeshortdescription;
 
132
  $cfModel->getpricefromfromchild = $getpricefromfromchild;
133
  $cfModel->publishtieredpricing = $publishtieredpricing;
134
  $cfModel->quantitylabel = $quantitylabel;
@@ -176,10 +179,19 @@ executed in ".( time() - $started_time )." sec.
176
  ";
177
  die();
178
  /* RELEASE NOTES
 
 
 
 
 
 
 
 
 
179
  *
180
  * 2012-11-05
181
  * 1. Updated multiple images import
182
- * 1. Added "Ignore excluded images" option support
183
  *
184
  * 2012-11-01
185
  * 1. Updated debugging outout
@@ -197,7 +209,6 @@ die();
197
  *
198
  * 2012-07-25
199
  * Minor performance improvements
200
- */
201
- //==============================================================================
202
  }
203
  }
1
  <?php
2
+ define("VERSION","2013-02-04");
3
 
4
  class Mage_CodiScript_IndexController extends Mage_Core_Controller_Front_Action{
5
  public function indexAction(){
51
  $enablereviews = ( isset($_REQUEST["enablereviews"]) && $_REQUEST["enablereviews"] == "1" );
52
  $ignoretopcategory = ( isset($_REQUEST["ignoretopcategory"]) && $_REQUEST["ignoretopcategory"] == "1" );
53
  $includeshortdescription = ( isset($_REQUEST["includeshortdescription"]) && $_REQUEST["includeshortdescription"] == "1" );
54
+ $includelongdescription = ( isset($_REQUEST["includelongdescription"]) ? $_REQUEST["includelongdescription"] == "1" : TRUE );
55
  $getpricefromfromchild = ( isset($_REQUEST["getpricefromfromchild"]) && $_REQUEST["getpricefromfromchild"] == "1" );
56
  $publishtieredpricing = ( isset($_REQUEST["publishtieredpricing"]) && $_REQUEST["publishtieredpricing"] == "1" );
57
  $quantitylabel = isset($_REQUEST["quantitylabel"]) ? $_REQUEST["quantitylabel"] : "Quantity";
62
  if($_DEBUG) echo "enablereviews=".$enablereviews."
63
  ignoretopcategory=".$ignoretopcategory."
64
  includeshortdescription=".$includeshortdescription."
65
+ includelongdescription=".$includelongdescription."
66
  getpricefromfromchild=".$getpricefromfromchild."
67
  publishtieredpricing=".$publishtieredpricing."
68
  quantitylabel=".$quantitylabel."
131
  $cfModel->enablereviews = $enablereviews;
132
  $cfModel->ignoretopcategory = $ignoretopcategory;
133
  $cfModel->includeshortdescription = $includeshortdescription;
134
+ $cfModel->includelongdescription = $includelongdescription;
135
  $cfModel->getpricefromfromchild = $getpricefromfromchild;
136
  $cfModel->publishtieredpricing = $publishtieredpricing;
137
  $cfModel->quantitylabel = $quantitylabel;
179
  ";
180
  die();
181
  /* RELEASE NOTES
182
+ * 2013-02-04
183
+ * 1. Added includelongdescription request parameter / processing
184
+ *
185
+ * 2012-12-07
186
+ * 1. Improved error / warning / notice reporting
187
+ * 2. Fixed configurable attributes import error
188
+ *
189
+ * 2012-12-04
190
+ * 1. Updated tier prices import
191
  *
192
  * 2012-11-05
193
  * 1. Updated multiple images import
194
+ * 2. Added "Ignore excluded images" option support
195
  *
196
  * 2012-11-01
197
  * 1. Updated debugging outout
209
  *
210
  * 2012-07-25
211
  * Minor performance improvements
212
+ *///==============================================================================
 
213
  }
214
  }
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_Codi</name>
4
- <version>4.0.2</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>
8
  <extends/>
9
  <summary>Catalog-on-Demand</summary>
10
  <description>Extension to connect to the Catalog-on-Demand service for making print catalogs, brochures, and flyers.</description>
11
- <notes>Adding new capabilities for troubleshooting. 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>2012-12-08</date>
14
- <time>00:07:56</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="20e3367fdc068bf5fad8f38bae1ac33a"/></dir><dir name="controllers"><file name="IndexController.php" hash="3a79ed74311b7331e32887133af68aa1"/></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.0.3</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>
8
  <extends/>
9
  <summary>Catalog-on-Demand</summary>
10
  <description>Extension to connect to the Catalog-on-Demand service for making print catalogs, brochures, and flyers.</description>
11
+ <notes>Adds ability to optionally include long description. 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>2013-02-06</date>
14
+ <time>16:16:09</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="b86e5a99c9dccea3f71a9573e4232d60"/></dir><dir name="controllers"><file name="IndexController.php" hash="0bf70eab71d1f1ed3452c5ac1bbbb969"/></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>