Rissip_Addinfotoemail - Version 1.0.0

Version Notes

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 Rissip_Addinfotoemail
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/local/Rissip/Addinfotoemail/Block/Product/Email/Comments.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Block to display comments of a product in the order email
4
+ *
5
+ * @category Rissip
6
+ * @package Rissip_Catalog
7
+ * @author Technical Support - rissip GmbH
8
+ */
9
+ class Rissip_Addinfotoemail_Block_Product_Email_Comments extends Mage_Core_Block_Template {
10
+
11
+ /**
12
+ *
13
+ * @param Mage_Sales_Model_Order_Item $items
14
+ * @return array $comments
15
+ */
16
+ public function getComments($items) {
17
+ $comments = array();
18
+ if (is_array ( $items )) {
19
+ $i = 0;
20
+ foreach ( $items as $item ) {
21
+ $product = Mage::getModel ( 'catalog/product' )->load ( $item->getProductId () );
22
+ $comment = $product->getCommentMail ();
23
+ if (! empty ( $comment )) {
24
+ $comments [$i] ['title'] = $product->getName ();
25
+ $comments [$i] ['comment'] = $comment;
26
+ $i ++;
27
+ }
28
+ }
29
+ }
30
+ return $comments;
31
+ }
32
+ }
app/code/local/Rissip/Addinfotoemail/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Only for String Translation
4
+ *
5
+ */
6
+ class Rissip_Addinfotoemail_Helper_Data extends Mage_Core_Helper_Abstract{}
app/code/local/Rissip/Addinfotoemail/Model/Entity/Setup.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ class Rissip_Addinfotoemail_Model_Entity_Setup extends Mage_Catalog_Model_Resource_Eav_Mysql4_Setup{
3
+
4
+ }
app/code/local/Rissip/Addinfotoemail/etc/config.xml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Rissip_Addinfotoemail>
5
+ <version>1.0.0</version>
6
+ </Rissip_Addinfotoemail>
7
+ </modules>
8
+
9
+ <global>
10
+ <blocks>
11
+ <addinfotoemail>
12
+ <class>Rissip_Addinfotoemail_Block</class>
13
+ </addinfotoemail>
14
+ </blocks>
15
+ <helpers>
16
+ <addinfotoemail>
17
+ <class>Rissip_Addinfotoemail_Helper</class>
18
+ </addinfotoemail>
19
+ </helpers>
20
+ <resources>
21
+ <addinfotoemail_setup>
22
+ <setup>
23
+ <module>Rissip_Addinfotoemail</module>
24
+ <class>Rissip_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
+ <Rissip_Addinfotoemail>
54
+ <files>
55
+ <default>Rissip_Addinfotoemail.csv</default>
56
+ </files>
57
+ </Rissip_Addinfotoemail>
58
+ </modules>
59
+ </translate>
60
+ </frontend>
61
+ </config>
app/code/local/Rissip/Addinfotoemail/sql/addinfotoemail_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+ /*@var $installer Rissip_Addinfotoemail_Model_Entity_Setup */
5
+
6
+ $installer->startSetup();
7
+ $entityTypeId = $installer->getEntityTypeId('catalog_product');
8
+ $defaultAttributeSetId = $installer->getDefaultAttributeSetId($entityTypeId);
9
+ /*$attributeGroupId = $installer->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);*/
10
+
11
+ $installer->addAttributeGroup($entityTypeId, $defaultAttributeSetId, 'Additional options',50);
12
+
13
+ $installer->addAttribute($entityTypeId, 'comment_mail', array(
14
+ 'group' => 'Additional options',
15
+ 'label' => 'Additional comment in Mail',
16
+ 'type' => 'text',
17
+ 'input' => 'textarea',
18
+ 'frontend' => '',
19
+ 'backend' => '',
20
+ 'class' => '',
21
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
22
+ 'visible' => true,
23
+ 'required' => false,
24
+ 'default' => '',
25
+ 'user_defined' => false,
26
+ 'searchable' => false,
27
+ 'filterable' => false,
28
+ 'comparable' => false,
29
+ 'visible_on_front' => false,
30
+ 'unique' => false,
31
+ 'wysiwyg_enabled' => true,
32
+ 'is_html_allowed_on_front' => true,
33
+ 'used_for_price_rules' => false,
34
+ 'is_configurable' => false,
35
+ )
36
+ );
37
+
38
+ $installer->endSetup();
app/design/frontend/base/default/layout/addinfotoemail.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="1.0.0">
3
+ <!--
4
+ rissip GmbH
5
+ Send into the email after an order purchase, additional comments of a product
6
+ -->
7
+ <sales_email_order_products_comments>
8
+ <block type="addinfotoemail/product_email_comments" name="product_comments" template="email/order/items/comments.phtml" />
9
+ </sales_email_order_products_comments>
10
+ </layout>
app/design/frontend/base/default/template/email/order/items/comments.phtml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_order = $this->getOrder();
3
+ $_items = $_order->getAllItems();
4
+ $i = 0;
5
+ $comments = $this->getComments($_items);
6
+ if(count($comments) > 0){
7
+ ?>
8
+ <table style="border:1px solid #BEBCB7;background:#f8f7f5;" cellpadding="0" cellspacing="0" width="99.9%" border="0">
9
+ <tr><td style="padding:3px 9px 6px 9px;background-color:#d9e5ee;line-height:1em;"><strong><?php echo Mage::helper('addinfotoemail')->__('Additional Information concerning the product(s) you have bought');?></strong></td></tr>
10
+ <?php
11
+ foreach($comments as $comment){?>
12
+ <tr><td style="padding:3px 9px 6px 9px;background-color:<?php echo ($i%2)?'#EEEDED':'#F8F7F5';?>;"><strong><?php echo $comment['title'];?></strong></td></tr>
13
+ <tr><td style="padding:3px 9px 6px 9px;background-color:<?php echo ($i%2)?'#EEEDED':'#F8F7F5';?>;"><?php echo $comment['comment'];?></td></tr>
14
+ <?php $i++;}?>
15
+ </table>
16
+ <?php
17
+ }
app/design/frontend/default/default/layout/addinfotoemail.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="1.0.0">
3
+ <!--
4
+ rissip GmbH
5
+ Send into the email after an order purchase, additional comments of a product
6
+ -->
7
+ <sales_email_order_products_comments>
8
+ <block type="addinfotoemail/product_email_comments" name="product_comments" template="email/order/items/comments.phtml" />
9
+ </sales_email_order_products_comments>
10
+ </layout>
app/design/frontend/default/default/template/email/order/items/comments.phtml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_order = $this->getOrder();
3
+ $_items = $_order->getAllItems();
4
+ $i = 0;
5
+ $comments = $this->getComments($_items);
6
+ if(count($comments) > 0){
7
+ ?>
8
+ <table style="border:1px solid #BEBCB7;background:#f8f7f5;" cellpadding="0" cellspacing="0" width="99.9%" border="0">
9
+ <tr><td style="padding:3px 9px 6px 9px;background-color:#d9e5ee;line-height:1em;"><strong><?php echo Mage::helper('addinfotoemail')->__('Additional Information concerning the product(s) you have bought');?></strong></td></tr>
10
+ <?php
11
+ foreach($comments as $comment){?>
12
+ <tr><td style="padding:3px 9px 6px 9px;background-color:<?php echo ($i%2)?'#EEEDED':'#F8F7F5';?>;"><strong><?php echo $comment['title'];?></strong></td></tr>
13
+ <tr><td style="padding:3px 9px 6px 9px;background-color:<?php echo ($i%2)?'#EEEDED':'#F8F7F5';?>;"><?php echo $comment['comment'];?></td></tr>
14
+ <?php $i++;}?>
15
+ </table>
16
+ <?php
17
+ }
app/etc/modules/Rissip_Addinfotoemail.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Rissip_Addinfotoemail>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Rissip_Addinfotoemail>
8
+ </modules>
9
+ </config>
app/locale/de_DE/Rissip_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/Rissip_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/Rissip_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/Rissip_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,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Rissip_Addinfotoemail</name>
4
+ <version>1.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>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.
11
+ 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.
12
+
13
+ To use it, find in each product , the Additional Options tab when you edit a product information and fill the field "Additional comment in Mail". HTML and normal text are accepted. In Magento 1.4, you should have the Wysiwyg editor.
14
+
15
+ 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:
16
+ {{layout area="frontend" handle="sales_email_order_products_comments" order=$order}}
17
+
18
+ To test it, create a new invoice from the backend and confirm that the customer should get a confirmation of the email, and you should see all information about the product.</description>
19
+ <notes>Version 1.0.0: stable version tested on Magento 1.3.2.4 and 1.4.1</notes>
20
+ <authors><author><name>diglin</name><user>auto-converted</user><email>website@diglin.com</email></author></authors>
21
+ <date>2010-08-23</date>
22
+ <time>06:54:28</time>
23
+ <contents><target name="magelocale"><dir name="de_DE"><file name="Rissip_Addinfotoemail.csv" hash="675a483728c9cd8191fbce477d95f518"/></dir><dir name="en_GB"><file name="Rissip_Addinfotoemail.csv" hash="0e73318aa127e8c1088f4b880fc83eaa"/></dir><dir name="en_US"><file name="Rissip_Addinfotoemail.csv" hash="0e73318aa127e8c1088f4b880fc83eaa"/></dir><dir name="fr_FR"><file name="Rissip_Addinfotoemail.csv" hash="8059a79b95443a9154564e123ed25c44"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="addinfotoemail.xml" hash="b81c07a4f58c45a2a815864bc14f162f"/></dir><dir name="template"><dir name="email"><dir name="order"><dir name="items"><file name="comments.phtml" hash="1288cb2e25e0a7797eed636db461f2ac"/></dir></dir></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="addinfotoemail.xml" hash="b81c07a4f58c45a2a815864bc14f162f"/></dir><dir name="template"><dir name="email"><dir name="order"><dir name="items"><file name="comments.phtml" hash="1288cb2e25e0a7797eed636db461f2ac"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Rissip_Addinfotoemail.xml" hash="7e6d14ae546c0cad919697cac25dc65d"/></dir></target><target name="magelocal"><dir name="Rissip"><dir name="Addinfotoemail"><dir name="Block"><dir name="Product"><dir name="Email"><file name="Comments.php" hash="87e86aed0d9f3c3b09759b03be98b82f"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="c805131bc051c86e78c4479d1eaa1fdd"/></dir><dir name="Helper"><file name="Data.php" hash="0b5d09a9dca52d96c0b2e2beee9d8969"/></dir><dir name="Model"><dir name="Entity"><file name="Setup.php" hash="882a3e42c252fe97b3e726c834362a39"/></dir></dir><dir name="sql"><dir name="addinfotoemail_setup"><file name="mysql4-install-1.0.0.php" hash="096c784e8fa65c22149ef928c390db83"/></dir></dir></dir></dir></target></contents>
24
+ <compatible/>
25
+ <dependencies/>
26
+ </package>