Version Notes
First Stable Release
Download this release
Release Info
Developer | Zealousweb Technologies Pvt Ltd. |
Extension | WhatsApp_Your_Products_using_Magento |
Version | 1.0.0.1 |
Comparing to | |
See all releases |
Version 1.0.0.1
- app/code/community/ZealousWeb/WhatsApp/Block/Whatsapp.php +54 -0
- app/code/community/ZealousWeb/WhatsApp/Helper/Data.php +12 -0
- app/code/community/ZealousWeb/WhatsApp/Model/Whatsapp.php +29 -0
- app/code/community/ZealousWeb/WhatsApp/Model/Whatsappposition.php +29 -0
- app/code/community/ZealousWeb/WhatsApp/etc/adminhtml.xml +30 -0
- app/code/community/ZealousWeb/WhatsApp/etc/config.xml +66 -0
- app/code/community/ZealousWeb/WhatsApp/etc/system.xml +76 -0
- app/design/frontend/base/default/layout/whatsapp.xml +33 -0
- app/design/frontend/base/default/template/whatsapp/whatsapp.phtml +16 -0
- app/design/frontend/base/default/template/whatsapp/whatsapp_footer.phtml +33 -0
- app/etc/modules/ZealousWeb_WhatsApp.xml +10 -0
- package.xml +18 -0
- skin/frontend/base/default/js/whatsapp/whatsapp-button.js +69 -0
app/code/community/ZealousWeb/WhatsApp/Block/Whatsapp.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @description ZealousWeb Block
|
4 |
+
*
|
5 |
+
* @category community
|
6 |
+
* @package community_ZealousWeb
|
7 |
+
* @author Zealousweb
|
8 |
+
*/
|
9 |
+
class ZealousWeb_WhatsApp_Block_Whatsapp extends Mage_Catalog_Block_Product_View
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* @description Get button size
|
13 |
+
*
|
14 |
+
* @param no
|
15 |
+
* @return string
|
16 |
+
*/
|
17 |
+
public function getButtonSize(){
|
18 |
+
return Mage::getStoreConfig('zwt_wa_section/zwt_wa_group/zwt_wa_button');
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* @description Get button position
|
23 |
+
*
|
24 |
+
* @param no
|
25 |
+
* @return string
|
26 |
+
*/
|
27 |
+
public function getButtonPos(){
|
28 |
+
return Mage::getStoreConfig('zwt_wa_section/zwt_wa_group/zwt_wa_button_pos');
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* @description Get Is Enable or not
|
33 |
+
*
|
34 |
+
* @param no
|
35 |
+
* @return boolean
|
36 |
+
*/
|
37 |
+
public function getIsEnable()
|
38 |
+
{
|
39 |
+
return Mage::getStoreConfig('zwt_wa_section/zwt_wa_group/zwt_wa_enable');
|
40 |
+
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @description Get Background color
|
45 |
+
*
|
46 |
+
* @param no
|
47 |
+
* @return boolean
|
48 |
+
*/
|
49 |
+
public function getBackcolor()
|
50 |
+
{
|
51 |
+
return Mage::getStoreConfig('zwt_wa_section/zwt_wa_group/zwt_background');
|
52 |
+
|
53 |
+
}
|
54 |
+
}
|
app/code/community/ZealousWeb/WhatsApp/Helper/Data.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @description ZealousWeb Helper
|
4 |
+
*
|
5 |
+
* @category community
|
6 |
+
* @package community_ZealousWeb
|
7 |
+
* @author Zealousweb
|
8 |
+
*/
|
9 |
+
class ZealousWeb_WhatsApp_Helper_Data extends Mage_Core_Helper_Abstract
|
10 |
+
{
|
11 |
+
}
|
12 |
+
|
app/code/community/ZealousWeb/WhatsApp/Model/Whatsapp.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @description ZealousWeb Model
|
4 |
+
*
|
5 |
+
* @category community
|
6 |
+
* @package community_ZealousWeb_Whatsapp
|
7 |
+
* @author Zealousweb
|
8 |
+
*/
|
9 |
+
class ZealousWeb_WhatsApp_Model_Whatsapp extends Mage_Core_Model_Abstract
|
10 |
+
{
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @description Options array for backend setting
|
14 |
+
*
|
15 |
+
* @param no
|
16 |
+
* @return array
|
17 |
+
*/
|
18 |
+
public function toOptionArray()
|
19 |
+
{
|
20 |
+
return array(
|
21 |
+
|
22 |
+
array('value' => s, 'label'=>Mage::helper('adminhtml')->__('Small')),
|
23 |
+
array('value' => m, 'label'=>Mage::helper('adminhtml')->__('Medium')),
|
24 |
+
array('value' => l, 'label'=>Mage::helper('adminhtml')->__('Large')),
|
25 |
+
|
26 |
+
);
|
27 |
+
}
|
28 |
+
|
29 |
+
}
|
app/code/community/ZealousWeb/WhatsApp/Model/Whatsappposition.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @description ZealousWeb Model
|
4 |
+
*
|
5 |
+
* @category community
|
6 |
+
* @package community_ZealousWeb_Whatsapp
|
7 |
+
* @author Zealousweb
|
8 |
+
*/
|
9 |
+
class ZealousWeb_WhatsApp_Model_Whatsappposition extends Mage_Core_Model_Abstract
|
10 |
+
{
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @description Options array for backend setting
|
14 |
+
*
|
15 |
+
* @param no
|
16 |
+
* @return array
|
17 |
+
*/
|
18 |
+
public function toOptionArray()
|
19 |
+
{
|
20 |
+
return array(
|
21 |
+
|
22 |
+
array('value' => 1, 'label'=>Mage::helper('adminhtml')->__('Product Page view area')),
|
23 |
+
array('value' => 2, 'label'=>Mage::helper('adminhtml')->__('Product Page footer area')),
|
24 |
+
array('value' => 3, 'label'=>Mage::helper('adminhtml')->__('Both area(view area and footer area)')),
|
25 |
+
|
26 |
+
);
|
27 |
+
}
|
28 |
+
|
29 |
+
}
|
app/code/community/ZealousWeb/WhatsApp/etc/adminhtml.xml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Module configuration
|
5 |
+
*
|
6 |
+
* @author ZealousWeb
|
7 |
+
*/
|
8 |
+
-->
|
9 |
+
<config>
|
10 |
+
<acl>
|
11 |
+
<resources>
|
12 |
+
<admin>
|
13 |
+
<children>
|
14 |
+
<system>
|
15 |
+
<children>
|
16 |
+
<config>
|
17 |
+
<children>
|
18 |
+
<zwt_wa_section translate="title" module="whatsapp">
|
19 |
+
<title>WhatsApp Your Products Section</title>
|
20 |
+
<sort_order>0</sort_order>
|
21 |
+
</zwt_wa_section>
|
22 |
+
</children>
|
23 |
+
</config>
|
24 |
+
</children>
|
25 |
+
</system>
|
26 |
+
</children>
|
27 |
+
</admin>
|
28 |
+
</resources>
|
29 |
+
</acl>
|
30 |
+
</config>
|
app/code/community/ZealousWeb/WhatsApp/etc/config.xml
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Module configuration
|
5 |
+
*
|
6 |
+
* @author ZealousWeb
|
7 |
+
*/
|
8 |
+
-->
|
9 |
+
<config>
|
10 |
+
<modules>
|
11 |
+
<ZealousWeb_WhatsApp>
|
12 |
+
<version>0.1.0</version>
|
13 |
+
</ZealousWeb_WhatsApp>
|
14 |
+
</modules>
|
15 |
+
<global>
|
16 |
+
<models>
|
17 |
+
<whatsapp>
|
18 |
+
<class>ZealousWeb_WhatsApp_Model</class>
|
19 |
+
</whatsapp>
|
20 |
+
</models>
|
21 |
+
<helpers>
|
22 |
+
<whatsapp>
|
23 |
+
<class>ZealousWeb_WhatsApp_Helper</class>
|
24 |
+
</whatsapp>
|
25 |
+
</helpers>
|
26 |
+
<blocks>
|
27 |
+
<whatsapp>
|
28 |
+
<class>ZealousWeb_WhatsApp_Block</class>
|
29 |
+
</whatsapp>
|
30 |
+
</blocks>
|
31 |
+
</global>
|
32 |
+
<frontend>
|
33 |
+
<routers>
|
34 |
+
<whatsapp>
|
35 |
+
<use>standard</use>
|
36 |
+
<args>
|
37 |
+
<module>ZealousWeb_WhatsApp</module>
|
38 |
+
<frontName>whatsapp</frontName>
|
39 |
+
</args>
|
40 |
+
</whatsapp>
|
41 |
+
</routers>
|
42 |
+
<layout>
|
43 |
+
<updates>
|
44 |
+
<whatsapp>
|
45 |
+
<file>whatsapp.xml</file>
|
46 |
+
</whatsapp>
|
47 |
+
</updates>
|
48 |
+
</layout>
|
49 |
+
</frontend>
|
50 |
+
<adminhtml>
|
51 |
+
<layout>
|
52 |
+
<updates>
|
53 |
+
<whatsapp>
|
54 |
+
<file>whatsapp.xml</file>
|
55 |
+
</whatsapp>
|
56 |
+
</updates>
|
57 |
+
</layout>
|
58 |
+
</adminhtml>
|
59 |
+
<default>
|
60 |
+
<zwt_wa_section>
|
61 |
+
<zwt_wa_group>
|
62 |
+
<zwt_background>286E17</zwt_background>
|
63 |
+
</zwt_wa_group>
|
64 |
+
</zwt_wa_section>
|
65 |
+
</default>
|
66 |
+
</config>
|
app/code/community/ZealousWeb/WhatsApp/etc/system.xml
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Module configuration
|
5 |
+
*
|
6 |
+
* @author ZealousWeb
|
7 |
+
*/
|
8 |
+
-->
|
9 |
+
<config>
|
10 |
+
<tabs>
|
11 |
+
<zwt_tab translate="label" module="whatsapp">
|
12 |
+
<label>ZealousWeb Extension</label>
|
13 |
+
<sort_order>3</sort_order>
|
14 |
+
</zwt_tab>
|
15 |
+
</tabs>
|
16 |
+
<sections>
|
17 |
+
<zwt_wa_section translate="label" module="whatsapp">
|
18 |
+
<label>WhatsApp Your Products</label>
|
19 |
+
<tab>zwt_tab</tab>
|
20 |
+
<frontend_type>text</frontend_type>
|
21 |
+
<sort_order>0</sort_order>
|
22 |
+
<show_in_default>1</show_in_default>
|
23 |
+
<show_in_website>1</show_in_website>
|
24 |
+
<show_in_store>1</show_in_store>
|
25 |
+
<groups>
|
26 |
+
<zwt_wa_group translate="label">
|
27 |
+
<label>WhatsApp Your Products Settings</label>
|
28 |
+
<frontend_type>text</frontend_type>
|
29 |
+
<sort_order>0</sort_order>
|
30 |
+
<show_in_default>1</show_in_default>
|
31 |
+
<show_in_website>1</show_in_website>
|
32 |
+
<show_in_store>1</show_in_store>
|
33 |
+
<fields>
|
34 |
+
<zwt_wa_enable translate="label">
|
35 |
+
<label>Enable</label>
|
36 |
+
<frontend_type>select</frontend_type>
|
37 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
38 |
+
<sort_order>0</sort_order>
|
39 |
+
<show_in_default>1</show_in_default>
|
40 |
+
<show_in_website>1</show_in_website>
|
41 |
+
<show_in_store>1</show_in_store>
|
42 |
+
</zwt_wa_enable>
|
43 |
+
<zwt_wa_button translate="label">
|
44 |
+
<label>Choose Button Size</label>
|
45 |
+
<frontend_type>select</frontend_type>
|
46 |
+
<source_model>whatsapp/whatsapp</source_model>
|
47 |
+
<sort_order>1</sort_order>
|
48 |
+
<show_in_default>1</show_in_default>
|
49 |
+
<show_in_website>1</show_in_website>
|
50 |
+
<show_in_store>1</show_in_store>
|
51 |
+
</zwt_wa_button>
|
52 |
+
<zwt_wa_button_pos translate="label">
|
53 |
+
<label>Choose Button Position</label>
|
54 |
+
<frontend_type>select</frontend_type>
|
55 |
+
<source_model>whatsapp/whatsappposition</source_model>
|
56 |
+
<sort_order>1</sort_order>
|
57 |
+
<show_in_default>1</show_in_default>
|
58 |
+
<show_in_website>1</show_in_website>
|
59 |
+
<show_in_store>1</show_in_store>
|
60 |
+
</zwt_wa_button_pos>
|
61 |
+
<zwt_background translate="label tooltip comment">
|
62 |
+
<label>Footer Background Color</label>
|
63 |
+
<frontend_type>text</frontend_type>
|
64 |
+
<validate>color</validate>
|
65 |
+
<sort_order>2</sort_order>
|
66 |
+
<show_in_default>1</show_in_default>
|
67 |
+
<show_in_website>1</show_in_website>
|
68 |
+
<show_in_store>1</show_in_store>
|
69 |
+
<comment>e.g "FFFFFF" (only apply if you select button position in footer area)</comment>
|
70 |
+
</zwt_background>
|
71 |
+
</fields>
|
72 |
+
</zwt_wa_group>
|
73 |
+
</groups>
|
74 |
+
</zwt_wa_section>
|
75 |
+
</sections>
|
76 |
+
</config>
|
app/design/frontend/base/default/layout/whatsapp.xml
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<catalog_product_view>
|
4 |
+
|
5 |
+
<reference name="head">
|
6 |
+
<action method="addItem" ifconfig="zwt_wa_section/zwt_wa_group/zwt_wa_enable"
|
7 |
+
ifvalue="1">
|
8 |
+
<type>skin_js</type>
|
9 |
+
<name>js/whatsapp/whatsapp-button.js</name>
|
10 |
+
</action>
|
11 |
+
</reference>
|
12 |
+
|
13 |
+
<reference name="alert.urls">
|
14 |
+
<block type="whatsapp/whatsapp" name="custom_whatsapp" as="custom_whatsapp">
|
15 |
+
<action method="setTemplate" ifconfig="zwt_wa_section/zwt_wa_group/zwt_wa_enable"
|
16 |
+
ifvalue="1">
|
17 |
+
<template>whatsapp/whatsapp.phtml</template>
|
18 |
+
</action>
|
19 |
+
</block>
|
20 |
+
</reference>
|
21 |
+
|
22 |
+
<reference name="before_body_end">
|
23 |
+
<block type="whatsapp/whatsapp" name="custom_whatsapp_footer" as="custom_whatsapp_footer" after="-">
|
24 |
+
<action method="setTemplate" ifconfig="zwt_wa_section/zwt_wa_group/zwt_wa_enable"
|
25 |
+
ifvalue="1">
|
26 |
+
<template>whatsapp/whatsapp_footer.phtml</template>
|
27 |
+
</action>
|
28 |
+
</block>
|
29 |
+
</reference>
|
30 |
+
|
31 |
+
</catalog_product_view>
|
32 |
+
|
33 |
+
</layout>
|
app/design/frontend/base/default/template/whatsapp/whatsapp.phtml
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$buttonSize = $this->getButtonSize ();
|
3 |
+
$buttonPos = $this->getButtonPos();
|
4 |
+
$productName = $this->getProduct ()->getName ();
|
5 |
+
$productPrice = $this->getProduct ()->getPrice ();
|
6 |
+
|
7 |
+
$price_des = "Price: " . $productPrice;
|
8 |
+
$display_des = "Take a look at this awesome product: " . $productName . " at just " . $productPrice;
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
if($buttonPos == 1 || $buttonPos == 3)
|
12 |
+
{
|
13 |
+
?>
|
14 |
+
<a href="whatsapp://send" data-text='<?php echo $this->__($display_des);?>'
|
15 |
+
data-href="" class="wa_btn wa_btn_<?php echo $buttonSize?>" style="display:none;">Share</a>
|
16 |
+
<?php }?>
|
app/design/frontend/base/default/template/whatsapp/whatsapp_footer.phtml
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$buttonSize = $this->getButtonSize();
|
3 |
+
$buttonPos = $this->getButtonPos();
|
4 |
+
$footerCol = $this->getBackcolor();
|
5 |
+
|
6 |
+
$productName = $this->getProduct ()->getName ();
|
7 |
+
$productPrice = $this->getProduct ()->getPrice ();
|
8 |
+
|
9 |
+
$price_des = "Price: " . $productPrice;
|
10 |
+
$display_des = "Take a look at this awesome product: " . $productName . " at just " . $productPrice;
|
11 |
+
?>
|
12 |
+
<?php
|
13 |
+
if($buttonPos == 2 || $buttonPos == 3)
|
14 |
+
{
|
15 |
+
?>
|
16 |
+
<div id="whats_app_button_footer" style="background-color: <?php echo '#'.$footerCol;?>;
|
17 |
+
bottom: 0;
|
18 |
+
color: #fff;
|
19 |
+
height: 49px;
|
20 |
+
padding: 5px 0px;
|
21 |
+
position: fixed;
|
22 |
+
text-align: center;
|
23 |
+
width: 100%;
|
24 |
+
display:none;
|
25 |
+
">
|
26 |
+
|
27 |
+
<p>Share this link on WhatsApp</p>
|
28 |
+
<div>
|
29 |
+
<a href="whatsapp://send" data-text='<?php echo $this->__($display_des);?>'
|
30 |
+
data-href="" class="wa_btn wa_btn_<?php echo $buttonSize?>" style="display:none;">Share</a>
|
31 |
+
</div>
|
32 |
+
</div>
|
33 |
+
<?php }?>
|
app/etc/modules/ZealousWeb_WhatsApp.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<ZealousWeb_WhatsApp>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
<version>0.1.0</version>
|
8 |
+
</ZealousWeb_WhatsApp>
|
9 |
+
</modules>
|
10 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>WhatsApp_Your_Products_using_Magento</name>
|
4 |
+
<version>1.0.0.1</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL-3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Share Product link to WhatsApp contacts</summary>
|
10 |
+
<description>Extension will allow you to promote & brand your shop via Whatsapp. Linking this traffic source with a Whatsapp extension would be a huge advantage for your shop promotion & branding, Imagine the traffic you would be able to carry to your website with a source like Whatsapp – the results would be tremendous.</description>
|
11 |
+
<notes>First Stable Release</notes>
|
12 |
+
<authors><author><name>ZealousWeb Technologies Pvt Ltd.</name><user>ZealousWeb</user><email>magento@zealousweb.com</email></author></authors>
|
13 |
+
<date>2015-01-17</date>
|
14 |
+
<time>13:16:01</time>
|
15 |
+
<contents><target name="magecommunity"><dir><dir name="ZealousWeb"><dir name="WhatsApp"><dir name="Block"><file name="Whatsapp.php" hash="94b3bd283ef5b0e264be9529aaf0b0ca"/></dir><dir name="Helper"><file name="Data.php" hash="0ff493e7177e5ebf41cf7d718fc15149"/></dir><dir name="Model"><file name="Whatsapp.php" hash="6a2395961bdd4a39f4799edd6c143f03"/><file name="Whatsappposition.php" hash="a116fb3b6dbe4b944d0920c8fe07b4c7"/></dir><dir name="etc"><file name="adminhtml.xml" hash="ef11e9213fda8f0f1eb02f3ce5b1496a"/><file name="config.xml" hash="cb03b341713beaec58f6f236aa2be93c"/><file name="system.xml" hash="1f3433a08ec5a6aa25a0891d735a5713"/></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="whatsapp.xml" hash="ccad098e02c5c1d44326bc7c001d5ac8"/></dir><dir name="template"><dir name="whatsapp"><file name="whatsapp.phtml" hash="0ad18e6e3a8b5f5eebf25c90ef56648a"/><file name="whatsapp_footer.phtml" hash="29e7ed5938036296b7f55b1485156f06"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="ZealousWeb_WhatsApp.xml" hash="707bcd3f24e695683e3a4f45224124f8"/></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><dir name="whatsapp"><file name="whatsapp-button.js" hash="3313b67d59296f79372fb86d6190ff4d"/></dir></dir></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|
skin/frontend/base/default/js/whatsapp/whatsapp-button.js
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
waShBtn = function() {
|
2 |
+
this.isIos === !0 && this.cntLdd(window, this.crBtn)
|
3 |
+
}, waShBtn.prototype.isIos = navigator.userAgent.match(/Android|iPhone/i) && !navigator.userAgent.match(/iPod/i) ? !0 : !1, waShBtn.prototype.cntLdd = function(win, fn) {
|
4 |
+
var done = !1,
|
5 |
+
top = !0,
|
6 |
+
doc = win.document,
|
7 |
+
root = doc.documentElement,
|
8 |
+
add = doc.addEventListener ? "addEventListener" : "attachEvent",
|
9 |
+
rem = doc.addEventListener ? "removeEventListener" : "detachEvent",
|
10 |
+
pre = doc.addEventListener ? "" : "on",
|
11 |
+
init = function(e) {
|
12 |
+
("readystatechange" != e.type || "complete" == doc.readyState) && (("load" == e.type ? win : doc)[rem](pre + e.type, init, !1), !done && (done = !0) && fn.call(win, e.type || e))
|
13 |
+
},
|
14 |
+
poll = function() {
|
15 |
+
try {
|
16 |
+
root.doScroll("left")
|
17 |
+
} catch (e) {
|
18 |
+
return void setTimeout(poll, 50)
|
19 |
+
}
|
20 |
+
init("poll")
|
21 |
+
};
|
22 |
+
if ("complete" == doc.readyState) fn.call(win, "lazy");
|
23 |
+
else {
|
24 |
+
if (doc.createEventObject && root.doScroll) {
|
25 |
+
try {
|
26 |
+
top = !win.frameElement
|
27 |
+
} catch (e) {}
|
28 |
+
top && poll()
|
29 |
+
}
|
30 |
+
doc[add](pre + "DOMContentLoaded", init, !1), doc[add](pre + "readystatechange", init, !1), win[add](pre + "load", init, !1)
|
31 |
+
}
|
32 |
+
}, waShBtn.prototype.addStyling = function() {
|
33 |
+
|
34 |
+
var x = document.getElementById("whats_app_button_footer");
|
35 |
+
|
36 |
+
if(x != null)
|
37 |
+
{
|
38 |
+
document.getElementById("whats_app_button_footer").style.display = "block";
|
39 |
+
}
|
40 |
+
//alert(sd);
|
41 |
+
//document.getElementById("whats_app_button_footer").style.backgroundColor = "green";
|
42 |
+
//document.getElementById("whats_app_button_footer").style.align = "center";
|
43 |
+
|
44 |
+
var s = document.createElement("style"),
|
45 |
+
c = "body," +
|
46 |
+
"html{padding:0;margin:0;height:100%;width:100%}" +
|
47 |
+
".wa_btn{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkViZW5lXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgMTYgMTYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDE2IDE2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxnPg0KCQk8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI0ZGRkZGRiIgZD0iTTguMTI5LDAuOTQ1Yy0zLjc5NSwwLTYuODcyLDMuMDc3LTYuODcyLDYuODczDQoJCQljMCwxLjI5OCwwLjM2LDIuNTEyLDAuOTg2LDMuNTQ5bC0xLjI0LDMuNjg4bDMuODA1LTEuMjE5YzAuOTg0LDAuNTQ0LDIuMTE2LDAuODU0LDMuMzIxLDAuODU0YzMuNzk1LDAsNi44NzEtMy4wNzUsNi44NzEtNi44NzENCgkJCVMxMS45MjQsMC45NDUsOC4xMjksMC45NDV6IE04LjEyOSwxMy41MzhjLTEuMTYyLDAtMi4yNDQtMC4zNDgtMy4xNDctMC45NDZsLTIuMTk4LDAuNzA1bDAuNzE1LTIuMTI0DQoJCQljLTAuNjg2LTAuOTQ0LTEuMDktMi4xMDMtMS4wOS0zLjM1NGMwLTMuMTU1LDIuNTY2LTUuNzIyLDUuNzIxLTUuNzIyczUuNzIxLDIuNTY2LDUuNzIxLDUuNzIyUzExLjI4MywxMy41MzgsOC4xMjksMTMuNTM4eg0KCQkJIE0xMS4zNTIsOS4zNzljLTAuMTc0LTAuMDk0LTEuMDItMC41NS0xLjE3OC0wLjYxNUMxMC4wMTQsOC43LDkuODk4LDguNjY2LDkuNzc1LDguODM3QzkuNjUyLDkuMDA3LDkuMzAxLDkuMzksOS4xOTMsOS41MDUNCgkJCUM5LjA4OCw5LjYxNyw4Ljk4NCw5LjYyOSw4LjgxMiw5LjUzM2MtMC4xNzEtMC4wOTYtMC43My0wLjMtMS4zNzgtMC45MjNjLTAuNTA0LTAuNDg0LTAuODM0LTEuMDcyLTAuOTMtMS4yNTINCgkJCWMtMC4wOTUtMC4xOCwwLTAuMjcxLDAuMDkxLTAuMzU0QzYuNjc3LDYuOTI4LDYuNzc4LDYuODA1LDYuODcsNi43MDZjMC4wOTEtMC4xLDAuMTI0LTAuMTcxLDAuMTg3LTAuMjg2DQoJCQljMC4wNjItMC4xMTUsMC4wMzgtMC4yMTgtMC4wMDMtMC4zMDhDNy4wMTIsNi4wMjMsNi42OTQsNS4xNDYsNi41NjEsNC43OUM2LjQyOCw0LjQzNCw2LjI4LDQuNDg2LDYuMTc3LDQuNDgyDQoJCQlDNi4wNzUsNC40NzksNS45NTgsNC40NTksNS44NDEsNC40NTZDNS43MjQsNC40NTEsNS41MzMsNC40ODcsNS4zNjYsNC42NTdjLTAuMTY3LDAuMTctMC42MzcsMC41NzYtMC42NjksMS40MzkNCgkJCXMwLjU2NSwxLjcyMiwwLjY0OCwxLjg0MWMwLjA4NCwwLjEyMSwxLjE0LDEuOTkxLDIuODk3LDIuNzYyYzEuNzU2LDAuNzcsMS43NjYsMC41MzQsMi4wODgsMC41MTgNCgkJCWMwLjMyMi0wLjAxOCwxLjA1NS0wLjM4NiwxLjIxNS0wLjc4OWMwLjE2Mi0wLjQwNSwwLjE3Ni0wLjc1NSwwLjEzNS0wLjgzMUMxMS42MzksOS41MjEsMTEuNTIzLDkuNDc1LDExLjM1Miw5LjM3OXoiLz4NCgk8L2c+DQo8L2c+DQo8L3N2Zz4NCg==);border:1px solid rgba(0,0,0,.1);display:inline-block!important;position:relative;font-family:Arial,sans-serif;letter-spacing:.4px;cursor:pointer;font-weight:400;text-transform:none;color:#fff;border-radius:2px;background-color:#5cbe4a;background-repeat:no-repeat;line-height:1.2;text-decoration:none;text-align:left}" +
|
48 |
+
".wa_btn_s{font-size:12px;background-size:16px;background-position:5px 2px;padding:3px 6px 3px 25px}" +
|
49 |
+
".wa_btn_m{font-size:16px;background-size:20px;background-position:4px 2px;padding:4px 6px 4px 30px}" +
|
50 |
+
".wa_btn_l{font-size:16px;background-size:20px;background-position:5px 5px;padding:8px 6px 8px 30px}"
|
51 |
+
;
|
52 |
+
return s.type = "text/css", s.styleSheet ? s.styleSheet.cssText = c : s.appendChild(document.createTextNode(c)), s
|
53 |
+
}, waShBtn.prototype.crBtn = function() {
|
54 |
+
var b = [].slice.call(document.querySelectorAll(".wa_btn"));
|
55 |
+
iframe = new Array;
|
56 |
+
for (var i = 0; i < b.length; i++) {
|
57 |
+
var parent = b[i].parentNode,
|
58 |
+
t = b[i].getAttribute("data-text"),
|
59 |
+
u = b[i].getAttribute("data-href"),
|
60 |
+
o = b[i].getAttribute("href"),
|
61 |
+
at = "?text=" + t;
|
62 |
+
t && (at += " "), at += u ? u : document.URL, b[i].setAttribute("href", o + at), b[i].setAttribute("target", "_top"), iframe[i] = document.createElement("iframe"), iframe[i].width = 1, iframe[i].height = 1, iframe[i].button = b[i], iframe[i].style.border = 0, iframe[i].style.overflow = "hidden", iframe[i].border = 0, iframe[i].setAttribute("scrolling", "no"), iframe[i].addEventListener("load", function() {
|
63 |
+
this.contentDocument.body.appendChild(this.button), this.contentDocument.getElementsByTagName("head")[0].appendChild(theWaShBtn.addStyling());
|
64 |
+
var meta = document.createElement("meta");
|
65 |
+
meta.setAttribute("charset", "utf-8"), this.contentDocument.getElementsByTagName("head")[0].appendChild(meta), this.width = Math.ceil(this.contentDocument.getElementsByTagName("a")[0].getBoundingClientRect().width), this.height = Math.ceil(this.contentDocument.getElementsByTagName("a")[0].getBoundingClientRect().height)
|
66 |
+
}, !1), parent.insertBefore(iframe[i], b[i])
|
67 |
+
}
|
68 |
+
};
|
69 |
+
var theWaShBtn = new waShBtn;
|