Mage_PDF_per_Product - Version 3.0.1

Version Notes

3.0.1 - Added Magento 1.6 compatibility.

Download this release

Release Info

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


Code changes from version 3.0.0 to 3.0.1

app/code/community/Mage/Codi/Block/Adminhtml/Switcher.php ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ class Mage_Codi_Block_Adminhtml_Switcher extends Mage_Adminhtml_Block_Template
29
+ {
30
+ protected function _prepareLayout()
31
+ {
32
+ $this->setTemplate('codi/switcher.phtml');
33
+ return parent::_prepareLayout();
34
+ }
35
+
36
+ /**
37
+ * Enter description here...
38
+ *
39
+ * @return array
40
+ */
41
+ public function getStoreSelectOptions()
42
+ {
43
+ $section = $this->getRequest()->getParam('section');
44
+
45
+ $curWebsite = $this->getRequest()->getParam('website');
46
+ $curStore = $this->getRequest()->getParam('store');
47
+
48
+ $storeModel = Mage::getSingleton('adminhtml/system_store');
49
+ /* @var $storeModel Mage_Adminhtml_Model_System_Store */
50
+
51
+ $url = Mage::getModel('adminhtml/url');
52
+
53
+ $options = array();
54
+ $options['default'] = array(
55
+ 'label' => Mage::helper('adminhtml')->__('Default Config'),
56
+ 'url' => $url->getUrl('*/*/*', array('section'=>$section)),
57
+ 'selected' => !$curWebsite && !$curStore,
58
+ 'style' => 'background:#ccc; font-weight:bold;',
59
+ );
60
+
61
+ foreach ($storeModel->getWebsiteCollection() as $website) {
62
+ $websiteShow = false;
63
+ foreach ($storeModel->getGroupCollection() as $group) {
64
+ if ($group->getWebsiteId() != $website->getId()) {
65
+ continue;
66
+ }
67
+ $groupShow = false;
68
+ foreach ($storeModel->getStoreCollection() as $store) {
69
+ if ($store->getGroupId() != $group->getId()) {
70
+ continue;
71
+ }
72
+ if ($websiteShow) {
73
+ $websiteShow = true;
74
+ $options['website_' . $website->getCode()] = array(
75
+ 'label' => $website->getName(),
76
+ 'url' => $url->getUrl('*/*/*', array('section'=>$section, 'website'=>$website->getCode())),
77
+ 'selected' => !$curStore && $curWebsite == $website->getCode(),
78
+ 'style' => 'padding-left:16px; background:#DDD; font-weight:bold;',
79
+ );
80
+ }
81
+ if (!$groupShow) {
82
+ $groupShow = true;
83
+ $options['group_' . $group->getId() . '_open'] = array(
84
+ 'is_group' => true,
85
+ 'is_close' => false,
86
+ 'label' => $group->getName(),
87
+ 'style' => 'padding-left:32px;'
88
+ );
89
+ }
90
+ $options['store_' . $store->getCode()] = array(
91
+ 'label' => $store->getName(),
92
+ 'url' => $url->getUrl('*/*/*', array('section'=>$section, 'website'=>$website->getCode(), 'store'=>$store->getCode())),
93
+ 'selected' => $curStore == $store->getCode(),
94
+ 'style' => '',
95
+ );
96
+ }
97
+ if ($groupShow) {
98
+ $options['group_' . $group->getId() . '_close'] = array(
99
+ 'is_group' => true,
100
+ 'is_close' => true,
101
+ );
102
+ }
103
+ }
104
+ }
105
+
106
+ return $options;
107
+ }
108
+
109
+ }
app/code/community/Mage/Codi/Helper/Data.php CHANGED
@@ -108,6 +108,78 @@ class Mage_Codi_Helper_Data extends Mage_Core_Helper_Abstract
108
  {
109
  @unlink($basePath."CODdataFiles/".$filename);
110
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
 
112
  }
113
  ?>
108
  {
109
  @unlink($basePath."CODdataFiles/".$filename);
110
  }
111
+ //function for get the theme
112
+ function getTheme()
113
+ {
114
+ foreach (Mage::app()->getWebsites() as $website)
115
+ {
116
+ $defaultGroup = $website->getDefaultGroup();
117
+ $StoreId = $defaultGroup->getDefaultStoreId();
118
+ }
119
+
120
+ $design = Mage::getSingleton('core/design')->loadChange($StoreId);
121
+
122
+ $package = $design->getPackage();
123
+ $default_theme = $design->getTheme();
124
+
125
+ if ( $package == "" && $default_theme == "" ){
126
+
127
+ $package = Mage::getStoreConfig('design/package/name', $StoreId);
128
+ $default_theme = Mage::getStoreConfig('design/theme/default', $StoreId);
129
+ }
130
+
131
+ if ( $package == "" ) $package = "default";
132
+ if ( $default_theme == "" ) $default_theme = "default";
133
+
134
+ return $package.'/'.$default_theme;
135
+
136
+
137
+
138
+ }
139
+ function array2json($arr) {
140
+
141
+ if(function_exists('json_encode')) return json_encode($arr); //Lastest versions of PHP already has this functionality.
142
+ $parts = array();
143
+ $is_list = false;
144
+
145
+ //Find out if the given array is a numerical array
146
+ $keys = array_keys($arr);
147
+ $max_length = count($arr)-1;
148
+ if(($keys[0] == 0) and ($keys[$max_length] == $max_length)) {//See if the first key is 0 and last key is length - 1
149
+ $is_list = true;
150
+ for($i=0; $i<count($keys); $i++) { //See if each key correspondes to its position
151
+ if($i != $keys[$i]) { //A key fails at position check.
152
+ $is_list = false; //It is an associative array.
153
+ break;
154
+ }
155
+ }
156
+ }
157
+
158
+ foreach($arr as $key=>$value) {
159
+ if(is_array($value)) { //Custom handling for arrays
160
+ if($is_list) $parts[] = array2json($value); /* :RECURSION: */
161
+ else $parts[] = '"' . $key . '":' . array2json($value); /* :RECURSION: */
162
+ } else {
163
+ $str = '';
164
+ if(!$is_list) $str = '"' . $key . '":';
165
+
166
+ //Custom handling for multiple data types
167
+ if(is_numeric($value)) $str .= $value; //Numbers
168
+ elseif($value === false) $str .= 'false'; //The booleans
169
+ elseif($value === true) $str .= 'true';
170
+ else $str .= '"' . addslashes($value) . '"'; //All other things
171
+ // :TODO: Is there any more datatype we should be in the lookout for? (Object?)
172
+
173
+ $parts[] = $str;
174
+ }
175
+ }
176
+ $json = implode(',',$parts);
177
+
178
+ if($is_list) return '[' . $json . ']';//Return numerical JSON
179
+ return '{' . $json . '}';//Return associative JSON
180
+ }
181
+
182
+
183
 
