Easy_PDF_Invoice_Custom_Variables - Version 1.0.0.7.2

Version Notes

- Allow to define variable which relate to product attribute
- Allow to define variable which relate to customer attribute
- Allow to define static values

Download this release

Release Info

Developer Magento Core Team
Extension Easy_PDF_Invoice_Custom_Variables
Version 1.0.0.7.2
Comparing to
See all releases


Code changes from version 1.0.0.7 to 1.0.0.7.2

app/code/community/VES/PdfProCustomVariables/Model/Observer.php CHANGED
@@ -51,6 +51,35 @@ class VES_PdfProCustomVariables_Model_Observer
51
  return $result;
52
  }
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  public function ves_pdfpro_data_prepare_after($observer){
55
  $type = $observer->getType();
56
  if($type=='item'){
51
  return $result;
52
  }
53
 
54
+ /**
55
+ * Add custom variables for PDF Invoice Pro
56
+ * @param Varien_Event_Observer $observer
57
+ */
58
+ public function ves_advancedpdfprocessor_init_item_attribute_after(Varien_Event_Observer $observer){
59
+ $groups = $observer->getAttributes(); /*array*/
60
+ $custom_attributes = Mage::getModel('pdfprocustomvariables/pdfprocustomvariables')
61
+ ->getCollection()->addFieldToFilter('variable_type','attribute');
62
+
63
+ $attributes = array();
64
+ foreach($custom_attributes as $_attribute) {
65
+ $_attribute_id = $_attribute->getAttributeId();
66
+ $model = Mage::getModel('eav/entity_attribute')->load($_attribute_id);
67
+
68
+ $attributes[] = array('title' => $_attribute->getName() , 'code' => 'ves_'.$_attribute->getName()); //not $model->getAttributeCode()
69
+ //because items in VES_AdvancedPdfProcessor_Model_Template_Filter line 353
70
+ // has product attribute
71
+ }
72
+
73
+ $attributes[] = array('title' => '---Custom' , 'code' => 'ves_custom');
74
+
75
+ $observer->getAttributes()->setData('custom',array('label'=>'Custom Attributes','value' => $attributes));
76
+
77
+ }
78
+
79
+ /**
80
+ * Add custom variables for Easy PDF Invoice extension.
81
+ * @param unknown_type $observer
82
+ */
83
  public function ves_pdfpro_data_prepare_after($observer){
84
  $type = $observer->getType();
85
  if($type=='item'){
app/code/community/VES/PdfProCustomVariables/etc/config.xml CHANGED
@@ -65,6 +65,14 @@
65
  </pdfprocustomvariables>
66
  </observers>
67
  </ves_pdfpro_data_prepare_after>
 
 
 
 
 
 
 
 
68
  </events>
69
 
70
  <models>
65
  </pdfprocustomvariables>
66
  </observers>
67
  </ves_pdfpro_data_prepare_after>
68
+ <ves_advancedpdfprocessor_init_item_attribute_after>
69
+ <observers>
70
+ <pdfprocustomvariables>
71
+ <class>pdfprocustomvariables/observer</class>
72
+ <method>ves_advancedpdfprocessor_init_item_attribute_after</method>
73
+ </pdfprocustomvariables>
74
+ </observers>
75
+ </ves_advancedpdfprocessor_init_item_attribute_after>
76
  </events>
77
 
78
  <models>
app/design/adminhtml/default/default/template/ves_pdfprocustomvariables/intergrationcode.phtml CHANGED
@@ -13,8 +13,9 @@
13
  <pre>{{var item.product.<?php echo $this->getPdfProCustomVariables()->getName()?>.long}}</pre><br />
14
  <pre>{{var item.product.<?php echo $this->getPdfProCustomVariables()->getName()?>.medium}}</pre><br />
15
  <pre>{{var item.product.<?php echo $this->getPdfProCustomVariables()->getName()?>.short}}</pre>
 
16
  <?php else:?>
17
- <pre>{{var item.product.<?php echo $this->getPdfProCustomVariables()->getName()?>}}</pre>
18
  <?php endif;?>
19
  <?php elseif($this->getPdfProCustomVariables()->getVariableType() == 'static'):?>
20
  <pre>{{var item.<?php echo $this->getPdfProCustomVariables()->getName()?>}}</pre>
13
  <pre>{{var item.product.<?php echo $this->getPdfProCustomVariables()->getName()?>.long}}</pre><br />
14
  <pre>{{var item.product.<?php echo $this->getPdfProCustomVariables()->getName()?>.medium}}</pre><br />
15
  <pre>{{var item.product.<?php echo $this->getPdfProCustomVariables()->getName()?>.short}}</pre>
16
+ <?php elseif(Mage::getModel('pdfprocustomvariables/pdfprocustomvariables')->checkAttributeFrontendType($this->getPdfProCustomVariables(), 'image')):?>
17
  <?php else:?>
18
+ <pre>&lt;img src="{{var item.product.<?php echo $this->getPdfProCustomVariables()->getName()?>}}" width="50" height="50"/&gt;</pre>
19
  <?php endif;?>
20
  <?php elseif($this->getPdfProCustomVariables()->getVariableType() == 'static'):?>
21
  <pre>{{var item.<?php echo $this->getPdfProCustomVariables()->getName()?>}}</pre>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Easy_PDF_Invoice_Custom_Variables</name>
4
- <version>1.0.0.7</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL V3.0</license>
7
  <channel>community</channel>
@@ -12,9 +12,9 @@
12
  - Allow to define variable which relate to customer attribute&#xD;
13
  - Allow to define static values</notes>
14
  <authors><author><name>Easy PDF Invoice</name><user>auto-converted</user><email>easypdfinvoice@gmail.com</email></author></authors>
15
- <date>2013-09-10</date>
16
- <time>14:25:12</time>
17
- <contents><target name="mageetc"><dir name="modules"><file name="VES_PdfProCustomVariables.xml" hash="f13346f67bbae21fdb87a393a4663ea5"/></dir></target><target name="magecommunity"><dir name="VES"><dir name="PdfProCustomVariables"><dir name="Block"><dir name="Adminhtml"><dir name="Pdfprocustomvariables"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="3870bf494d27ac725fdf0277bcaff17e"/><file name="Intergration.php" hash="236d9e8f74e88befcc05a3d848a8ae56"/></dir><file name="Form.php" hash="1f87d9ee6ce3df463f027ff96aae6cda"/><file name="Tabs.php" hash="1261d8486ffd5c6f41af7e97ddbd56e8"/></dir><file name="Edit.php" hash="25810b8c5ca254c10a0e981e1639e7b9"/><file name="Grid.php" hash="2f8f5025bb9df25d4c2a473821fd74fe"/></dir><file name="Pdfprocustomvariables.php" hash="91f8d4310da8f8da46c6a142e5b38738"/></dir></dir><dir name="Helper"><file name="Data.php" hash="2aba96822fcc8fb043792d40baa2e90a"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Pdfprocustomvariables"><file name="Collection.php" hash="96ce5d49fee8ca2e52164714a42a9b28"/></dir><file name="Pdfprocustomvariables.php" hash="4718330435a78a6313914cb5e062d3d7"/></dir><file name="Observer.php" hash="1867d5a448ed48821cba5a7a80d9f0ad"/><file name="Pdfprocustomvariables.php" hash="57161bc69c6c478d4f084b4cd4e5e766"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="VariablesController.php" hash="13b5cccde7acdc30197eb258975916ff"/></dir></dir><dir name="etc"><file name="config.xml" hash="fab63b17cf036596080c7a4b88da99c6"/></dir><dir name="sql"><dir name="pdfprocustomvariables_setup"><file name="mysql4-install-1.0.0.php" hash="203b4b818ccba7bd2107ae1047192b42"/><file name="mysql4-upgrade-1.0.0-1.0.0.1.php" hash="05564671ba8ea3cad6c07202921f1b5a"/><file name="mysql4-upgrade-1.0.0.1-1.0.0.2.php" hash="a036e5b1226ff5bfcdf8181ac983b5e0"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="ves_pdfprocustomvariables.xml" hash="347f0604dabbc274177ab47b06587cf3"/></dir><dir name="template"><dir name="ves_pdfprocustomvariables"><file name="intergrationcode.phtml" hash="abdd9e53f9f63fe0b945b4af075f3d7b"/></dir></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies/>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Easy_PDF_Invoice_Custom_Variables</name>
4
+ <version>1.0.0.7.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL V3.0</license>
7
  <channel>community</channel>
12
  - Allow to define variable which relate to customer attribute&#xD;
13
  - Allow to define static values</notes>
14
  <authors><author><name>Easy PDF Invoice</name><user>auto-converted</user><email>easypdfinvoice@gmail.com</email></author></authors>
15
+ <date>2013-10-01</date>
16
+ <time>14:42:45</time>
17
+ <contents><target name="mageetc"><dir name="modules"><file name="VES_PdfProCustomVariables.xml" hash="f13346f67bbae21fdb87a393a4663ea5"/></dir></target><target name="magecommunity"><dir name="VES"><dir name="PdfProCustomVariables"><dir name="Block"><dir name="Adminhtml"><dir name="Pdfprocustomvariables"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="3870bf494d27ac725fdf0277bcaff17e"/><file name="Intergration.php" hash="236d9e8f74e88befcc05a3d848a8ae56"/></dir><file name="Form.php" hash="1f87d9ee6ce3df463f027ff96aae6cda"/><file name="Tabs.php" hash="1261d8486ffd5c6f41af7e97ddbd56e8"/></dir><file name="Edit.php" hash="25810b8c5ca254c10a0e981e1639e7b9"/><file name="Grid.php" hash="2f8f5025bb9df25d4c2a473821fd74fe"/></dir><file name="Pdfprocustomvariables.php" hash="91f8d4310da8f8da46c6a142e5b38738"/></dir></dir><dir name="Helper"><file name="Data.php" hash="2aba96822fcc8fb043792d40baa2e90a"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Pdfprocustomvariables"><file name="Collection.php" hash="96ce5d49fee8ca2e52164714a42a9b28"/></dir><file name="Pdfprocustomvariables.php" hash="4718330435a78a6313914cb5e062d3d7"/></dir><file name="Observer.php" hash="136dacdbd35cc500df0ee89f72f74946"/><file name="Pdfprocustomvariables.php" hash="57161bc69c6c478d4f084b4cd4e5e766"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="VariablesController.php" hash="13b5cccde7acdc30197eb258975916ff"/></dir></dir><dir name="etc"><file name="config.xml" hash="6950bfaf8df8473302c460041002f970"/></dir><dir name="sql"><dir name="pdfprocustomvariables_setup"><file name="mysql4-install-1.0.0.php" hash="203b4b818ccba7bd2107ae1047192b42"/><file name="mysql4-upgrade-1.0.0-1.0.0.1.php" hash="05564671ba8ea3cad6c07202921f1b5a"/><file name="mysql4-upgrade-1.0.0.1-1.0.0.2.php" hash="a036e5b1226ff5bfcdf8181ac983b5e0"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="ves_pdfprocustomvariables.xml" hash="347f0604dabbc274177ab47b06587cf3"/></dir><dir name="template"><dir name="ves_pdfprocustomvariables"><file name="intergrationcode.phtml" hash="8670a13dd80e6be95c78afdc89296463"/></dir></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies/>
20
  </package>