Mage_PDF_per_Product - Version 3.0.8

Version Notes

3.0.8-Added paragraph tag in long and short description

Download this release

Release Info

Developer Magento Core Team
Extension Mage_PDF_per_Product
Version 3.0.8
Comparing to
See all releases


Code changes from version 3.0.7 to 3.0.8

app/code/community/Mage/Codi/Model/Codi.php CHANGED
@@ -7,7 +7,7 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
7
  public $userid ;
8
  public $password ;
9
  public $disableextension ;
10
- public $version = "3.0.7";
11
 
12
  public $customerid ;
13
  public $customerdatasourceid ;
@@ -309,10 +309,38 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
309
  $ProductDescription = '';
310
  if(Mage::getStoreConfig('codi/codi/codincludeshortdescription')=="checked")
311
  {
312
- $ProductDescription .= $product->getShortDescription();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
313
  }
314
- $ProductDescription .= $product->getDescription() ;
315
-
 
 
 
 
 
 
 
 
 
 
 
 
 
316
  //Get Product Attributes Start
317
  $attributes = $product->getAttributes();
318
 
@@ -409,15 +437,9 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
409
  $ProducttoString .= "\t" . $product->getId().'#$#'.$this->cleanStr( $product->getName() ); //ProductName
410
  $ProducttoString .= "\t" . "" ;
411
  //add paragraph tag in description
412
- if(strpos($ProductDescription,'<p>')!==false)
413
-
414
- {
415
- $string= array('<p>', '</p>');
416
- $ProductDescriptions = str_replace($string, "", $ProductDescription);
417
- $ProducttoString .= "\t" . $this->cleanStr( "<p>".$ProductDescriptions ."</p>") ;
418
- }
419
-
420
- else $ProducttoString .= "\t" . $this->cleanStr( "<p>".$ProductDescription ."</p>") ;
421
  //ProductDescription
422
  $ProducttoString .= "\t" . $this->cleanStr( $ImageURL ); //ProductGraphic
423
  $ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ) ; //ProductLink
@@ -453,9 +475,39 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
453
  $ProductDescription = '';
454
  if(Mage::getStoreConfig('codi/codi/codincludeshortdescription')=="checked")
455
  {
456
- $ProductDescription .= $product->getShortDescription();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
457
  }
458
- else $ProductDescription .= $product->getDescription() ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
459
  //Get Product Attributes Start
460
  //$excludeAttr = array() ;
461
  $attributes = $product->getAttributes();
@@ -570,14 +622,10 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
570
  $ProducttoString .= "\t" . ""; //ItemitemGraphic
571
  $ProducttoString .= "\t" . $product->getId().'#$#'.$this->cleanStr( $product->getName() ); //ProductName
572
  $ProducttoString .= "\t" . "" ;
573
- if(strpos($ProductDescription,'<p>')!==false)
574
- {
575
- $string= array('<p>', '</p>');
576
- $ProductDescriptions = str_replace($string, "", $ProductDescription);
577
- $ProducttoString .= "\t" . $this->cleanStr( "<p>".$ProductDescriptions ."</p>") ;
578
- }
579
-
580
- else $ProducttoString .= "\t" . $this->cleanStr( "<p>".$ProductDescription ."</p>") ; //ProductDescription
581
  $ProducttoString .= "\t" . $this->cleanStr( $ImageURL ); //ProductGraphic
582
  $ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ) ; //ProductLink
583
  $ProducttoString .= "\t" . $this->cleanStr( $ProductAttributes ) ; //ProductAttributes
@@ -610,11 +658,42 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
610
  //Change for short description
611
  //$ProductDescription = $product->getDescription() ;
612
  $ProductDescription = '';
 
613
  if(Mage::getStoreConfig('codi/codi/codincludeshortdescription')=="checked")
614
  {
615
- $ProductDescription .= $product->getShortDescription();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
616
  }
617
- $ProductDescription .= $product->getDescription() ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
618
  //************************ Get Attributes Start *******************************