184
  }
185
  ?>
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.0";
11
 
12
  public $customerid ;
13
  public $customerdatasourceid ;
@@ -281,8 +281,12 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
281
  $ProducttoString = '' ;
282
  $UsedProductIds = Mage::getModel('catalog/product_type_configurable')->getUsedProductIds($product);
283
 
284
- $ProductDescription = $product->getDescription() ;
285
-
 
 
 
 
286
  //Get Product Attributes Start
287
  //$excludeAttr = array() ;
288
  $attributes = $product->getAttributes();
@@ -420,8 +424,14 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
420
  public function ProducttoStringSimple( $product , $from )
421
  {
422
  $ProducttoString = '' ;
423
- $ProductDescription = $product->getDescription() ;
424
-
 
 
 
 
 
 
425
  //************************ Get Attributes Start *******************************
426
  //Extract Attributes
427
  //$ImageURL = (string)$this->helper('catalog/image')->init($product, 'image');
@@ -659,6 +669,8 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
659
  $codafterOR = ( Mage::getStoreConfig('codi/codi/codafterOR') == 'checked' )?'Yes':'No' ;
660
  $codbeforeoverview = ( Mage::getStoreConfig('codi/codi/codbeforeoverview') == 'checked' ) ?'Yes':'No';
661
  $codafteroverview = ( Mage::getStoreConfig('codi/codi/codafteroverview') == 'checked' )?'Yes':'No';
 
 
662
 
663
  $Comment = "App extension version: ".$extension_version." \r\n";
664
  $Comment .= "Magento version: ".$app_version." \r\n";
@@ -666,6 +678,7 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
666
  $Comment .= "Theme: ".$theme." \r\n";
667
  $Comment .= "Create data file using background process: ".$codbgcheck." \r\n";
668
  $Comment .= "Enable Always Fresh Flyers: ".$enablefreshflyers." \r\n";
 
669
  $Comment .= "Enable Reviews: ".$enablereviews." \r\n";
670
  $Comment .= "Get price from associated products: ".$fromchild." \r\n";
671
  $Comment .= "Image to be used for flyer link: ".$codflyerlinkimg." \r\n";
@@ -674,7 +687,7 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
674
  $Comment .= " Display before product name: ".$codbeforename." \r\n";
675
  $Comment .= " Display after product name: ".$codaftername." \r\n";
676
  $Comment .= " Display before Email to a friend: ".$codbeforeemailto." \r\n";
677
- $Comment .= " Display before Email to a friend: ".$codafteremailto." \r\n";
678
  $Comment .= " Display before OR: ".$codbeforeOR." \r\n";
679
  $Comment .= " Display after OR: ".$codafterOR." \r\n";
680
  $Comment .= " Display before Quick Overview: ".$codbeforeoverview." \r\n";
@@ -682,6 +695,10 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
682
  //code for version 2.2.16
683
  $datafilelaunch = Mage::getStoreConfig('codi/codi/coddatafilelaunch');
684
  $Comment .="Data File Launch Mode: ".$datafilelaunch."\r\n";
 
 
 
 
685
  if($datafilelaunch=='magento')
686
  {
687
  $datafilelaunch='cronjob';
@@ -700,6 +717,11 @@ class Mage_Codi_Model_Codi extends Mage_Core_Model_Abstract
700
  {
701
  $Comment .="Cron job command: wget ".$cronjoburl."\r\n";
702
  }
 
 
 
 
 
703
 
704
  $Comment .="Extension Name: ".$this->extensionName."\r\n";
705
  $Comment .="Date and time of most recent data file: ".$datetime."\r\n";
7
  public $userid ;
8
  public $password ;
9
  public $disableextension ;
10
+ public $version = "3.0.1";
11
 
12
  public $customerid ;
13
  public $customerdatasourceid ;
281
  $ProducttoString = '' ;
282
  $UsedProductIds = Mage::getModel('catalog/product_type_configurable')->getUsedProductIds($product);
283
 
284
+ $ProductDescription = '';
285
+ if(Mage::getStoreConfig('codi/codi/codincludeshortdescription')=="checked")
286
+ {
287
+ $ProductDescription .= $product->getShortDescription();
288
+ }
289
+ $ProductDescription .= $product->getDescription() ;
290
  //Get Product Attributes Start
291
  //$excludeAttr = array() ;
292
  $attributes = $product->getAttributes();
424
  public function ProducttoStringSimple( $product , $from )
425
  {
426
  $ProducttoString = '' ;
427
+ //Change for short description
428
+ //$ProductDescription = $product->getDescription() ;
429
+ $ProductDescription = '';
430
+ if(Mage::getStoreConfig('codi/codi/codincludeshortdescription')=="checked")
431
+ {
432
+ $ProductDescription .= $product->getShortDescription();
433
+ }
434
+ $ProductDescription .= $product->getDescription() ;
435
  //************************ Get Attributes Start *******************************
436
  //Extract Attributes
437
  //$ImageURL = (string)$this->helper('catalog/image')->init($product, 'image');
669
  $codafterOR = ( Mage::getStoreConfig('codi/codi/codafterOR') == 'checked' )?'Yes':'No' ;
670
  $codbeforeoverview = ( Mage::getStoreConfig('codi/codi/codbeforeoverview') == 'checked' ) ?'Yes':'No';
671
  $codafteroverview = ( Mage::getStoreConfig('codi/codi/codafteroverview') == 'checked' )?'Yes':'No';
672
+ //Changed for include short description
673
+ $includeshortdescription = (Mage::getStoreConfig('codi/codi/codincludeshortdescription')== 'checked' )?'Yes':'No';
674
 
675
  $Comment = "App extension version: ".$extension_version." \r\n";
676
  $Comment .= "Magento version: ".$app_version." \r\n";
678
  $Comment .= "Theme: ".$theme." \r\n";
679
  $Comment .= "Create data file using background process: ".$codbgcheck." \r\n";
680
  $Comment .= "Enable Always Fresh Flyers: ".$enablefreshflyers." \r\n";
681
+ $Comment .= "Include Short Description: ".$includeshortdescription." \r\n";
682
  $Comment .= "Enable Reviews: ".$enablereviews." \r\n";
683
  $Comment .= "Get price from associated products: ".$fromchild." \r\n";
684
  $Comment .= "Image to be used for flyer link: ".$codflyerlinkimg." \r\n";
687
  $Comment .= " Display before product name: ".$codbeforename." \r\n";
688
  $Comment .= " Display after product name: ".$codaftername." \r\n";
689
  $Comment .= " Display before Email to a friend: ".$codbeforeemailto." \r\n";
690
+ $Comment .= " Display after Email to a friend: ".$codafteremailto." \r\n";
691
  $Comment .= " Display before OR: ".$codbeforeOR." \r\n";
692
  $Comment .= " Display after OR: ".$codafterOR." \r\n";
693
  $Comment .= " Display before Quick Overview: ".$codbeforeoverview." \r\n";
695
  //code for version 2.2.16
696
  $datafilelaunch = Mage::getStoreConfig('codi/codi/coddatafilelaunch');
697
  $Comment .="Data File Launch Mode: ".$datafilelaunch."\r\n";
698
+ //Change for site url
699
+ $siteurl = Mage::getUrl('/');
700
+ $Comment .="Site Url: ".$siteurl."\r\n";
701
+
702
  if($datafilelaunch=='magento')
703
  {
704
  $datafilelaunch='cronjob';
717
  {
718
  $Comment .="Cron job command: wget ".$cronjoburl."\r\n";
719
  }
720
+ else{
721
+ $waitforminute=Mage::getStoreConfig('codi/codi/codwaitforminute')/60;
722
+ $Comment .="WaitFor: ".number_format($waitforminute,2,'.','')."\r\n";
723
+
724
+ }
725
 
726
  $Comment .="Extension Name: ".$this->extensionName."\r\n";
727
  $Comment .="Date and time of most recent data file: ".$datetime."\r\n";
app/code/community/Mage/Codi/controllers/Adminhtml/MenuController.php CHANGED
@@ -194,7 +194,7 @@ class Mage_Codi_Adminhtml_MenuController extends Mage_Adminhtml_Controller_Actio
194
 
195
  public function authsaveAction()
196
  {
197
- $userid = (string)$this->getRequest()->getParam('userid');
198
  $password = (string)$this->getRequest()->getParam('password');
199
  $secretkey = (string)$this->getRequest()->getParam('secretkey');
200
  $enablefreshflyers = (string)$this->getRequest()->getParam('enablefreshflyers');
@@ -219,6 +219,10 @@ class Mage_Codi_Adminhtml_MenuController extends Mage_Adminhtml_Controller_Actio
219
 
220
  //ver 2.2.16
221
  $coddatafilelaunch = (string)$this->getRequest()->getParam('datafilelaunch');
 
 
 
 
222
 
223
  $codimodel = Mage::getSingleton('codi/codi');
224
 
@@ -242,6 +246,8 @@ class Mage_Codi_Adminhtml_MenuController extends Mage_Adminhtml_Controller_Actio
242
  "codbeforeoverview" => array ('value' => $codbeforeoverview) ,
243
  "codafteroverview" => array ('value' => $codafteroverview) ,
244
  "coddatafilelaunch" => array ('value' => $coddatafilelaunch) ,
 
 
245
 
246
  )
247
  );
194
 
195
  public function authsaveAction()
196
  {
197
+ $userid = strtolower((string)$this->getRequest()->getParam('userid'));
198
  $password = (string)$this->getRequest()->getParam('password');
199
  $secretkey = (string)$this->getRequest()->getParam('secretkey');
200
  $enablefreshflyers = (string)$this->getRequest()->getParam('enablefreshflyers');
219
 
220
  //ver 2.2.16
221
  $coddatafilelaunch = (string)$this->getRequest()->getParam('datafilelaunch');
222
+ //for waitfor minute
223
+
224
+ $waitforminute = (string)$this->getRequest()->getParam('waitforminute');
225
+ $includeshortdescription = (string)$this->getRequest()->getParam('includeshortdescription');
226
 
227
  $codimodel = Mage::getSingleton('codi/codi');
228
 
246
  "codbeforeoverview" => array ('value' => $codbeforeoverview) ,
247
  "codafteroverview" => array ('value' => $codafteroverview) ,
248
  "coddatafilelaunch" => array ('value' => $coddatafilelaunch) ,
249
+ "codwaitforminute" => array ('value' => $waitforminute),
250
+ "codincludeshortdescription" => array ('value' => $includeshortdescription),
251
 
252
  )
253
  );
app/code/community/Mage/Codi/controllers/NsyncController.php CHANGED
@@ -4,6 +4,7 @@ ini_set("memory_limit","512M");
4
  require_once 'Mage/Core/Controller/Front/Action.php';
5
  class Mage_Codi_NsyncController extends Mage_Core_Controller_Front_Action
6
  {
 
7
 
8
  public function indexAction()
9
  {
@@ -65,4 +66,62 @@ class Mage_Codi_NsyncController extends Mage_Core_Controller_Front_Action
65
  }
66
  //print '{"success": "1"}';
67
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  }
4
  require_once 'Mage/Core/Controller/Front/Action.php';
5
  class Mage_Codi_NsyncController extends Mage_Core_Controller_Front_Action
6
  {
7
+ public $CodiBlock ;
8
 
9
  public function indexAction()
10
  {
66
  }
67
  //print '{"success": "1"}';
68
  }
69
+
70
+ // Below function is for the loader
71
+
72
+ public function manualAction()
73
+ {
74
+ $products = Mage::getModel('catalog/product')->getCollection();
75
+ $products->addAttributeToFilter('status', 1);//enabled
76
+ $products->addAttributeToFilter('visibility', 4);//catalog, search
77
+ $products->addAttributeToSelect('*');
78
+ $prodIds = $products->getAllIds();
79
+
80
+ print Mage::helper('codi')->array2json($prodIds);
81
+ }
82
+ //create file
83
+ public function updatestatusAction()
84
+ {
85
+ $this->_logFile = "Catalog-on-demand.log";
86
+ Mage::log("Notice: Mage_Codi_NSyncController", null, $this->_logFile);
87
+
88
+
89
+ $CodiModel = Mage::getModel('codi/codi');
90
+ //product is id of the product
91
+ $productid=$this->getRequest()->getParam('product');
92
+ // counter is no. of product passed
93
+ $counter=$this->getRequest()->getParam('counter');
94
+ // Total product . counter and total is for calculating how many percent of data is transfered.
95
+ $total=$this->getRequest()->getParam('total');
96
+ //basepath
97
+ $basepath=$this->getRequest()->getParam('basepath');
98
+ $fh = fopen($basepath.'CODdataFiles/temp.txt', 'a');
99
+ try{
100
+ // below condition is for the write all heading only first time after that it will not write.
101
+ if($counter==1){
102
+
103
+ fwrite($fh, "itemNumber\titemQty\titemUom\titemPrice\titemDescription\titemLink\titemAttributes\titemGraphic\tproductName\tproductMfg\tproductDescription\tproductGraphic\tproductLink\tproductAttributes\tCategory\tReviews\tSupplementalInfo");
104
+
105
+ }
106
+
107
+ $product = Mage::getModel('catalog/product');
108
+ $product->load($productid);
109
+
110
+ fwrite($fh, $CodiModel->ProducttoString($product, "product"));
111
+ }catch(Exception $e)
112
+ {
113
+ echo "error";
114
+ return;
115
+ }
116
+ fclose($fh);
117
+ $progress=(string)(($counter/$total)*100);
118
+ if($progress=='100'){
119
+ $DataFile = 'text.tmp.txt';
120
+ rename($basePath.'CODdataFiles/temp.txt', $basePath.'CODdataFiles/'.$DataFile);
121
+ }
122
+ echo ceil($progress);
123
+
124
+
125
+ }
126
+
127
  }
app/code/community/Mage/Codi/controllers/SyncController.php CHANGED
@@ -41,15 +41,25 @@ class Mage_Codi_SyncController extends Mage_Core_Controller_Front_Action
41
  $error_msg = "ERROR\nCannot prepare the callback link.";
42
  }
