Version Notes
Built a stable version 1.0.12
Download this release
Release Info
Developer | PushAssist Team |
Extension | Webpushnotification_Pushassist |
Version | 1.0.12 |
Comparing to | |
See all releases |
Code changes from version 1.0.11 to 1.0.12
- app/code/community/Webpushnotification/Pushassist/Helper/Data.php +2 -0
- app/code/community/Webpushnotification/Pushassist/Model/Backend/Option.php +33 -0
- app/code/community/Webpushnotification/Pushassist/Model/Observer.php +11 -2
- app/code/community/Webpushnotification/Pushassist/Model/Segmentlist.php +27 -0
- app/code/community/Webpushnotification/Pushassist/Model/Source/Option.php +43 -0
- app/code/community/Webpushnotification/Pushassist/etc/config.xml +1 -1
- app/code/community/Webpushnotification/Pushassist/sql/pushassist_setup/mysql4-upgrade-1.0.8-1.0.9.php +24 -0
- package.xml +5 -5
app/code/community/Webpushnotification/Pushassist/Helper/Data.php
CHANGED
@@ -92,6 +92,8 @@
|
|
92 |
$client_send_notification->setMethod(Zend_Http_Client::POST);
|
93 |
$client_send_notification->setRawData($send_notification_request_json);
|
94 |
$response_send_notification = $client_send_notification->request()->getBody();
|
|
|
|
|
95 |
} catch (Zend_Exception $e) {
|
96 |
$response_send_notification = "";
|
97 |
}
|
92 |
$client_send_notification->setMethod(Zend_Http_Client::POST);
|
93 |
$client_send_notification->setRawData($send_notification_request_json);
|
94 |
$response_send_notification = $client_send_notification->request()->getBody();
|
95 |
+
|
96 |
+
|
97 |
} catch (Zend_Exception $e) {
|
98 |
$response_send_notification = "";
|
99 |
}
|
app/code/community/Webpushnotification/Pushassist/Model/Backend/Option.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Webpushnotification_Pushassist_Model_Backend_Option
|
3 |
+
extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* Before Attribute Save Process
|
7 |
+
*
|
8 |
+
* @param Varien_Object $object
|
9 |
+
* @return Mage_Catalog_Model_Category_Attribute_Backend_Sortby
|
10 |
+
*/
|
11 |
+
public function beforeSave($object) {
|
12 |
+
$attributeCode = $this->getAttribute()->getName();
|
13 |
+
if ($attributeCode == 'push_segment') {
|
14 |
+
$data = $object->getData($attributeCode);
|
15 |
+
if (!is_array($data)) {
|
16 |
+
$data = array();
|
17 |
+
}
|
18 |
+
$object->setData($attributeCode, join(',', $data));
|
19 |
+
}
|
20 |
+
return $this;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function afterLoad($object) {
|
24 |
+
$attributeCode = $this->getAttribute()->getName();
|
25 |
+
if ($attributeCode == 'push_segment') {
|
26 |
+
$data = $object->getData($attributeCode);
|
27 |
+
if ($data) {
|
28 |
+
$object->setData($attributeCode, explode(',', $data));
|
29 |
+
}
|
30 |
+
}
|
31 |
+
return $this;
|
32 |
+
}
|
33 |
+
}
|
app/code/community/Webpushnotification/Pushassist/Model/Observer.php
CHANGED
@@ -6,7 +6,9 @@ class Webpushnotification_Pushassist_Model_Observer
|
|
6 |
|
7 |
$product = $observer->getEvent()->getProduct();
|
8 |
$enable_notification=$product->getEnablePushNotification();
|
9 |
-
|
|
|
|
|
10 |
// Custom Title
|
11 |
$product_custom_title=$product->getPushCustomTitle();
|
12 |
if($product_custom_title != ''){
|
@@ -94,7 +96,14 @@ class Webpushnotification_Pushassist_Model_Observer
|
|
94 |
}
|
95 |
}
|
96 |
|
97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
|
99 |
$result_array = Mage::helper('pushassist')->send_notification($response_array);
|
100 |
}
|
6 |
|
7 |
$product = $observer->getEvent()->getProduct();
|
8 |
$enable_notification=$product->getEnablePushNotification();
|
9 |
+
$api_key=Mage::app()->getStore()->getConfig('pushassistsection/general/apikey');
|
10 |
+
$secret_key=Mage::app()->getStore()->getConfig('pushassistsection/general/secretkey');
|
11 |
+
|
12 |
// Custom Title
|
13 |
$product_custom_title=$product->getPushCustomTitle();
|
14 |
if($product_custom_title != ''){
|
96 |
}
|
97 |
}
|
98 |
|
99 |
+
|
100 |
+
if(!empty($product->getPushSegment())){
|
101 |
+
|
102 |
+
$response_array['segments'] =$product->getPushSegment();
|
103 |
+
}
|
104 |
+
|
105 |
+
|
106 |
+
if($enable_notification==1 &&$product->getStatus()==1 && $product->getVisibility()==4 && $api_key != '' && $secret_key != ''){
|
107 |
|
108 |
$result_array = Mage::helper('pushassist')->send_notification($response_array);
|
109 |
}
|
app/code/community/Webpushnotification/Pushassist/Model/Segmentlist.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Webpushnotification_Pushassist_Model_Segmentlist extends Mage_Eav_Model_Entity_Attribute_Source_Table
|
3 |
+
{
|
4 |
+
public function getAllOptions()
|
5 |
+
{
|
6 |
+
|
7 |
+
$collection = Mage::helper('pushassist')->get_segments();
|
8 |
+
$counter_segment=count($collection);
|
9 |
+
$segments = array();
|
10 |
+
|
11 |
+
if($counter_segment > 0){
|
12 |
+
foreach ($collection as $get_segment_list) {
|
13 |
+
$segments[] = ( array(
|
14 |
+
'label' => (string) $get_segment_list['name'],
|
15 |
+
'value' => $get_segment_list['id']
|
16 |
+
));
|
17 |
+
}
|
18 |
+
return $segments;
|
19 |
+
}else{
|
20 |
+
$segments[] = array(
|
21 |
+
'label' => Mage::helper('pushassist')->__('-- No Segment --'),
|
22 |
+
'value' => ''
|
23 |
+
);
|
24 |
+
return $segments;
|
25 |
+
}
|
26 |
+
}
|
27 |
+
}
|
app/code/community/Webpushnotification/Pushassist/Model/Source/Option.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Webpushnotification_Pushassist_Model_Source_Option
|
3 |
+
extends Mage_Eav_Model_Entity_Attribute_Source_Table
|
4 |
+
{
|
5 |
+
public function getAllOptions()
|
6 |
+
{
|
7 |
+
return $this->getOptionFromTable();
|
8 |
+
}
|
9 |
+
|
10 |
+
private function getOptionFromTable(){
|
11 |
+
$return=array();
|
12 |
+
|
13 |
+
$col = Mage::helper('pushassist')->get_segments();
|
14 |
+
/**
|
15 |
+
* Given that table has column as id,title,image_name
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
foreach($col as $get_segment_list){
|
19 |
+
array_push($return,array('label'=>$get_segment_list['name'],'value'=>$get_segment_list['id']));
|
20 |
+
}
|
21 |
+
return $return;
|
22 |
+
|
23 |
+
}
|
24 |
+
|
25 |
+
public function getOptionText($value)
|
26 |
+
{
|
27 |
+
$options = $this->getAllOptions();
|
28 |
+
foreach ($options as $option) {
|
29 |
+
if(is_array($value)){
|
30 |
+
if (in_array($option['value'],$value)) {
|
31 |
+
return $option['label'];
|
32 |
+
}
|
33 |
+
}
|
34 |
+
else{
|
35 |
+
if ($option['value']==$value) {
|
36 |
+
return $option['label'];
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
}
|
41 |
+
return false;
|
42 |
+
}
|
43 |
+
}
|
app/code/community/Webpushnotification/Pushassist/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Webpushnotification_Pushassist>
|
5 |
-
<version>1.0.
|
6 |
</Webpushnotification_Pushassist>
|
7 |
</modules>
|
8 |
<global>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Webpushnotification_Pushassist>
|
5 |
+
<version>1.0.12</version>
|
6 |
</Webpushnotification_Pushassist>
|
7 |
</modules>
|
8 |
<global>
|
app/code/community/Webpushnotification/Pushassist/sql/pushassist_setup/mysql4-upgrade-1.0.8-1.0.9.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
|
5 |
+
$setup->addAttribute('catalog_product', 'push_segment', array(
|
6 |
+
'group' => 'PushAssist Notification',
|
7 |
+
'input' => 'multiselect',
|
8 |
+
'type' => 'text',
|
9 |
+
'label' => 'Segment',
|
10 |
+
'frontend' => '',
|
11 |
+
'source' => 'pushassist/source_option',
|
12 |
+
'backend' => 'pushassist/backend_option',
|
13 |
+
'visible' => true,
|
14 |
+
'required' => false,
|
15 |
+
'user_defined' => true,
|
16 |
+
'searchable' => 0,
|
17 |
+
'filterable' => 0,
|
18 |
+
'comparable' => 0,
|
19 |
+
'visible_on_front' => 1,
|
20 |
+
'visible_in_advanced_search' => 0,
|
21 |
+
'is_html_allowed_on_front' => 0,
|
22 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
23 |
+
));
|
24 |
+
$installer->endSetup();
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Webpushnotification_Pushassist</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="https://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Push Notification Delivery & Analytics for Websites and Mobile. Send Push Notifications to your customers and store visitors.</summary>
|
10 |
<description>Quickly Send push notifications from desktop or mobile websites to your site users. Powerful APIs and tools that allow you to send, receive and track push messages. Set up trigger marketing campaigns, schedule push notification and much more. Quick 5 minutes setup to implement push notifications for ANY website.</description>
|
11 |
-
<notes>Built a stable version 1.0.
|
12 |
<authors><author><name>PushAssist Team</name><user>PushAssist</user><email>support@pushassist.com</email></author></authors>
|
13 |
-
<date>2017-01-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Webpushnotification"><dir name="Pushassist"><dir name="Block"><dir name="Adminhtml"><file name="Campaign.php" hash="df4a8dc02241f6b486ec539bc2e71370"/><file name="Createaccount.php" hash="2775e933f8b780e022fa3ff0b88b076e"/><file name="Createcampaign.php" hash="318eb9deab2bfc9a8c4cad81449aaf0f"/><file name="Createsegments.php" hash="94ef9183a9c9a56bfb3dece4c4e97fce"/><file name="Dashboard.php" hash="56e56097a9ec2421218ef8d54e8a5e36"/><file name="Notificationmain.php" hash="c5407e7f33659982ce1e12287e96b541"/><file name="Notificationsend.php" hash="c82ebd53ae7efb4c24cb168e75e8ed44"/><file name="Segments.php" hash="2b4bb8731d1ffc0509210e4b0526e247"/><file name="Settings.php" hash="4f9df0d6b916eaaf9bdaec67284740f0"/><file name="Subscribers.php" hash="7698cd83f156fac6ddea9219716508a5"/></dir><file name="Script.php" hash="e2dab9416d5b5f3c4c0b61d0874f8291"/></dir><dir name="Helper"><file name="Data.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Webpushnotification_Pushassist</name>
|
4 |
+
<version>1.0.12</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="https://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Push Notification Delivery & Analytics for Websites and Mobile. Send Push Notifications to your customers and store visitors.</summary>
|
10 |
<description>Quickly Send push notifications from desktop or mobile websites to your site users. Powerful APIs and tools that allow you to send, receive and track push messages. Set up trigger marketing campaigns, schedule push notification and much more. Quick 5 minutes setup to implement push notifications for ANY website.</description>
|
11 |
+
<notes>Built a stable version 1.0.12</notes>
|
12 |
<authors><author><name>PushAssist Team</name><user>PushAssist</user><email>support@pushassist.com</email></author></authors>
|
13 |
+
<date>2017-01-26</date>
|
14 |
+
<time>11:15:06</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Webpushnotification"><dir name="Pushassist"><dir name="Block"><dir name="Adminhtml"><file name="Campaign.php" hash="df4a8dc02241f6b486ec539bc2e71370"/><file name="Createaccount.php" hash="2775e933f8b780e022fa3ff0b88b076e"/><file name="Createcampaign.php" hash="318eb9deab2bfc9a8c4cad81449aaf0f"/><file name="Createsegments.php" hash="94ef9183a9c9a56bfb3dece4c4e97fce"/><file name="Dashboard.php" hash="56e56097a9ec2421218ef8d54e8a5e36"/><file name="Notificationmain.php" hash="c5407e7f33659982ce1e12287e96b541"/><file name="Notificationsend.php" hash="c82ebd53ae7efb4c24cb168e75e8ed44"/><file name="Segments.php" hash="2b4bb8731d1ffc0509210e4b0526e247"/><file name="Settings.php" hash="4f9df0d6b916eaaf9bdaec67284740f0"/><file name="Subscribers.php" hash="7698cd83f156fac6ddea9219716508a5"/></dir><file name="Script.php" hash="e2dab9416d5b5f3c4c0b61d0874f8291"/></dir><dir name="Helper"><file name="Data.php" hash="cd530c90c0c9c997405171955bd0e9d5"/></dir><dir name="Model"><dir name="Backend"><file name="Option.php" hash="3f49ca496fd0620d4afbae9effaebec8"/></dir><file name="Observer.php" hash="25517b4a845743fd10cdc253a2484b09"/><file name="Segmentlist.php" hash="77402bd91a45934106fa489fb0bdbfa3"/><dir name="Source"><file name="Option.php" hash="c0d4b5793510d380c27dd69c586a7448"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Pushassist"><file name="CampaignController.php" hash="d948db17d7620d0f84fcaa6e455c5b2f"/><file name="CampaignlistController.php" hash="693d94b5c087f2f1339ea192df4c10ab"/><file name="CreateaccountController.php" hash="800903fddaf89755ee99714fb0f7eaa3"/><file name="CreatecampaignController.php" hash="50f14a68cc26ba3fcbc55207f9612aa6"/><file name="CreatesegmentsController.php" hash="b2e45413a9bdb163d35a84896f8a2173"/><file name="DashboardController.php" hash="cbd8c12f1d2ca2072944bb80b1cd2d88"/><file name="NotificationmainController.php" hash="319b0b896ce243f64ccb7aa12f130ef0"/><file name="NotificationsendController.php" hash="b94a751c6ee61ce27b80d6aa06d0d95b"/><file name="SegmentsController.php" hash="8d366c16f7e8817413e0492a919ce61d"/><file name="SettingsController.php" hash="6c6ef26a2fdcfd9f41f8b896d9219c52"/><file name="SubscribersController.php" hash="7c941c29948e69b6aabd90b44e4a63fa"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="23a3ba5b7cd214bbe4a9dd6045e5b9f2"/></dir><dir name="sql"><dir name="pushassist_setup"><file name="mysql4-install-1.0.8.php" hash="3f690b91defd911af9a1fb2ec1ed335f"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="eccabd6c9671c1350875b720257d270f"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pushassist.xml" hash="a8bbbe4afa099e9d01525d00574ebef4"/></dir><dir name="template"><dir name="pushassist"><file name="campaign.phtml" hash="473cd90965e5bb32b0e566a3e5f1151e"/><file name="create_account.phtml" hash="95498831445926a90848067d62663b97"/><file name="createcampaign.phtml" hash="a21a1801a1ece9d2481555e86f453cfd"/><file name="createsegments.phtml" hash="ff0c51cd59c9d89d69211fb578f7e4fc"/><file name="dashboard.phtml" hash="322850d57386c48e2569d8fff0b2ea7c"/><file name="notification.phtml" hash="3e0d7735510c7f4a7647b232b8fc348a"/><file name="push_dashboard.phtml" hash="f0d3f3a75f555640e810894f536ec67e"/><file name="segments.phtml" hash="cdc6ebeb064d774bec1ca24706b2eb59"/><file name="sendnotification.phtml" hash="92b786291beb96588d593141ce3ca173"/><file name="settings.phtml" hash="e7e1e5dc96e49ec4788f9f35d06dacbf"/><file name="subscribers.phtml" hash="edfa485993e06fdafbfc04f2d09ec21b"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Webpushnotification_Pushassist.xml" hash="d32b8e99774c18aa5aab352cfdd06e96"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="pushassist"><file name="bootstrap-datetimepicker.min.css" hash="fa0a2cb4d62d4a578174324afdec0be6"/><file name="bootstrap-select.css" hash="71fcb49a14eaea2be04acb5fc54ebbe1"/><file name="bootstrap.min.css" hash="eedf9ee80c2faa4e1b9ab9017cdfcb88"/><file name="campaign.png" hash="fb1f5604466870a9f35dcd62eb6c562f"/><file name="content_base.css" hash="f5892c76d035d78e2e5aba2038778bf4"/><dir name="images"><file name="btn_bg.gif" hash="37c51a4d48a92da9648dcd3ca011039f"/></dir><dir name="imgUpload"><file name="jquery.fileupload.css" hash="2ee732f8354790746644b312b7b2df1b"/><file name="jquery.fileupload.js" hash="25360c56ade52c72edf654045580c1ce"/><file name="jquery.ui.widget.js" hash="0b44270691b4abf4e38e1a45928a3dc6"/></dir><file name="notification_setting.png" hash="8bf9fbc3ef19ab67e1da8f3849d53a9f"/><file name="pushassist_opt_in_box_setting.png" hash="79feadfc5795b25fc2cb3092272c3e95"/></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="pushassist"><file name="bootstrap-datetimepicker.js" hash="3476fc7070ebef66f2c3a6c1c7f3a408"/><file name="bootstrap-select.js" hash="1b4396af90dda85e5e06782133aaa443"/><file name="bootstrap.min.js" hash="8c237312864d2e4c4f03544cd4f9b195"/><file name="jquery.min.js" hash="8101d596b2b8fa35fe3a634ea342d7c3"/><file name="plugins.js" hash="d671d70560ecac1b27b328f643f76fc2"/></dir></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Webpushnotification_Pushassist.csv" hash="4cee55524c735f91e1313afd6e09c0a2"/></dir><dir name="fr_FR"><file name="Webpushnotification_Pushassist.csv" hash="f333463a98bdb3daa77102db1de6a2b8"/></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>
|