619
  //Extract Attributes
620
 
@@ -675,20 +754,14 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
675
  $ProducttoString .= "\t" . ""; //ItemitemGraphic
676
  $ProducttoString .= "\t" . $product->getId().'#$#'.$this->cleanStr( $product->getName() ); //ProductName
677
  $ProducttoString .= "\t" . "" ;
678
- if(strpos($ProductDescription,'<p>')!==false)
679
- {
680
- $string= array('<p>', '</p>');
681
- $ProductDescriptions = str_replace($string, "", $ProductDescription);
682
- $ProducttoString .= "\t" . $this->cleanStr( "<p>".$ProductDescriptions ."</p>") ;
683
- }
684
- //ProductMfg
685
- else $ProducttoString .= "\t" . $this->cleanStr( "<p>".$ProductDescription ."</p>") ; //ProductDescription
686
  $ProducttoString .= "\t" . $this->cleanStr( $ImageURL ); //ProductGraphic
687
  $ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ) ; //ProductLink
688
  $ProducttoString .= "\t" . $this->cleanStr( $ItemitemAttributes ) ; //ProductAttributes
689
  $ProducttoString .= "\t" . $this->cleanStr( $CategoriesString ); //Category
690
  $ProducttoString .= "\t" . $this->cleanStr( $Reviews ); //Reviews
691
-
692
  if(strpos($shortdescription,'<p>')!==false)
693
 
694
  $ProducttoString .= "\t" . $this->cleanStr($shortdescription) ;
7
  public $userid ;
8
  public $password ;
9
  public $disableextension ;
10
+ public $version = "3.0.8";
11
 
12
  public $customerid ;
13
  public $customerdatasourceid ;
309
  $ProductDescription = '';
310
  if(Mage::getStoreConfig('codi/codi/codincludeshortdescription')=="checked")
311
  {
312
+ $shortDescription = $product->getShortDescription();
313
+ if(strpos($shortDescription,'<p>')!==false)
314
+ {
315
+ $new=strlen($shortDescription);
316
+ $pos = strrpos($shortDescription, '</p>')+4;
317
+ if($new!=$pos)
318
+ {
319
+ $extra="<p>";
320
+ $pextra="</p>";
321
+ $ProductDescription .= substr($shortDescription, 0, $pos) . $extra . substr($shortDescription, $pos).$pextra;
322
+ }
323
+ else $ProductDescription .= $shortDescription ;
324
+ }
325
+ else
326
+ $ProductDescription .= "<p>".$shortDescription ."</p>";
327
+
328
  }
329
+ $longDescription = $product->getDescription() ;
330
+ if(strpos($longDescription,'<p>')!==false)
331
+ {
332
+ $new=strlen($longDescription);
333
+ $pos = strrpos($longDescription, '</p>')+4;
334
+ if($new!=$pos)
335
+ {
336
+ $extra="<p>";
337
+ $pextra="</p>";
338
+ $ProductDescription .= substr($longDescription, 0, $pos) . $extra . substr($longDescription, $pos).$pextra;
339
+ }
340
+ else $ProductDescription .= $longDescription ;
341
+ }
342
+ else
343
+ $ProductDescription .= "<p>".$longDescription ."</p>" ;
344
  //Get Product Attributes Start
345
  $attributes = $product->getAttributes();
346
 
437
  $ProducttoString .= "\t" . $product->getId().'#$#'.$this->cleanStr( $product->getName() ); //ProductName
438
  $ProducttoString .= "\t" . "" ;
439
  //add paragraph tag in description
440
+
441
+ $ProducttoString .= "\t" . $this->cleanStr($ProductDescription) ;
442
+
 
 
 
 
 
 
443
  //ProductDescription
444
  $ProducttoString .= "\t" . $this->cleanStr( $ImageURL ); //ProductGraphic
445
  $ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ) ; //ProductLink
475
  $ProductDescription = '';