43
 
44
- if ( $error_msg == "" ) $error_msg = "OK";
 
 
45
  // respond immediately
46
-
 
 
 
 
 
 
 
 
47
  @ob_end_clean();
48
  header("Connection: close\r\n");
49
  header("Content-Encoding: none\r\n");
50
  ignore_user_abort(true);
51
  ob_start();
52
- echo $error_msg;
53
  header("Content-Length: ".ob_get_length());
54
  ob_end_flush();
55
  flush();
@@ -134,8 +144,13 @@ class Mage_Codi_SyncController extends Mage_Core_Controller_Front_Action
134
 
135
  $Comment = $CodiModel->getComment($modifie);
136
  Mage::log("Notice: Prepare the Comment : ". $Comment, null, $this->_logFile);
 
 
 
 
137
 
138
  $paramsarray = array( 'ProcessID' => $ProcessID,
 
139
  'DataFileLink' => $DataFileLink ,
140
  'DeleteDataFileURL' => $DeleteDataFileURL ,
141
  'Encoding' => 'utf-8' ,
@@ -145,6 +160,7 @@ class Mage_Codi_SyncController extends Mage_Core_Controller_Front_Action
145
  'Comment' => $Comment);
146
  if ( $error != "" ) {
147
  $paramsarray = array('ProcessID' => $ProcessID,
 
148
  'DataFileLink' => $DataFileLink ,
149
  'DeleteDataFileURL' => $DeleteDataFileURL ,
150
  'Encoding' => 'utf-8' ,
@@ -159,7 +175,7 @@ class Mage_Codi_SyncController extends Mage_Core_Controller_Front_Action
159
  Mage::log("Notice: Prepare the process ID : ". $ProcessID, null, $this->_logFile);
160
  Mage::log("Notice: Prepare the delete url : ". $DeleteDataFileURL, null, $this->_logFile);
161
  Mage::log("Notice: Prepare the callback url : ". $url, null, $this->_logFile);
162
-
163
  $Responsemsg = $CodiModel->Call( $url, $paramsarray );
164
  Mage::log("Notice: Prepare the callback response message ". $Responsemsg, null, $this->_logFile);
165
  }
41
  $error_msg = "ERROR\nCannot prepare the callback link.";
42
  }
