Easy_PDF_Invoice_Custom_Variables - Version 1.0.0.8

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


Code changes from version 1.0.0.7.4 to 1.0.0.8

app/code/community/VES/PdfProCustomVariables/Helper/Image.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class VES_PdfProCustomVariables_Helper_Image extends Mage_Catalog_Helper_Image
4
+ {
5
+ /**
6
+ * Get current Image model
7
+ *
8
+ * @return Mage_Catalog_Model_Product_Image
9
+ */
10
+ public function getModel()
11
+ {
12
+ return $this->_model;
13
+ }
14
+ }
app/code/community/VES/PdfProCustomVariables/Model/Observer.php CHANGED
@@ -162,9 +162,20 @@ class VES_PdfProCustomVariables_Model_Observer
162
  break;
163
 
164
  case 'media_image':
165
- isset($availableAttributes[$attributeInfo->getAttributeCode()]) ?
166
- $src = Mage::getBaseUrl('media') . 'catalog/product' . $product->getData($attributeInfo->getAttributeCode())
167
- : $src = '';
 
 
 
 
 
 
 
 
 
 
 
168
  $itemProduct->setData($data['name'], $src);
169
  break;
170
 
162
  break;
163
 
164
  case 'media_image':
165
+ if(isset($availableAttributes[$attributeInfo->getAttributeCode()]) &&
166
+ $availableAttributes[$attributeInfo->getAttributeCode()] &&
167
+ ($imageFile = $product->getData($attributeInfo->getAttributeCode()))){
168
+ $helper = Mage::helper('pdfprocustomvariables/image')->init($product, 'image',$imageFile)->resize(120);
169
+ $model = $helper->getModel();
170
+ $url = $helper.'';
171
+ $src = $model->getNewFile();
172
+ $src = base64_encode(file_get_contents($src));
173
+ $src ='data:image/png;base64,'.$src;
174
+ }else{
175
+ $src = Mage::getBaseDir('skin').DS.'frontend'.DS.'base'.DS.'default'.DS.'images'.DS.'catalog'.DS.'product'.DS.'placeholder'.DS.'thumbnail.jpg';
176
+ $src = base64_encode(file_get_contents($src));
177
+ $src ='data:image/png;base64,'.$src;
178
+ }
179
  $itemProduct->setData($data['name'], $src);
180
  break;
181
 
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.4</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-12-29</date>
16
- <time>14:43:04</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="f41380831d0ea82e87e45a5a2c6ab7d5"/><file name="Pdfprocustomvariables.php" hash="8d2d970597d131ed6ee19bb69d541308"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="VariablesController.php" hash="4db0fd48751f42f539c6e1cbd6a95276"/></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="a0e8686b6585304a99313fe3f7f7cb83"/></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.8</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>2014-03-07</date>
16
+ <time>17:04:56</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"/><file name="Image.php" hash="091cb7db9e1959e6dd307f8db2b25ba1"/></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="aa42d2a3165fcbccef469cb670da7784"/><file name="Pdfprocustomvariables.php" hash="8d2d970597d131ed6ee19bb69d541308"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="VariablesController.php" hash="4db0fd48751f42f539c6e1cbd6a95276"/></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="a0e8686b6585304a99313fe3f7f7cb83"/></dir></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies/>
20
  </package>