476
  if(Mage::getStoreConfig('codi/codi/codincludeshortdescription')=="checked")
477
  {
478
+ $shortDescription = $product->getShortDescription();
479
+ if(strpos($shortDescription,'<p>')!==false)
480
+ {
481
+ $new=strlen($shortDescription);
482
+ $pos = strrpos($shortDescription, '</p>')+4;
483
+ if($new!=$pos)
484
+ {
485
+ $extra="<p>";
486
+ $pextra="</p>";
487
+ $ProductDescription .= substr($shortDescription, 0, $pos) . $extra . substr($shortDescription, $pos).$pextra;
488
+ }
489
+ else $ProductDescription .= $shortDescription ;
490
+ }
491
+ else
492
+ $ProductDescription .= "<p>".$shortDescription ."</p>";
493
+
494
  }
495
+ $longDescription = $product->getDescription() ;
496
+ if(strpos($longDescription,'<p>')!==false)
497
+ {
498
+ $new=strlen($longDescription);
499
+ $pos = strrpos($longDescription, '</p>')+4;
500
+ if($new!=$pos)
501
+ {
502
+ $extra="<p>";
503
+ $pextra="</p>";
504
+ $ProductDescription .= substr($longDescription, 0, $pos) . $extra . substr($longDescription, $pos).$pextra;
505
+ }
506
+ else $ProductDescription .= $longDescription ;
507
+
508
+ }
509
+ else
510
+ $ProductDescription .= "<p>".$longDescription ."</p>" ;
511
  //Get Product Attributes Start
512
  //$excludeAttr = array() ;
513
  $attributes = $product->getAttributes();
622
  $ProducttoString .= "\t" . ""; //ItemitemGraphic
623
  $ProducttoString .= "\t" . $product->getId().'#$#'.$this->cleanStr( $product->getName() ); //ProductName
624
  $ProducttoString .= "\t" . "" ;
625
+
626
+ $ProducttoString .= "\t" . $this->cleanStr($ProductDescription) ;
627
+
628
+ //ProductDescription
 
 
 
 
629
  $ProducttoString .= "\t" . $this->cleanStr( $ImageURL ); //ProductGraphic
630
  $ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ) ; //ProductLink
631
  $ProducttoString .= "\t" . $this->cleanStr( $ProductAttributes ) ; //ProductAttributes
658
  //Change for short description
659
  //$ProductDescription = $product->getDescription() ;
660
  $ProductDescription = '';
661
+
662
  if(Mage::getStoreConfig('codi/codi/codincludeshortdescription')=="checked")
663
  {
664
+ $shortDescription = $product->getShortDescription();
665
+ if(strpos($shortDescription,'<p>')!==false)
666
+ {
667
+ $new=strlen($shortDescription);
668
+ $pos = strrpos($shortDescription, '</p>')+4;
669
+ if($new!=$pos)
670
+ {
671
+ $extra="<p>";
672
+ $pextra="</p>";
673
+ $ProductDescription .= substr($shortDescription, 0, $pos) . $extra . substr($shortDescription, $pos).$pextra;
674
+ }
675
+ else $ProductDescription .= $shortDescription ;
676
+ }
677
+ else
678
+ $ProductDescription .= "<p>".$shortDescription ."</p>";
679
+
680
  }
681
+ $longDescription = $product->getDescription() ;
682
+ if(strpos($longDescription,'<p>')!==false)
683
+ {
684
+ $new=strlen($longDescription);
685
+ $pos = strrpos($longDescription, '</p>')+4;
686
+ if($new!=$pos)
687
+ {
688
+ $extra="<p>";
689
+ $pextra="</p>";
690
+ $ProductDescription .= substr($longDescription, 0, $pos) . $extra . substr($longDescription, $pos).$pextra;
691
+ }
692
+ else $ProductDescription .= $longDescription ;
693
+ }
694
+ else
695
+ $ProductDescription .= "<p>".$longDescription ."</p>" ;
696
+
697
  //************************ Get Attributes Start *******************************