43
 
44
+ if ( $error_msg == "" )
45
+ {
46
+ $error_msg = "OK";
47
  // respond immediately
48
+ $datafilelaunch = Mage::getStoreConfig('codi/codi/coddatafilelaunch');
49
+ $wait='';
50
+ if($datafilelaunch=='cod')
51
+ {
52
+
53
+ $waitforminute=Mage::getStoreConfig('codi/codi/codwaitforminute')/60;
54
+ $wait="\r\nWaitFor=".number_format($waitforminute,2,'.','');
55
+ }
56
+ }
57
  @ob_end_clean();
58
  header("Connection: close\r\n");
59
  header("Content-Encoding: none\r\n");
60
  ignore_user_abort(true);
61
  ob_start();
62
+ echo $error_msg.$wait;
63
  header("Content-Length: ".ob_get_length());
64
  ob_end_flush();
65
  flush();
144
 
145
  $Comment = $CodiModel->getComment($modifie);
146
  Mage::log("Notice: Prepare the Comment : ". $Comment, null, $this->_logFile);
147
+ //code for getTheme
148
+ $helper=Mage::helper('codi');
149
+ $TemplateName=(string)$helper->getTheme();
150
+
151
 
152
  $paramsarray = array( 'ProcessID' => $ProcessID,
153
+ 'TemplateName' => $TemplateName,
154
  'DataFileLink' => $DataFileLink ,
155
  'DeleteDataFileURL' => $DeleteDataFileURL ,
156
  'Encoding' => 'utf-8' ,
160
  'Comment' => $Comment);
