Cart_Fileupload - Version 0.1.1

Version Notes

It is stable version

Download this release

Release Info

Developer Dynamic Dreamz
Extension Cart_Fileupload
Version 0.1.1
Comparing to
See all releases


Code changes from version 0.1.0 to 0.1.1

app/code/community/DD/Upload/Helper/Data.php CHANGED
@@ -11,6 +11,15 @@
11
  class DD_Upload_Helper_Data extends Mage_Core_Helper_Abstract {
12
 
13
 
 
 
 
 
 
 
 
 
 
14
  /**
15
  * Check uploaded file extnsion and return file type
16
  * @param string $ext
11
  class DD_Upload_Helper_Data extends Mage_Core_Helper_Abstract {
12
 
13
 
14
+ /**
15
+ * Check if module is enable or not
16
+ * @return int
17
+ */
18
+
19
+ public function isEnabled() {
20
+ return Mage::getStoreConfig("generalsettings/configuration/enable_module");
21
+ }
22
+
23
  /**
24
  * Check uploaded file extnsion and return file type
25
  * @param string $ext
app/code/community/DD/Upload/Model/Observer.php CHANGED
@@ -14,20 +14,22 @@ class DD_Upload_Model_Observer {
14
  * @param object $evt
15
  */
16
  public function saveQuoteAfter($evt) {
17
- $quote = $evt->getQuote();
18
- try {
19
- $flag = '';
20
- $data = Mage::getSingleton('core/session')->getData();
21
- $flag = Mage::getSingleton('core/session')->getFlag();
22
- if (isset($data['file_upload_path']) && $flag == 'on') {
23
- $quote_id = $quote->getId();
24
- Mage::getModel('upload/upload')->saveFile($quote_id, $data['file_upload_path'], $data['file_upload_type']);
25
- Mage::getSingleton('core/session')->unsData();
26
- Mage::getSingleton('core/session')->unsFlag();
27
- $flag = 'off';
 
 
 
 
28
  }
29
- } catch (Exception $e) {
30
- Mage::log($e->getMessage());
31
  }
32
  }
33
 
@@ -36,17 +38,19 @@ class DD_Upload_Model_Observer {
36
  * @param object $event
37
  */
38
  public function placeOrderAfter($event) {
39
- try {
40
- $order_id = $event->getEvent()->getOrder()->getId();
41
- $order = Mage::getModel('sales/order')->load($order_id);
42
- $quote_id = $order->getQuoteId();
43
- $collection = Mage::getModel('upload/upload')->getCollection();
44
- $collection->addFieldToFilter('quote_id', $quote_id);
45
- foreach ($collection as $object) {
46
- Mage::getModel('upload/order')->saveFile($order_id, $object->getFilename(), $object->getType());
 
 
 
 
47
  }
48
- } catch (Exception $e) {
49
- Mage::log($e->getMessage());
50
  }
51
  }
52
 
14
  * @param object $evt
15
  */
16
  public function saveQuoteAfter($evt) {
17
+ if (Mage::helper('upload')->isEnabled()) {
18
+ $quote = $evt->getQuote();
19
+ try {
20
+ $flag = '';
21
+ $data = Mage::getSingleton('core/session')->getData();
22
+ $flag = Mage::getSingleton('core/session')->getFlag();
23
+ if (isset($data['file_upload_path']) && $flag == 'on') {
24
+ $quote_id = $quote->getId();
25
+ Mage::getModel('upload/upload')->saveFile($quote_id, $data['file_upload_path'], $data['file_upload_type']);
26
+ Mage::getSingleton('core/session')->unsData();
27
+ Mage::getSingleton('core/session')->unsFlag();
28
+ $flag = 'off';
29
+ }
30
+ } catch (Exception $e) {
31
+ Mage::log($e->getMessage());
32
  }
 
 
33
  }
34
  }
35
 
38
  * @param object $event
39
  */
40
  public function placeOrderAfter($event) {
41
+ if (Mage::helper('upload')->isEnabled()) {
42
+ try {
43
+ $order_id = $event->getEvent()->getOrder()->getId();
44
+ $order = Mage::getModel('sales/order')->load($order_id);
45
+ $quote_id = $order->getQuoteId();
46
+ $collection = Mage::getModel('upload/upload')->getCollection();
47
+ $collection->addFieldToFilter('quote_id', $quote_id);
48
+ foreach ($collection as $object) {
49
+ Mage::getModel('upload/order')->saveFile($order_id, $object->getFilename(), $object->getType());
50
+ }
51
+ } catch (Exception $e) {
52
+ Mage::log($e->getMessage());
53
  }
 
 
54
  }
55
  }
56
 
app/code/community/DD/Upload/etc/config.xml CHANGED
@@ -11,7 +11,7 @@
11
  <config>
12
  <modules>
13
  <DD_Upload>
14
- <version>0.1.0</version>
15
  </DD_Upload>
16
  </modules>
17
 
11
  <config>
12
  <modules>
13
  <DD_Upload>
14
+ <version>0.1.1</version>
15
  </DD_Upload>
16
  </modules>
17
 
app/code/community/DD/Upload/sql/upload_setup/{mysql4-install-0.1.0.php → mysql4-install-0.1.1.php} RENAMED
File without changes
app/design/adminhtml/default/default/template/upload/sales/order/view/uploadfile.phtml CHANGED
@@ -10,8 +10,7 @@
10
  <!--uploaded file Information-->
11
  <?php $_order = $this->getOrder() ?>
12
  <?php
13
- $enable = Mage::getStoreConfig("generalsettings/configuration/enable_module");
14
- if ($enable) {
15
  ?>
16
  <div class="clear">
17
  <div class="entry-edit">
10
  <!--uploaded file Information-->
11
  <?php $_order = $this->getOrder() ?>
12
  <?php
13
+ if (Mage::helper('upload')->isEnabled()) {
 
14
  ?>
15
  <div class="clear">
16
  <div class="entry-edit">
app/design/frontend/base/default/template/upload/checkout/uploads.phtml CHANGED
@@ -6,8 +6,7 @@
6
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL)
7
  -->
8
  <?php echo $this->getChildHtml('cart_main'); ?>
9
- <?php $enable = Mage::getStoreConfig("generalsettings/configuration/enable_module"); ?>
10
- <?php if ($enable) { ?>
11
  <div class="custom-upload-cart">
12
  <div class="custom-cart">
13
  <div class="dd_upload">
6
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL)
7
  -->
8
  <?php echo $this->getChildHtml('cart_main'); ?>
9
+ <?php if (Mage::helper('upload')->isEnabled()) { ?>
 
10
  <div class="custom-upload-cart">
11
  <div class="custom-cart">
12
  <div class="dd_upload">
app/design/frontend/base/default/template/upload/sales/order/info.phtml CHANGED
@@ -82,8 +82,7 @@
82
  </div>
83
  </div>
84
  <?php
85
- $enable = Mage::getStoreConfig("generalsettings/configuration/enable_module");
86
- if ($enable) {
87
  ?>
88
  <link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl("css/upload/upload.css") ?>">
89
  <div class="col1-set order-info-box fileupload">
82
  </div>
83
  </div>
84
  <?php
85
+ if (Mage::helper('upload')->isEnabled()) {
 
86
  ?>
87
  <link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl("css/upload/upload.css") ?>">
88
  <div class="col1-set order-info-box fileupload">
cart_fileupload_features.docx ADDED
Binary file
cart_fileupload_features.odt DELETED
Binary file
cart_fileupload_manual.docx CHANGED
Binary file
package.xml CHANGED
@@ -1,36 +1,37 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Cart_Fileupload</name>
4
- <version>0.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Customer can upload multiple files on cart page according to their needs and admin can see the uploaded files in order view page.</summary>
10
- <description>Would you like to give your customer an option to upload Files or Images at cart page? then this extension is for you. This extension provide facility to upload multiple files on cart page. Customer can browse and upload files easily which will be stored in database with their order details. &#xD;
11
  &#xD;
12
  1. This extension gives the facility to upload multiple files on cart page.&#xD;
13
  &#xD;
14
  2. Customers can upload multiple types of files like image, text, document, PDF etc.&#xD;
15
  &#xD;
16
- 3. Customers can easily edit and delete the file(s) as per their custom requirements.&#xD;
17
  &#xD;
18
- 4. Standard settings for maximum file size and number of files to be uploaded in Admin.&#xD;
19
  &#xD;
20
- 5. All uploaded files by the customer on cart page for the particular order will show on &#x201C;order view page&#x201D; in admin section and as well as it'll show on frontend in &#x201C;My Orders&#x201D; section of customer account. &#xD;
21
  &#xD;
22
- 6. A separate section in &#x201C;order view page&#x201D; for uploading files.&#xD;
23
  &#xD;
24
  7. File Sorting is possible because of listing of files with their types, names and thumbnails.&#xD;
25
  &#xD;
26
  8. By clicking particular file name or thumbnail admin can access it quickly in new tab.&#xD;
27
  &#xD;
28
- 9. Compatible with all Magento versions from 1.4 to 1.9.</description>
 
29
  <notes>It is stable version</notes>
30
- <authors><author><name>Dynamic Dreamz</name><user>dynamic_dreamz</user><email>info@dynamicdreamz.com</email></author></authors>
31
- <date>2015-09-24</date>
32
- <time>13:00:59</time>
33
- <contents><target name="magecommunity"><dir name="DD"><dir name="Upload"><dir name="Block"><file name="Upload.php" hash="7fc82b99d7f74e36f70e65f18649a7c3"/></dir><dir name="Helper"><file name="Data.php" hash="3f301aec612844a79d5000f24090fd2a"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Order"><file name="Collection.php" hash="4433076a1aa37c0927b0922d3447724f"/></dir><file name="Order.php" hash="e6fff2603115270ea274235aec21dc7d"/><dir name="Upload"><file name="Collection.php" hash="c53e84b113fc62a9ed26023a1f213220"/></dir><file name="Upload.php" hash="8b2f88d113854ad6c25173c0aa319ca5"/></dir><file name="Observer.php" hash="5320919948945035196de4328d2d1fe0"/><file name="Order.php" hash="65ca9ab6e0035b4f4a1b2f72ce10732e"/><file name="Upload.php" hash="6302a8ba4850a97f5eae78da46d17caf"/></dir><dir name="controllers"><file name="IndexController.php" hash="2c55a20ee9d73f832213bc78ad9d3a7a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="ffc0ef8a617de02356a817e1c7ff6920"/><file name="config.xml" hash="efef5ae67d9397e393eb914c566a7afb"/><file name="system.xml" hash="395b8bd0e38d4dfe96833d3b34dcd25a"/></dir><dir name="sql"><dir name="upload_setup"><file name="mysql4-install-0.1.0.php" hash="d811f00387fab3238b1992a58303c614"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="upload"><dir name="sales"><dir name="order"><dir name="view"><file name="info.phtml" hash="ede3cf763b77ff6960b93d71877161c1"/><file name="uploadfile.phtml" hash="67c193b3f21085ffd848ecdbf9fed62e"/></dir></dir></dir></dir></dir><dir name="layout"><file name="upload.xml" hash="81aeb92327bad124a25e014981ffdb4c"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="upload"><dir name="checkout"><file name="uploads.phtml" hash="c92e1e71a8620e283f6af81772672acd"/></dir><dir name="sales"><dir name="order"><file name="info.phtml" hash="78fc1fcd26257f0b16cec5910a10c7d3"/></dir></dir></dir></dir><dir name="layout"><file name="upload.xml" hash="754b8c8e6cbc95bdf28205da341c96eb"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="DD_Upload.xml" hash="ff112bd586d7e53d8db42f2865d35888"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="upload"><file name="upload.css" hash="5bc8d1572d731e85fa60a8120909df65"/></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="uploads"><dir name="icons"><file name="csv.png" hash="05602a994d5911c675abf7c8f37af763"/><file name="csv2.png" hash="8f6d50c8378ea10f961dc71bcb68c219"/><file name="default.png" hash="1a7a998b053b9397ff911624c3c14d37"/><file name="doc.png" hash="c8fb60063316dc015962021bce731d12"/><file name="docx.png" hash="d8410c4b56dc05dd4142667ed8ec8400"/><file name="error4.jpg" hash="d22c10dcd0da5e58e072a52fe7c0a57f"/><file name="missing.png" hash="fcbb8da751c7c1012d065528f46dd0fd"/><file name="missing1.png" hash="c03b474103ef9f81377556e7d99b8fbe"/><file name="ods.png" hash="edc457d897ef132f188e0ca43014e2b0"/><file name="odt.png" hash="041424c20b31491606a7fe0ca822b21c"/><file name="odt2.png" hash="9191ffe8b5f81ada7b48d0214cefb784"/><file name="pdf.png" hash="285fe75f2229f32aa240cdac26ca2958"/><file name="pptx.png" hash="70eb85ebddc8ff5e803a1d215fd84448"/><file name="txt.png" hash="d6ec5f8e962c7ffb7523314094b653fa"/><file name="unknown.png" hash="e87a7bf4a73d55c6a6c5377a71e7990f"/><file name="unknown1.png" hash="68cab465563cb8f931005815a76afe6d"/><file name="unkown2.png" hash="b5dad7d90ac05941a1472ad50f5a6d05"/><file name="xls.png" hash="a48a26cbd5153f72679d8d3a1fcdc8a5"/><file name="xml.png" hash="5fce69e918a098660dc4c802c5c27d4c"/></dir></dir></target><target name="mage"><dir name="."><file name="cart_fileupload_features.odt" hash="cc514483bba8f193df20f392a4cd6ce6"/><file name="cart_fileupload_manual.docx" hash="b04c89d168815bf7a96533ed3620810e"/></dir></target></contents>
34
  <compatible/>
35
- <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.4.0.0</min><max>1.9</max></package><extension><name>gd</name><min>2.0.28</min><max>3.0</max></extension></required></dependencies>
36
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Cart_Fileupload</name>
4
+ <version>0.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Customer can upload multiple files on cart page and admin can see the uploaded files in order view page.</summary>
10
+ <description>Would you like to give your customer an option to upload Files or Images on cart page? Then this is the perfect extension for you!! This extension provides facility to upload multiple files on cart page. Customers can browse and upload files easily according to their needs and admin can easily view these files in &#x201C;order view&#x201D; page. This is helpful in making good relationship with the customers and customer experiences. Not only feed back but it also helps in increasing sales of your business.&#xD;
11
  &#xD;
12
  1. This extension gives the facility to upload multiple files on cart page.&#xD;
13
  &#xD;
14
  2. Customers can upload multiple types of files like image, text, document, PDF etc.&#xD;
15
  &#xD;
16
+ 3. Customers can easily view and delete the uploaded file(s) as per their custom requirements.&#xD;
17
  &#xD;
18
+ 4. Standard settings for module enable/disable, maximum file size and number of files to be uploaded in Admin.&#xD;
19
  &#xD;
20
+ 5. All uploaded files by the customer on cart page for the particular order will show on &#x201C;order view page&#x201D; in admin section and as well as it'll show on front end in &#x201C;My Orders&#x201D; section of customer account. &#xD;
21
  &#xD;
22
+ 6. A separate section in &#x201C;order view page&#x201D; for uploaded files named as &#x201C;Uploaded File Information&#x201D;.&#xD;
23
  &#xD;
24
  7. File Sorting is possible because of listing of files with their types, names and thumbnails.&#xD;
25
  &#xD;
26
  8. By clicking particular file name or thumbnail admin can access it quickly in new tab.&#xD;
27
  &#xD;
28
+ 9. Compatible with all Magento versions from 1.5 to 1.9.&#xD;
29
+ </description>
30
  <notes>It is stable version</notes>
31
+ <authors><author><name>Dynamic Dreamz</name><user>dynamicdreamz</user><email>info@dynamicdreamz.com</email></author></authors>
32
+ <date>2015-09-30</date>
33
+ <time>06:14:33</time>
34
+ <contents><target name="magecommunity"><dir name="DD"><dir name="Upload"><dir name="Block"><file name="Upload.php" hash="7fc82b99d7f74e36f70e65f18649a7c3"/></dir><dir name="controllers"><file name="IndexController.php" hash="2c55a20ee9d73f832213bc78ad9d3a7a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="ffc0ef8a617de02356a817e1c7ff6920"/><file name="config.xml" hash="260b3daf2201dc9e5dca0c8db231b44e"/><file name="system.xml" hash="395b8bd0e38d4dfe96833d3b34dcd25a"/></dir><dir name="Helper"><file name="Data.php" hash="61b4da5ca242a7ae3dc9c700eab47a84"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Order"><file name="Collection.php" hash="4433076a1aa37c0927b0922d3447724f"/></dir><file name="Order.php" hash="e6fff2603115270ea274235aec21dc7d"/><dir name="Upload"><file name="Collection.php" hash="c53e84b113fc62a9ed26023a1f213220"/></dir><file name="Upload.php" hash="8b2f88d113854ad6c25173c0aa319ca5"/></dir><file name="Observer.php" hash="47103f4ac8fbcddf325c538ba060c6d8"/><file name="Order.php" hash="65ca9ab6e0035b4f4a1b2f72ce10732e"/><file name="Upload.php" hash="6302a8ba4850a97f5eae78da46d17caf"/></dir><dir name="sql"><dir name="upload_setup"><file name="mysql4-install-0.1.1.php" hash="d811f00387fab3238b1992a58303c614"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="upload"><dir name="sales"><dir name="order"><dir name="view"><file name="info.phtml" hash="ede3cf763b77ff6960b93d71877161c1"/><file name="uploadfile.phtml" hash="3e04418acf1f68be4ed03dabbd9462cb"/></dir></dir></dir></dir></dir><dir name="layout"><file name="upload.xml" hash="81aeb92327bad124a25e014981ffdb4c"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="upload"><dir name="checkout"><file name="uploads.phtml" hash="65e2b5228d8d85b50193693ab8cf8b52"/></dir><dir name="sales"><dir name="order"><file name="info.phtml" hash="7bb55bb912c62e16e0b0baa0cf41996f"/></dir></dir></dir></dir><dir name="layout"><file name="upload.xml" hash="754b8c8e6cbc95bdf28205da341c96eb"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="DD_Upload.xml" hash="ff112bd586d7e53d8db42f2865d35888"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="upload"><file name="upload.css" hash="5bc8d1572d731e85fa60a8120909df65"/></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="uploads"><dir name="icons"><file name="csv2.png" hash="8f6d50c8378ea10f961dc71bcb68c219"/><file name="csv.png" hash="05602a994d5911c675abf7c8f37af763"/><file name="default.png" hash="1a7a998b053b9397ff911624c3c14d37"/><file name="doc.png" hash="c8fb60063316dc015962021bce731d12"/><file name="docx.png" hash="d8410c4b56dc05dd4142667ed8ec8400"/><file name="error4.jpg" hash="d22c10dcd0da5e58e072a52fe7c0a57f"/><file name="missing1.png" hash="c03b474103ef9f81377556e7d99b8fbe"/><file name="missing.png" hash="fcbb8da751c7c1012d065528f46dd0fd"/><file name="ods.png" hash="edc457d897ef132f188e0ca43014e2b0"/><file name="odt2.png" hash="9191ffe8b5f81ada7b48d0214cefb784"/><file name="odt.png" hash="041424c20b31491606a7fe0ca822b21c"/><file name="pdf.png" hash="285fe75f2229f32aa240cdac26ca2958"/><file name="pptx.png" hash="70eb85ebddc8ff5e803a1d215fd84448"/><file name="txt.png" hash="d6ec5f8e962c7ffb7523314094b653fa"/><file name="unknown1.png" hash="68cab465563cb8f931005815a76afe6d"/><file name="unknown.png" hash="e87a7bf4a73d55c6a6c5377a71e7990f"/><file name="unkown2.png" hash="b5dad7d90ac05941a1472ad50f5a6d05"/><file name="xls.png" hash="a48a26cbd5153f72679d8d3a1fcdc8a5"/><file name="xml.png" hash="5fce69e918a098660dc4c802c5c27d4c"/></dir></dir></target><target name="mage"><dir name="."><file name="cart_fileupload_features.docx" hash="f824ca9ff944c163f872972dc59fd88d"/><file name="cart_fileupload_manual.docx" hash="52e57e40f2af2029c34b06802774264a"/></dir></target></contents>
35
  <compatible/>
36
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.5.0.0</min><max>1.9</max></package><extension><name>gd</name><min>2.0.28</min><max>3.0</max></extension></required></dependencies>
37
  </package>