698
  //Extract Attributes
699
 
754
  $ProducttoString .= "\t" . ""; //ItemitemGraphic
755
  $ProducttoString .= "\t" . $product->getId().'#$#'.$this->cleanStr( $product->getName() ); //ProductName
756
  $ProducttoString .= "\t" . "" ;
757
+ //ProductMfg
758
+ $ProducttoString .= "\t" . $this->cleanStr( $ProductDescription) ; //ProductDescription
 
 
 
 
 
 
759
  $ProducttoString .= "\t" . $this->cleanStr( $ImageURL ); //ProductGraphic
760
  $ProducttoString .= "\t" . $this->cleanStr( $product->getProductUrl() ) ; //ProductLink
761
  $ProducttoString .= "\t" . $this->cleanStr( $ItemitemAttributes ) ; //ProductAttributes
762
  $ProducttoString .= "\t" . $this->cleanStr( $CategoriesString ); //Category
763
  $ProducttoString .= "\t" . $this->cleanStr( $Reviews ); //Reviews
764
+ $shortdescription=$product->getShortDescription();
765
  if(strpos($shortdescription,'<p>')!==false)
766
 
767
  $ProducttoString .= "\t" . $this->cleanStr($shortdescription) ;
app/code/community/Mage/Codi/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Mage_Codi>
5
- <version>3.0.7</version>
6
  </Mage_Codi>
7
  </modules>
8
  <adminhtml>
2
  <config>
3
  <modules>
4
  <Mage_Codi>
5
+ <version>3.0.8</version>
6
  </Mage_Codi>
7
  </modules>
8
  <adminhtml>
package.xml CHANGED
@@ -1,19 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_PDF_per_Product</name>
4
- <version>3.0.7</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>Catalog-On-Demand</description>
11
- <notes>3.0.7- Contain group product support&#xD;
12
- and the new behavior if the file creation is in progress</notes>
13
  <authors><author><name>catalogondemand</name><user>auto-converted</user><email>timh@catalog-on-demand.com</email></author></authors>
14
- <date>2012-01-03</date>
15
- <time>09:09:22</time>
16
- <contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="codimport_run.gif" hash="e805ea7eca1f34c75ba0f93780d32d38"/><file name="codimport_yes.gif" hash="0afb20898a704a106cb4c598868abf32"/><file name="preview_field_help.png" hash="1b1601459d25e8b1a6b1d109782078d2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="codi"><file name="index.phtml" hash="df25f104d32ba9e1441ded87dd0516f8"/></dir></dir><dir name="layout"><file name="codi.xml" hash="9407985f30403744eb4e758312d62aef"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="catalog"><dir name="product"><file name="view.phtml" hash="86eff56921219708a31c279309b949ca"/></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="jquery"><file name="jquery-1.2.6.noConflict.min.js" hash="090fdb3fbcb4727c0ca20cca87e7e12d"/><file name="jquery.tooltip.js" hash="8217c6611da6cfe45094e58485d013f0"/></dir></dir></target><target name="magecommunity"><dir name="Mage"><dir name="Codi"><dir name="Block"><dir name="Adminhtml"><file name="Menu.php" hash="ae8a9d1be49f00102911ef5fbe97c126"/><file name="Switcher.php" hash="62f36d23f039d7c21ec84b42fd0532ff"/></dir><dir name="Customer"><file name="Codi.php" hash="17c557dbcfadd336dc7ba773d6304fc0"/></dir></dir><dir name="Helper"><file name="Createzip.php" hash="03fe07641f6f3f480b1d1c47b5ab3901"/><file name="Data.php" hash="0c5442367142b7c2048ca900e1e5a8f1"/></dir><dir name="Model"><file name="Codi.php" hash="86cf5814982f812e76374f5c60a2ec02"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MenuController.php" hash="0db56a3c8d2bdd2564c8231b1efa8860"/></dir><file name="DeleteController.php" hash="8030915b46c87e5369a7c34d979873b4"/><file name="NsyncController.php" hash="d4bb9b709c9c907731d2f4e609205934"/><file name="SyncController.php" hash="ce7dfa71ab6214fbb825578ea81f55d2"/></dir><dir name="etc"><file name="config.xml" hash="c2dac3b8ca4f350ce47f04814b69b6e4"/></dir><dir name="sql"><dir name="codi_setup"><file name="mysql4-install-3.0.4.php" hash="ffa1c82119aa4a56a6123dd1c5feca8f"/><file name="mysql4-install-3.0.6.php" hash="ffa1c82119aa4a56a6123dd1c5feca8f"/></dir></dir><file name="Codi_Process.php" hash="07b09ec755a1ae56c3a9f3945aa72035"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Codi.xml" hash="5d635cd2a0d415b67f095bda0298445d"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies/>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_PDF_per_Product</name>
4
+ <version>3.0.8</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>Catalog-On-Demand</description>
11
+ <notes>3.0.8-Added paragraph tag in long and short description</notes>
 
