Diglin_Addinfotoemail - Version 1.1.0

Version Notes

Version 1.1.0: change module name, tested on Magento 1.5 and 1.6
Version 1.0.0: stable version tested on Magento 1.3.2.4 and 1.4.1

Download this release

Release Info

Developer Magento Core Team
Extension Diglin_Addinfotoemail
Version 1.1.0
Comparing to
See all releases


Version 1.1.0

app/code/community/Diglin/Addinfotoemail/Block/Product/Email/Comments.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Diglin
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 Diglin
22
+ * @package Diglin_Addinfotoemail
23
+ * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Diglin_Addinfotoemail_Block_Product_Email_Comments extends Mage_Core_Block_Template {
27
+
28
+ /**
29
+ *
30
+ * @param Mage_Sales_Model_Order_Item $items
31
+ * @return array $comments
32
+ */
33
+ public function getComments($items) {
34
+ $comments = array();
35
+ if (is_array ( $items )) {
36
+ $i = 0;
37
+ foreach ( $items as $item ) {
38
+ $product = Mage::getModel ( 'catalog/product' )->load ( $item->getProductId () );
39
+ $comment = $product->getCommentMail ();
40
+ if (! empty ( $comment )) {
41
+ $comments [$i] ['title'] = $product->getName ();
42
+ $comments [$i] ['comment'] = $comment;
43
+ $i ++;
44
+ }
45
+ }
46
+ }
47
+ return $comments;
48
+ }
49
+ }
app/code/community/Diglin/Addinfotoemail/Helper/Data.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Diglin
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 Diglin
22
+ * @package Diglin_Addinfotoemail
23
+ * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ /**
27
+ * Only for String Translation
28
+ */
29
+ class Diglin_Addinfotoemail_Helper_Data extends Mage_Core_Helper_Abstract{}
app/code/community/Diglin/Addinfotoemail/Model/Entity/Setup.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Diglin
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 Diglin
22
+ * @package Diglin_Addinfotoemail
23
+ * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Diglin_Addinfotoemail_Model_Entity_Setup extends Mage_Catalog_Model_Resource_Eav_Mysql4_Setup{}
app/code/community/Diglin/Addinfotoemail/etc/config.xml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Diglin_Addinfotoemail>
5
+ <version>1.1.0</version>
6
+ </Diglin_Addinfotoemail>
7
+ </modules>
8
+
9
+ <global>
10
+ <blocks>
11
+ <addinfotoemail>
12
+ <class>Diglin_Addinfotoemail_Block</class>
13
+ </addinfotoemail>
14
+ </blocks>
15
+ <helpers>
16
+ <addinfotoemail>
17
+ <class>Diglin_Addinfotoemail_Helper</class>
18
+ </addinfotoemail>
19
+ </helpers>
20
+ <resources>
21
+ <addinfotoemail_setup>
22
+ <setup>
23
+ <module>Diglin_Addinfotoemail</module>
24
+ <class>Diglin_Addinfotoemail_Model_Entity_Setup</class>
25
+ </setup>
26
+ <connection>
27
+ <use>default_setup</use>
28
+ </connection>
29
+ </addinfotoemail_setup>
30
+ <addinfotoemail_write>
31
+ <connection>
32
+ <use>default_write</use>
33
+ </connection>
34
+ </addinfotoemail_write>
35
+ <addinfotoemail_read>
36
+ <connection>
37
+ <use>default_read</use>
38
+ </connection>
39
+ </addinfotoemail_read>
40
+ </resources>
41
+ </global>
42
+
43
+ <frontend>
44
+ <layout>
45
+ <updates>
46
+ <addinfotoemail>
47
+ <file>addinfotoemail.xml</file>
48
+ </addinfotoemail>
49
+ </updates>
50
+ </layout>
51
+ <translate>
52
+ <modules>
53
+ <Diglin_Addinfotoemail>
54
+ <files>
55
+ <default>Diglin_Addinfotoemail.csv</default>
56
+ </files>
57
+ </Diglin_Addinfotoemail>
58
+ </modules>
59
+ </translate>
60
+ </frontend>
61
+ </config>
app/code/community/Diglin/Addinfotoemail/sql/addinfotoemail_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Diglin
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 Diglin
22
+ * @package Diglin_Addinfotoemail
23
+ * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ /*@var $installer Diglin_Addinfotoemail_Model_Entity_Setup */
27
+ $installer = $this;
28
+
29
+ $installer->startSetup();
30
+ $entityTypeId = $installer->getEntityTypeId('catalog_product');
31
+
32
+ $defaultAttributeSetId = $installer->getDefaultAttributeSetId($entityTypeId);
33
+
34
+ $installer->addAttributeGroup($entityTypeId, $defaultAttributeSetId, 'Additional options',50);
35
+
36
+ $installer->addAttribute($entityTypeId, 'comment_mail', array(
37
+ 'group' => 'Additional options',
38
+ 'label' => 'Additional comment in Mail',
39
+ 'type' => 'text',
40
+ 'input' => 'textarea',
41
+ 'frontend' => '',
42
+ 'backend' => '',
43
+ 'class' => '',
44
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
45
+ 'visible' => true,
46
+ 'required' => false,
47
+ 'default' => '',
48
+ 'user_defined' => false,
49
+ 'searchable' => false,
50
+ 'filterable' => false,
51
+ 'comparable' => false,
52
+ 'visible_on_front' => false,
53
+ 'unique' => false,
54
+ 'wysiwyg_enabled' => true,
55
+ 'is_html_allowed_on_front' => true,
56
+ 'used_for_price_rules' => false,
57
+ 'is_configurable' => false,
58
+ )
59
+ );
60
+
61
+ $installer->endSetup();
app/design/frontend/default/default/layout/addinfotoemail.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Diglin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Diglin
23
+ * @package Diglin_Addinfotoemail
24
+ * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+ -->
28
+ <layout version="1.0.0">
29
+ <!--
30
+ Send into the email after an order purchase, additional comments of a product
31
+ -->
32
+ <sales_email_order_products_comments>
33
+ <block type="addinfotoemail/product_email_comments" name="product_comments" template="email/order/items/comments.phtml" />
34
+ </sales_email_order_products_comments>
35
+ </layout>
app/design/frontend/default/default/template/email/order/items/comments.phtml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Diglin
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 Diglin
22
+ * @package Diglin_Addinfotoemail
23
+ * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ $_order = $this->getOrder();
29
+ $_items = $_order->getAllItems();
30
+ $i = 0;
31
+ $comments = $this->getComments($_items);
32
+ if(count($comments) > 0){
33
+ ?>
34
+ <table style="border:1px solid #BEBCB7;background:#f8f7f5;" cellpadding="0" cellspacing="0" width="99.9%" border="0">
35
+ <tr><td style="padding:3px 9px 6px 9px;background-color:#d9e5ee;line-height:1em;"><strong><?php echo Mage::helper('catalog')->__('Additional Information concerning the product(s) you have bought');?></strong></td></tr>
36
+ <?php
37
+ foreach($comments as $comment){?>
38
+ <tr><td style="padding:3px 9px 6px 9px;background-color:<?php echo ($i%2)?'#EEEDED':'#F8F7F5';?>;"><strong><?php echo $comment['title'];?></strong></td></tr>
39
+ <tr><td style="padding:3px 9px 6px 9px;background-color:<?php echo ($i%2)?'#EEEDED':'#F8F7F5';?>;"><?php echo $comment['comment'];?></td></tr>
40
+ <?php $i++;}?>
41
+ </table>
42
+ <?php
43
+ }
app/etc/modules/Diglin_Addinfotoemail.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Diglin_Addinfotoemail>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Diglin_Addinfotoemail>
8
+ </modules>
9
+ </config>
app/locale/de_DE/Diglin_Addinfotoemail.csv ADDED
@@ -0,0 +1 @@
 