161
  if ( $error != "" ) {
162
  $paramsarray = array('ProcessID' => $ProcessID,
163
+ 'TemplateName' => $TemplateName,
164
  'DataFileLink' => $DataFileLink ,
165
  'DeleteDataFileURL' => $DeleteDataFileURL ,
166
  'Encoding' => 'utf-8' ,
175
  Mage::log("Notice: Prepare the process ID : ". $ProcessID, null, $this->_logFile);
176
  Mage::log("Notice: Prepare the delete url : ". $DeleteDataFileURL, null, $this->_logFile);
177
  Mage::log("Notice: Prepare the callback url : ". $url, null, $this->_logFile);
178
+ Mage::log("Notice: Prepare the template theme : ". $TemplateName, null, $this->_logFile);
179
  $Responsemsg = $CodiModel->Call( $url, $paramsarray );
180
  Mage::log("Notice: Prepare the callback response message ". $Responsemsg, null, $this->_logFile);
181
  }
app/code/community/Mage/Codi/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Mage_Codi>
5
- <version>3.0.0</version>
6
  </Mage_Codi>
7
  </modules>
8
  <adminhtml>
2
  <config>
3
  <modules>
4
  <Mage_Codi>
5
+ <version>3.0.1</version>
6
  </Mage_Codi>
7
  </modules>
8
  <adminhtml>
app/design/adminhtml/default/default/template/codi/index.phtml CHANGED
@@ -25,11 +25,13 @@ $codbeforeoverview = Mage::getStoreConfig('codi/codi/codbeforeoverview') ;
25
  $codafteroverview = Mage::getStoreConfig('codi/codi/codafteroverview') ;
26
 
27
  $codbgcheck = Mage::getStoreConfig('codi/codi/codbgcheck') ;
28
- //http://anylinuxwork.in/magento_cod/index.php/codi/nsync/index/
29
- $post_url = $this->getUrl('codi/nsync/index');
30
  $post_url_upd = $this->getUrl('codi/adminhtml_menu/updatestatus');
31
  $post_url_cancel = $this->getUrl('codi/adminhtml_menu/cancel');
32
  $post_bgprocess_check = $this->getUrl('codi/adminhtml_menu/bgcheck');
 
 
33
 
34
  //Changed ver 2.2.15
35
  $download_url = $this->getUrl('codi/adminhtml_menu/downloadtest');
@@ -44,6 +46,8 @@ if ( $codbgcheck == 1 ) $codbg_checked = "checked";
44
  $extensionName="Mage_PDF_per_Product";
45
  $currentVer = Mage::getConfig()->getModuleConfig('Mage_Codi')->version;
46
 
 
 
47
  ?>
48
  <style>
49
  #codi_status_template_button{
@@ -65,6 +69,7 @@ $currentVer = Mage::getConfig()->getModuleConfig('Mage_Codi')->version;
65
  #tooltip h3, #tooltip div { margin: 0; }
66
  #tooltip ul{list-style:disc outside none;margin-left:12px;margin-bottom:12px;padding-left:40px;}
67
  .hidden{display:none;}
 
68
  </style>
69
 
70
  <div id="page:main-container">
@@ -323,7 +328,7 @@ switch ($target)
323
  <tr>
324
  <td class="scope-label"><a href="#accountid_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
325
  <td class="label"><label for="userid">Account ID</label></td>
326
- <td class="value"><input name="userid" id="userid" value="<?php echo $userid ?>" class=" input-text" type="text"/></td>
327
  <td><small>&nbsp;</small></td>
328
  </tr>
329
  <tr>
@@ -370,7 +375,8 @@ switch ($target)
370
  </p>
371
 
372
 
373
- <input type="radio" value="cod" id="cod" name="datafilelaunch" <?php if ($datafilelaunch =="cod") echo "checked" ?> onclick="displayBlock('codi_status_template','cronjob','1');" />&nbsp;<label for="cod">Catalog-on-Demand&nbsp;<a href="#codoption_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></label><br>
 
374
  <input type="radio" value="magento" id="magento" name="datafilelaunch" <?php if ($datafilelaunch =="magento") echo "checked" ?> onclick="displayBlock('cronjob','codi_status_template','0');" />&nbsp;<label for="magento">Cron-job &nbsp;<a href="#cronjoburl_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></label>
375
  </td>
376
  <td><small>&nbsp;</small></td>
@@ -401,6 +407,13 @@ switch ($target)
401
  <td class="value"><input name="enablefreshflyers" id="enablefreshflyers" value="checked" <?php if ($enablefreshflyers =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
402
  <td><small>&nbsp;</small></td>
403
  </tr>
 
 
 
 
 
 
 
404
  <tr>
405
  <td class="scope-label"><a href="#enablereviews_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
406
  <td class="label"><label for="enablereviews">Enable Reviews</label></td>
@@ -559,6 +572,14 @@ value="<?php if ($codflyerlinkimgalt == '') echo 'Click for PDF of this product'
559
  <div id="manual_tooltip" class="hidden">
560
  <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/ManualDataFileLaunch.html'); ?>
561
  </div>
 
 
 
 
 
 
 
 
562
  <script type="text/javascript" src="<?php echo $this->getJsUrl('jquery/jquery-1.2.6.noConflict.min.js') ?>"></script>
563
  <script type="text/javascript" src="<?php echo $this->getJsUrl('jquery/jquery.tooltip.js') ?>"></script>
564
  <script type="text/javascript">
@@ -629,8 +650,21 @@ Codi.prototype = {
629
  requestTimeout: 100,
630
 
631
  onSuccess: function(transport) {
 
 
632
  var ret_msg = transport.responseText.evalJSON();
633
- var status_div = document.getElementById('codi_status_template');
 
 
 
 
 
 
 
 
 
 
 
634
 
635
  if ( ret_msg.success == 1 ){
636
  status_div.innerHTML = "<p>A test data file is now being created. <span style='margin-left:15px;'><img src=\"<?=$this->getSkinUrl($this->__('images/codimport_run.gif'))?>\" ></span>&nbsp;&nbsp;&nbsp;<button type='button' class='scalable cancel' onclick='cancel_codi_import()' style='margin-left:25px' ><span>Cancel</span></button></p>";
@@ -741,15 +775,20 @@ function delete_codi_file()
741
 
742
  }
743
 
 
744
  function displayBlock(show,hide,hideboth)
745
  {
 
746
  if(hideboth=='1')
747
  {
748
  document.getElementById(show).style.display='none';
749
  document.getElementById(hide).style.display='none';
 
 
750
  }
751
  else
752
  {
 
753
  document.getElementById(show).style.display='';
754
  document.getElementById(hide).style.display='none';
755
  }
@@ -775,4 +814,60 @@ function cancel_codi_import(){
775
  }
776
  });
777
  }
778
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  $codafteroverview = Mage::getStoreConfig('codi/codi/codafteroverview') ;
26
 
27
  $codbgcheck = Mage::getStoreConfig('codi/codi/codbgcheck') ;
28
+
29
+ $post_url = $this->getUrl('codi/nsync/manual');
30
  $post_url_upd = $this->getUrl('codi/adminhtml_menu/updatestatus');
31
  $post_url_cancel = $this->getUrl('codi/adminhtml_menu/cancel');
32
  $post_bgprocess_check = $this->getUrl('codi/adminhtml_menu/bgcheck');
33
+ //chagned ver 3.0.1
34
+ $newpostupdate = $this->getUrl('codi/nsync/updatestatus');
35
 
36
  //Changed ver 2.2.15
37
  $download_url = $this->getUrl('codi/adminhtml_menu/downloadtest');
46
  $extensionName="Mage_PDF_per_Product";
47
  $currentVer = Mage::getConfig()->getModuleConfig('Mage_Codi')->version;
48
 
49
+ $waitforminute=Mage::getStoreConfig('codi/codi/codwaitforminute');
50
+ $includeshortdescription = Mage::getStoreConfig('codi/codi/codincludeshortdescription');
51
  ?>
52
  <style>
53
  #codi_status_template_button{
69
  #tooltip h3, #tooltip div { margin: 0; }
70
  #tooltip ul{list-style:disc outside none;margin-left:12px;margin-bottom:12px;padding-left:40px;}
71
  .hidden{display:none;}
72
+ .waitforminute{width:59px;}
73
  </style>
74
 
75
  <div id="page:main-container">
328
  <tr>
329
  <td class="scope-label"><a href="#accountid_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
330
  <td class="label"><label for="userid">Account ID</label></td>
331
+ <td class="value"><input name="userid" onchange="makeLowercase();" id="userid" value="<?php echo $userid ?>" class=" input-text" type="text"/></td>
332
  <td><small>&nbsp;</small></td>
333
  </tr>
334
  <tr>
375
  </p>
376
 
377
 
378
+ <input type="radio" value="cod" id="cod" name="datafilelaunch" <?php if ($datafilelaunch =="cod") echo "checked" ?> onclick="displayBlock('codi_status_template','cronjob','1');" />&nbsp;<label for="cod">Catalog-on-Demand&nbsp;<a href="#codoption_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></label>
379
+ <span style="display:<?php if ($datafilelaunch =="cod") echo ''; else echo 'none';?>;" id="waitforminute"><br>Minutes to wait for data file creation : <input type="text" name="waitforminute" onchange="valuevalidation(this.value,5,999,'Please enter only integer value between 5 and 999.','I');" class="waitforminute" width="60px" value="<?php echo $waitforminute;?>">&nbsp;<a href="#waitforminute_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></span><br>
380
  <input type="radio" value="magento" id="magento" name="datafilelaunch" <?php if ($datafilelaunch =="magento") echo "checked" ?> onclick="displayBlock('cronjob','codi_status_template','0');" />&nbsp;<label for="magento">Cron-job &nbsp;<a href="#cronjoburl_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></label>
381
  </td>
382
  <td><small>&nbsp;</small></td>
407
  <td class="value"><input name="enablefreshflyers" id="enablefreshflyers" value="checked" <?php if ($enablefreshflyers =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
408
  <td><small>&nbsp;</small></td>
409
  </tr>
410
+ <!-- Code for Include Short Description -->
411
+ <tr>
412
+ <td class="scope-label"><a href="#includeshortdescription_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
413
+ <td class="label"><label for="includeshortdescription">Include Short Description</label></td>
414
+ <td class="value"><input name="includeshortdescription" id="includeshortdescription" value="checked" <?php if ($includeshortdescription =="checked") echo "checked" ?> class=" input-checkbox" type="checkbox"/></td>
415
+ <td><small>&nbsp;</small></td>
416
+ </tr>
417
  <tr>
418
  <td class="scope-label"><a href="#enablereviews_tooltip"><img src="<?php echo $this->getSkinUrl($this->__('images/preview_field_help.png')) ?>" align="absmiddle" /></a></td>
419
  <td class="label"><label for="enablereviews">Enable Reviews</label></td>
572
  <div id="manual_tooltip" class="hidden">
573
  <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/ManualDataFileLaunch.html'); ?>
574
  </div>
575
+
576
+ <div id="waitforminute_tooltip" class="hidden">
577
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/waitforminute.html'); ?>
578
+ </div>
579
+ <div id="includeshortdescription_tooltip" class="hidden">
580
+ <?php echo file_get_contents('http://www.catalog-on-demand.com/support/magento/shortdesc.html'); ?>
581
+ </div>
582
+
583
  <script type="text/javascript" src="<?php echo $this->getJsUrl('jquery/jquery-1.2.6.noConflict.min.js') ?>"></script>
584
  <script type="text/javascript" src="<?php echo $this->getJsUrl('jquery/jquery.tooltip.js') ?>"></script>
585
  <script type="text/javascript">
650
  requestTimeout: 100,
651
 
652
  onSuccess: function(transport) {
653
+ //var ret_msg = transport.responseText.evalJSON();
654
+ //var status_div = document.getElementById('codi_status_template');
655
  var ret_msg = transport.responseText.evalJSON();
656
+ var status_div = document.getElementById('codi_status_template');
657
+ var v;
658
+ var totalproduct=ret_msg.length;
659
+ for (var i=0;i<ret_msg.length;i++) {
660
+ //alert(ret_msg[i]);
661
+ productid=ret_msg[i];
662
+ var j=i+1;
663
+ v=createfilenew(productid,j,totalproduct);
664
+
665
+ }
666
+ var status_div = document.getElementById('codi_status_template');
667
+
668
 
669
  if ( ret_msg.success == 1 ){
670
  status_div.innerHTML = "<p>A test data file is now being created. <span style='margin-left:15px;'><img src=\"<?=$this->getSkinUrl($this->__('images/codimport_run.gif'))?>\" ></span>&nbsp;&nbsp;&nbsp;<button type='button' class='scalable cancel' onclick='cancel_codi_import()' style='margin-left:25px' ><span>Cancel</span></button></p>";
775
 
776
  }
777
 
778
+
779
  function displayBlock(show,hide,hideboth)
780
  {
781
+
782
  if(hideboth=='1')
783
  {
784
  document.getElementById(show).style.display='none';
785
  document.getElementById(hide).style.display='none';
786
+ document.getElementById('waitforminute').style.display='';
787
+
788
  }
789
  else
790
  {
791
+ document.getElementById('waitforminute').style.display='none';
792
  document.getElementById(show).style.display='';
793
  document.getElementById(hide).style.display='none';
794
  }
814
  }
815
  });
816
  }
817
+
818
+ function makeLowercase() {
819
+ document.getElementById('userid').value = document.getElementById('userid').value.toLowerCase();
820
+ }
821
+
822
+ function valuevalidation(value, min, max, alertbox, datatype)
823
+ {
824
+
825
+ with (value)
826
+ {
827
+ checkvalue=parseFloat(value);
828
+ if (datatype)
829
+ { smalldatatype=datatype.toLowerCase();
830
+ if (smalldatatype.charAt(0)=="i") {checkvalue=parseInt(value)};
831
+ }
832
+ if ((parseFloat(min)==min && checkvalue<min) || (parseFloat(max)==max && checkvalue>max) || value!=checkvalue)
833
+ {if (alertbox!="") {alert(alertbox);} return false;}
834
+ else {return true;}
835
+ }
836
+ }
837
+
838
+ function createfilenew(productid,i,totalproduct)
839
+ { var img_url = "<?php echo $this->getSkinUrl($this->__('images/codimport_yes.gif')) ?>";
840
+ var r;
841
+ var base = "<?php echo $basePath ?>";
842
+ var status_div = document.getElementById('codi_status_template');
843
+ var a = new Ajax.Request("<?php echo $newpostupdate; ?>",
844
+ { asynchronous:false,
845
+ method: 'post',
846
+ parameters: "product="+productid+"&counter="+i+"&total="+totalproduct+"&basepath="+base,
847
+ onSuccess: function(transport) {
848
+ r= transport.responseText;
849
+ if(r=='100'){
850
+ status_div.innerHTML="<p id='codi_status_template_button'>"+transport.responseText+"% </p> Your test data file was created successfully.<img src='" + img_url + "' /><button type='button' class='scalable add' style='margin-left:25px;' onclick='download_codi_file();' ><span>Download Data File</span></button><button type='button' class='scalable add' style='margin-left:25px;' onclick='delete_codi_file();' ><span>Delete Data File</span></button> ";
851
+ }
852
+ else{
853
+ if(r!="error"){
854
+ status_div.innerHTML="<p id='codi_status_template_button'>"+transport.responseText+"% </p><p>A test data file is now being created. <span style='margin-left:15px;'><img src=\"<?=$this->getSkinUrl($this->__('images/codimport_run.gif'))?>\" ></span>&nbsp;&nbsp;&nbsp;<button type='button' class='scalable cancel' onclick='cancel_codi_import()' style='margin-left:25px' ><span>Cancel</span></button></p>";
855
+ }
856
+ }
857
+ if(r=="error")
858
+ {
859
+ status_div.innerHTML="<p>Your test data file was not created. Please contact your administrator( File Error ).</p>";
860
+ }
861
+
862
+ }
863
+
864
+ //onFailure: this.ajaxFailure.bind(),
865
+ });
866
+ return r;
867
+
868
+ //alert("end");
869
+
870
+
871
+
872
+ }
873
+ </script>
app/design/frontend/default/default/template/catalog/product/view.phtml ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Product view template
29
+ *
30
+ * @see Mage_Catalog_Block_Product_View
31
+ * @see Mage_Review_Block_Product_View
32
+ */
33
+ ?>
34
+ <?php $_helper = $this->helper('catalog/output'); ?>
35
+ <?php $_product = $this->getProduct();?>
36
+
37
+ <?php
38
+ //Catalog-on-Demand
39
+
40
+ if ( Mage::getStoreConfig('codi/codi/codflyerlinkimg') =='Custom')
41
+ $codflyerlinkimgurl = Mage::getStoreConfig('codi/codi/codflyerlinkimgurl');
42
+ else
43
+ $codflyerlinkimgurl = 'http://www.catalog-on-demand.com/print-catalog.png';
44
+
45
+ $enablefreshflyers = Mage::getStoreConfig('codi/codi/enablefreshflyers');
46
+
47
+ $flyerlink = '<a target="_blank" href="http://catalog-on-demand.com/PDF-e-Link/?FlyerA&AID=' . Mage::getStoreConfig('codi/codi/codusername'). '|' . urlencode($_product->getId() . '#$#' . $_product->getName()) . '">'. '<img id="codflyerlinkimgalt" title="' . Mage::getStoreConfig('codi/codi/codflyerlinkimgalt') . '" alt="' . Mage::getStoreConfig('codi/codi/codflyerlinkimgalt') . '" src="' . $codflyerlinkimgurl . '">'. '</a>';
48
+
49
+ //Catalog-on-Demand
50
+ ?>
51
+
52
+
53
+ <script type="text/javascript">
54
+ var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
55
+ </script>
56
+ <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
57
+ <div class="product-view">
58
+ <div class="product-essential">
59
+ <form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
60
+ <div class="no-display">
61
+ <input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
62
+ <input type="hidden" name="related_product" id="related-products-field" value="" />
63
+ </div>
64
+
65
+ <div class="product-shop">
66
+ <div class="product-name">
67
+ <h1>
68
+ <!--Catalog-on-Demand-->
69
+ <?php if(Mage::getStoreConfig('codi/codi/codbeforename')=="checked" && $enablefreshflyers) echo $flyerlink; ?>
70
+ <?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>
71
+ <?php if(Mage::getStoreConfig('codi/codi/codaftername')=="checked" && $enablefreshflyers) echo $flyerlink; ?>
72
+ <!--Catalog-on-Demand-->
73
+ </h1>
74
+ </div>
75
+
76
+ <?php if ($this->canEmailToFriend()): ?>
77
+ <p class="email-friend">
78
+ <!--Catalog-on-Demand-->
79
+ <?php if(Mage::getStoreConfig('codi/codi/codbeforeemailto')=="checked" && $enablefreshflyers) echo $flyerlink; ?>
80
+ <a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?php echo $this->__('Email to a Friend') ?></a>
81
+ <?php if(Mage::getStoreConfig('codi/codi/codafteremailto')=="checked" && $enablefreshflyers) echo $flyerlink; ?>
82
+ <!--Catalog-on-Demand-->
83
+ </p>
84
+ <?php endif; ?>
85
+
86
+ <?php echo $this->getReviewsSummaryHtml($_product, false, true)?>
87
+ <?php echo $this->getChildHtml('alert_urls') ?>
88
+ <?php echo $this->getChildHtml('product_type_data') ?>
89
+ <?php echo $this->getTierPriceHtml() ?>
90
+ <?php echo $this->getChildHtml('extrahint') ?>
91
+
92
+ <?php if (!$this->hasOptions()):?>
93
+ <div class="add-to-box">
94
+ <?php if($_product->isSaleable()): ?>
95
+ <?php echo $this->getChildHtml('addtocart') ?>
96
+ <?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
97
+ <span class="or">
98
+ <!--Catalog-on-Demand-->
99
+ <?php if(Mage::getStoreConfig('codi/codi/codbeforeOR')=="checked" && $enablefreshflyers) echo $flyerlink; ?>
100
+ <?php echo $this->__('OR') ?>
101
+ <?php if(Mage::getStoreConfig('codi/codi/codafterOR')=="checked" && $enablefreshflyers) echo $flyerlink; ?>
102
+ <!--Catalog-on-Demand-->
103
+ </span>
104
+ <?php endif; ?>
105
+ <?php endif; ?>
106
+ <?php echo $this->getChildHtml('addto') ?>
107
+ </div>
108
+ <?php echo $this->getChildHtml('extra_buttons') ?>
109
+ <?php endif; ?>
110
+
111
+ <?php if ($_product->getShortDescription()):?>
112
+ <div class="short-description">
113
+ <h2>
114
+ <!--Catalog-on-Demand-->
115
+ <?php if(Mage::getStoreConfig('codi/codi/codbeforeoverview')=="checked" && $enablefreshflyers) echo $flyerlink; ?>
116
+ <?php echo $this->__('Quick Overview') ?>
117
+ <?php if(Mage::getStoreConfig('codi/codi/codafteroverview')=="checked" && $enablefreshflyers) echo $flyerlink; ?>
118
+ <!--Catalog-on-Demand-->
119
+ </h2>
120
+ <div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
121
+ </div>
122
+ <?php endif;?>
123
+
124
+ <?php echo $this->getChildHtml('other');?>
125
+
126
+ <?php if ($_product->isSaleable() && $this->hasOptions()):?>
127
+ <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
128
+ <?php endif;?>
129
+
130
+ </div>
131
+
132
+ <div class="product-img-box">
133
+ <?php echo $this->getChildHtml('media') ?>
134
+ </div>
135
+
136
+ <div class="clearer"></div>
137
+ <?php if ($_product->isSaleable() && $this->hasOptions()):?>
138
+ <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
139
+ <?php endif;?>
140
+ </form>
141
+ <script type="text/javascript">
142
+ //<![CDATA[
143
+ var productAddToCartForm = new VarienForm('product_addtocart_form');
144
+ productAddToCartForm.submit = function(button, url) {
145
+ if (this.validator.validate()) {
146
+ var form = this.form;
147
+ var oldUrl = form.action;
148
+
149
+ if (url) {
150
+ form.action = url;
151
+ }
152
+ var e = null;
153
+ try {
154
+ this.form.submit();
155
+ } catch (e) {
156
+ }
157
+ this.form.action = oldUrl;
158
+ if (e) {
159
+ throw e;
160
+ }
161
+
162
+ if (button && button != 'undefined') {
163
+ button.disabled = true;
164
+ }
165
+ }
166
+ }.bind(productAddToCartForm);
167
+
168
+ productAddToCartForm.submitLight = function(button, url){
169
+ if(this.validator) {
170
+ var nv = Validation.methods;
171
+ delete Validation.methods['required-entry'];
172
+ delete Validation.methods['validate-one-required'];
173
+ delete Validation.methods['validate-one-required-by-name'];
174
+ if (this.validator.validate()) {
175
+ if (url) {
176
+ this.form.action = url;
177
+ }
178
+ this.form.submit();
179
+ }
180
+ Object.extend(Validation.methods, nv);
181
+ }
182
+ }.bind(productAddToCartForm);
183
+ //]]>
184
+ </script>
185
+ </div>
186
+
187
+ <div class="product-collateral">
188
+ <?php foreach ($this->getChildGroup('detailed_info', 'getChildHtml') as $alias => $html):?>
189
+ <div class="box-collateral <?php echo "box-{$alias}"?>">
190
+ <?php if ($title = $this->getChildData($alias, 'title')):?>
191
+ <h2><?php echo $this->escapeHtml($title); ?></h2>
192
+ <?php endif;?>
193
+ <?php echo $html; ?>
194
+ </div>
195
+ <?php endforeach;?>
196
+ <?php echo $this->getChildHtml('upsell_products') ?>
197
+ <?php echo $this->getChildHtml('product_additional_data') ?>
198
+ </div>
199
+ </div>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_PDF_per_Product</name>
4
- <version>3.0.0</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.0 - Added Magento 1.6 compatibility.</notes>
12
  <authors><author><name>catalogondemand</name><user>auto-converted</user><email>timh@catalog-on-demand.com</email></author></authors>
13
- <date>2011-11-01</date>
14
- <time>13:32:46</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="38238ebed2e682ac0b655f912e405f83"/></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="d17cc8af1b8a595bd597084232be87e0"/></dir></dir></target><target name="magecommunity"><dir name="Mage"><dir name="Codi"><dir name="Block"><dir name="Adminhtml"><file name="Menu.php" hash="ae8a9d1be49f00102911ef5fbe97c126"/></dir><dir name="Customer"><file name="Codi.php" hash="17c557dbcfadd336dc7ba773d6304fc0"/></dir></dir><dir name="Helper"><file name="Data.php" hash="d4b1d32935b0564a5f2fae2965155d61"/></dir><dir name="Model"><file name="Codi.php" hash="604eb9bf5d41a5db3870a3a323da5d0f"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MenuController.php" hash="2e0ba5fdd17637fccbb9b2837616c0d5"/></dir><file name="DeleteController.php" hash="fed4a29a509a181f0f185de0609872db"/><file name="NsyncController.php" hash="9ca19dc97a9cdef75a9e49bd5daea5c8"/><file name="SyncController.php" hash="4ba97098c8cbf330982b03911181fc3e"/></dir><dir name="etc"><file name="config.xml" hash="4f075b507ccebf6db2ae4bde4c0252b0"/></dir><file name="Codi_Process.php" hash="fbbd13784f36efb5db3cf10f5981bcce"/></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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_PDF_per_Product</name>
4
+ <version>3.0.1</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.1 - Added Magento 1.6 compatibility.</notes>
12
  <authors><author><name>catalogondemand</name><user>auto-converted</user><email>timh@catalog-on-demand.com</email></author></authors>
13
+ <date>2011-11-08</date>
14
+ <time>09:39:19</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="mageweb"><dir name="js"><dir name="jquery"><file name="jquery-1.2.6.noConflict.min.js" hash="090fdb3fbcb4727c0ca20cca87e7e12d"/><file name="jquery.tooltip.js" hash="d17cc8af1b8a595bd597084232be87e0"/></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="f921a1948213fb08775adc9b4e57b955"/></dir></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="de6b3d9d0787a3f96955b8089898b441"/></dir></dir></dir></dir></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="0d74bdf48e12047e7317e4a877efb30d"/></dir><dir name="Customer"><file name="Codi.php" hash="17c557dbcfadd336dc7ba773d6304fc0"/></dir></dir><dir name="Helper"><file name="Data.php" hash="9eb7d7267d816ede3f042edae8bae4d6"/></dir><dir name="Model"><file name="Codi.php" hash="a7b2befcffbeaffd4f1c5ed5546e57c4"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MenuController.php" hash="c4c6c4b7e594047f5977b3443d3dc324"/></dir><file name="DeleteController.php" hash="fed4a29a509a181f0f185de0609872db"/><file name="NsyncController.php" hash="956d90a4f986b5a5a8347d429ff0487d"/><file name="SyncController.php" hash="be23847dd365c3f0ba5efb467a6b1f6b"/></dir><dir name="etc"><file name="config.xml" hash="2d0030b10a462c3e2f2ebff532befabe"/></dir><file name="Codi_Process.php" hash="fbbd13784f36efb5db3cf10f5981bcce"/></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>