12
  <authors><author><name>catalogondemand</name><user>auto-converted</user><email>timh@catalog-on-demand.com</email></author></authors>
13
+ <date>2012-01-06</date>
14
+ <time>06:50:04</time>
15
+ <contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="codimport_run.gif" hash="e805ea7eca1f34c75ba0f93780d32d38"/><file name="codimport_yes.gif" hash="0afb20898a704a106cb4c598868abf32"/><file name="preview_field_help.png" hash="1b1601459d25e8b1a6b1d109782078d2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="codi"><file name="index.phtml" hash="df25f104d32ba9e1441ded87dd0516f8"/></dir></dir><dir name="layout"><file name="codi.xml" hash="9407985f30403744eb4e758312d62aef"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="catalog"><dir name="product"><file name="view.phtml" hash="86eff56921219708a31c279309b949ca"/></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="jquery"><file name="jquery-1.2.6.noConflict.min.js" hash="090fdb3fbcb4727c0ca20cca87e7e12d"/><file name="jquery.tooltip.js" hash="8217c6611da6cfe45094e58485d013f0"/></dir></dir></target><target name="magecommunity"><dir name="Mage"><dir name="Codi"><dir name="Block"><dir name="Adminhtml"><file name="Menu.php" hash="ae8a9d1be49f00102911ef5fbe97c126"/><file name="Switcher.php" hash="62f36d23f039d7c21ec84b42fd0532ff"/></dir><dir name="Customer"><file name="Codi.php" hash="17c557dbcfadd336dc7ba773d6304fc0"/></dir></dir><dir name="Helper"><file name="Createzip.php" hash="03fe07641f6f3f480b1d1c47b5ab3901"/><file name="Data.php" hash="0c5442367142b7c2048ca900e1e5a8f1"/></dir><dir name="Model"><file name="Codi.php" hash="6f712e1db4f5b0b784fcd4af51e64dbf"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MenuController.php" hash="0db56a3c8d2bdd2564c8231b1efa8860"/></dir><file name="DeleteController.php" hash="8030915b46c87e5369a7c34d979873b4"/><file name="NsyncController.php" hash="d4bb9b709c9c907731d2f4e609205934"/><file name="SyncController.php" hash="ce7dfa71ab6214fbb825578ea81f55d2"/></dir><dir name="etc"><file name="config.xml" hash="51da2886255f9ece51a9bf5a448ba71a"/></dir><dir name="sql"><dir name="codi_setup"><file name="mysql4-install-3.0.4.php" hash="ffa1c82119aa4a56a6123dd1c5feca8f"/><file name="mysql4-install-3.0.6.php" hash="ffa1c82119aa4a56a6123dd1c5feca8f"/></dir></dir><file name="Codi_Process.php" hash="07b09ec755a1ae56c3a9f3945aa72035"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Codi.xml" hash="5d635cd2a0d415b67f095bda0298445d"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>