1
+ "Additional Information concerning the product(s) you have bought","Wichtige Produktinformationen, die zu beachten sind"
app/locale/en_GB/Diglin_Addinfotoemail.csv ADDED
@@ -0,0 +1 @@
 
1
+ "Additional Information concerning the product(s) you have bought","Additional Information concerning the product(s) you have bought"
app/locale/en_US/Diglin_Addinfotoemail.csv ADDED
@@ -0,0 +1 @@
 
1
+ "Additional Information concerning the product(s) you have bought","Additional Information concerning the product(s) you have bought"
app/locale/fr_FR/Diglin_Addinfotoemail.csv ADDED
@@ -0,0 +1 @@
 
1
+ "Additional Information concerning the product(s) you have bought","Informations complémentaires concernant les produits que vous avez acheté"
package.xml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Diglin_Addinfotoemail</name>
4
+ <version>1.1.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>Provide more information in your email about a specific product</summary>
10
+ <description>With this module, you can define for each product an additional information that you would like it appears when a customer receive an email after to have create/update a new invoice/order/creditmemo.&#xD;
11
+ &#xD;
12
+ In this email will appear where you decide to place it in the email, a list of products and for each product the additional comment about the product.&#xD;
13
+ &#xD;
14
+ To use it, find in each product , the Additional Options tab when you edit a product information and fill in the field "Additional comment in Mail".&#xD;
15
+ HTML and normal text are accepted. Up Magento 1.4, you should have the Wysiwyg editor.&#xD;
16
+ &#xD;
17
+ Additionaly, you have to place in the sales emails template (e.g. app/locale/en_US/templates/email/sales/invoice_new.html) the following text: &#xD;
18
+ &#xD;
19
+ {{layout area="frontend" handle="sales_email_order_products_comments" order=$order}}&#xD;
20
+ &#xD;
21
+ To test it, after you have filled in the "Additional options" into a product, create a new invoice from the backend with an account of you and confirm that the customer should get a confirmation of the email, and you should see all information about the product in the received email.</description>
22
+ <notes>Version 1.1.0: change module name, tested on Magento 1.5 and 1.6&#xD;
23
+ Version 1.0.0: stable version tested on Magento 1.3.2.4 and 1.4.1</notes>
24
+ <authors><author><name>diglin</name><user>auto-converted</user><email>sly@diglin.com</email></author></authors>
25
+ <date>2011-09-11</date>
26
+ <time>12:02:36</time>
27
+ <contents><target name="mageetc"><dir name="modules"><file name="Diglin_Addinfotoemail.xml" hash="a9132b27e3a61a5d0d40709871d5b1e7"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="addinfotoemail.xml" hash="45600d0ef1ac99a3ea82d1af43e8a8b7"/></dir><dir name="template"><dir name="email"><dir name="order"><dir name="items"><file name="comments.phtml" hash="e8fb9611af158e0c5c85850954c7add1"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Diglin"><dir name="Addinfotoemail"><dir name="Block"><dir name="Product"><dir name="Email"><file name="Comments.php" hash="b87579ec98d693bce80c75f336401b17"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="849584221746d81e65a9f0511f695056"/></dir><dir name="Model"><dir name="Entity"><file name="Setup.php" hash="92bbee04edbd54969dc0d588917179da"/></dir></dir><dir name="etc"><file name="config.xml" hash="7a3ec80dc2b42e40f3a6cdd9cd589a9f"/></dir><dir name="sql"><dir name="addinfotoemail_setup"><file name="mysql4-install-1.0.0.php" hash="2fef7c966347003fea079bf98302ffd3"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Diglin_Addinfotoemail.csv" hash="0e73318aa127e8c1088f4b880fc83eaa"/></dir><dir name="fr_FR"><file name="Diglin_Addinfotoemail.csv" hash="8059a79b95443a9154564e123ed25c44"/></dir><dir name="de_DE"><file name="Diglin_Addinfotoemail.csv" hash="675a483728c9cd8191fbce477d95f518"/></dir><dir name="en_GB"><file name="Diglin_Addinfotoemail.csv" hash="0e73318aa127e8c1088f4b880fc83eaa"/></dir></target></contents>
28
+ <compatible/>
29
+ <dependencies/>
30
+ </package>