Version Notes
We have updated advanced functionality for Shipping
Download this release
Release Info
Developer | mss |
Extension | Mss_Connector |
Version | 2.4.0 |
Comparing to | |
See all releases |
Code changes from version 2.3.2 to 2.4.0
- app/code/local/Mss/Connector/Helper/Data.php +1 -7
- app/code/local/Mss/Connector/Model/Observer.php +23 -73
- app/code/local/Mss/Connector/controllers/Adminhtml/SupportController.php +0 -7
- app/code/local/Mss/Connector/controllers/CartController.php +50 -37
- app/code/local/Mss/Connector/controllers/CustomerController.php +23 -27
- app/code/local/Mss/Connector/controllers/ProductsController.php +7 -4
- app/code/local/Mss/Connector/controllers/TokenController.php +0 -124
- app/code/local/Mss/Connector/etc/config.xml +1 -1
- app/code/local/Mss/Pushnotification/Helper/Data.php +0 -3
- app/code/local/Mss/Pushnotification/etc/config.xml +1 -1
- app/design/adminhtml/default/default/layout/connector.xml +0 -6
- app/design/adminhtml/default/default/template/connector/landing.phtml +5 -1
- package.xml +5 -5
app/code/local/Mss/Connector/Helper/Data.php
CHANGED
@@ -144,13 +144,7 @@ class Mss_Connector_Helper_Data extends Mage_Core_Helper_Abstract
|
|
144 |
|
145 |
$data['user_id'] = Mage::getSingleton("customer/session")->getId();
|
146 |
|
147 |
-
|
148 |
-
$sub_collection = $collection->getCollection();
|
149 |
-
$sub_collection->addFieldToFilter('user_id',$data['user_id'])->addFieldToFilter('cc_number',$data['cc_number']);
|
150 |
-
|
151 |
-
if($sub_collection->getSize()) {
|
152 |
-
return true;
|
153 |
-
}
|
154 |
try{
|
155 |
$collection->setData($data)->save();
|
156 |
return true;
|
144 |
|
145 |
$data['user_id'] = Mage::getSingleton("customer/session")->getId();
|
146 |
|
147 |
+
$collection = Mage::getModel("connector/connector");
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
try{
|
149 |
$collection->setData($data)->save();
|
150 |
return true;
|
app/code/local/Mss/Connector/Model/Observer.php
CHANGED
@@ -2,92 +2,39 @@
|
|
2 |
class Mss_Connector_Model_Observer
|
3 |
{
|
4 |
const XML_SECURE_KEY = 'magentomobileshop/secure/key';
|
5 |
-
const ACTIVATION_URL = 'https://www.magentomobileshop.com/
|
6 |
const TRNS_EMAIL = 'trans_email/ident_general/email';
|
7 |
-
|
8 |
public function notificationMessage()
|
9 |
{
|
10 |
-
|
|
|
11 |
if(!Mage::getStoreConfig('web/url/use_store')):
|
12 |
$mssSwitch = new Mage_Core_Model_Config();
|
13 |
$mssSwitch->saveConfig('web/url/use_store', 1);
|
14 |
endif;
|
|
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
$url = Mage::helper('core/url')->getCurrentUrl('key');
|
19 |
-
$url_path = parse_url($url, PHP_URL_PATH);
|
20 |
-
$token = pathinfo($url_path, PATHINFO_BASENAME);
|
21 |
-
|
22 |
-
$decode = Mage::app()->getRequest()->getParam('mms_id');
|
23 |
-
|
24 |
-
$mssAppData = '';
|
25 |
-
|
26 |
-
if($decode AND !Mage::registry('mms_app_data')) {
|
27 |
-
$param = base64_decode($decode);
|
28 |
-
Mage::register('mms_app_data', $decode);
|
29 |
-
$mssAppData = Mage::registry('mms_app_data');
|
30 |
-
|
31 |
-
}
|
32 |
-
$current = Mage::getStoreConfig('magentomobileshop/secure/key');
|
33 |
-
if((!$current) AND $adminsession->isLoggedIn() AND $mssAppData != '' ) {
|
34 |
-
|
35 |
-
$str = self::ACTIVATION_URL;
|
36 |
-
$url = $str.'?mms_id=';
|
37 |
-
$final_url = $url.''.$mssAppData;
|
38 |
-
$final_urls = $str;
|
39 |
-
$mssSwitch = new Mage_Core_Model_Config();
|
40 |
-
$mssSwitch->saveConfig(self::XML_SECURE_KEY, $mssAppData);
|
41 |
-
$mssSwitchs = new Mage_Core_Model_Config();
|
42 |
-
$mssSwitchs->saveConfig(self::XML_SECURE_KEY_STATUS, '1');
|
43 |
-
|
44 |
-
|
45 |
-
$mssData = array();
|
46 |
-
$mssData['final_url'] = $final_url;
|
47 |
-
$mssData['mms_id'] = base64_encode($mssAppData);
|
48 |
-
$mssData['default_store_name'] = Mage::app()->getDefaultStoreView()->getCode();
|
49 |
-
$mssData['default_store_id'] = Mage::app()->getWebsite(true)->getDefaultGroup()
|
50 |
-
->getDefaultStoreId();
|
51 |
-
$mssData['default_view_id'] = Mage::app()->getDefaultStoreView()->getId();
|
52 |
-
$mssData['default_store_currency'] = Mage::app()->getStore()->getCurrentCurrencyCode();
|
53 |
-
$mssData['status'] = 'true';
|
54 |
-
|
55 |
-
Mage::app()->getCacheInstance()->cleanType('config');
|
56 |
-
Mage::unregister('mms_app_data');
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
|
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
|
67 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
68 |
|
69 |
-
$result = curl_exec($ch);
|
70 |
-
curl_close($ch);
|
71 |
-
Mage::app()->getResponse()->setRedirect(Mage::helper("adminhtml")->getUrl("connector/adminhtml_support/landing/"))->sendResponse();
|
72 |
-
exit;
|
73 |
-
} elseif($current != '' AND $adminsession->isLoggedIn() AND $decode != '') {
|
74 |
-
//Mage::getSingleton('core/session')->addSuccess('Your extension is activated.');
|
75 |
-
Mage::app()->getResponse()->setRedirect(Mage::helper("adminhtml")->getUrl("connector/adminhtml_support/landing/", array('_query'=>'test=1')))->sendResponse();
|
76 |
-
exit;
|
77 |
|
78 |
-
|
79 |
-
if(!Mage::getStoreConfig(self::XML_SECURE_KEY) AND $adminsession->isLoggedIn()):
|
80 |
-
$static_url = 'https://www.magentomobileshop.com/user/mobile-connect';
|
81 |
-
$href = $static_url.'?email='.Mage::getStoreConfig(self::TRNS_EMAIL).'&url='.Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
82 |
-
|
83 |
-
Mage::getSingleton('core/session')->addError('Magentomobileshop extension is not activated yet, <a href="'.$href.'" target="_blank">Click here</a> to activate your extension.');
|
84 |
-
endif;
|
85 |
-
|
86 |
}
|
87 |
|
88 |
-
|
89 |
public function sendemail(){
|
90 |
|
|
|
91 |
$current_store_url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);;
|
92 |
$current_store_name = Mage::getStoreConfig('general/store_information/name');
|
93 |
$current_store_phone =Mage::getStoreConfig('general/store_information/phone');
|
@@ -103,22 +50,25 @@ class Mss_Connector_Model_Observer
|
|
103 |
Thank you,
|
104 |
MagentoMobileshop Dev Tem
|
105 |
MESSAGE;
|
|
|
|
|
106 |
$to = "contact@magentomobileshop.com";
|
|
|
107 |
$subject = "New Connector Installation ";
|
108 |
$headers = "MIME-Version: 1.0" . "\r\n";
|
109 |
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
|
110 |
$headers .= 'From: <contact@magentomobileshop.com>' . "\r\n";
|
111 |
$headers .= 'Cc: mss.yogendra@gmail.com' . "\r\n";
|
112 |
$email = mail($to,$subject,$message,$headers);
|
|
|
113 |
if($email):
|
114 |
$mssSwitch = new Mage_Core_Model_Config();
|
115 |
$mssSwitch->saveConfig('mss/connector/email', 1);
|
116 |
endif;
|
|
|
|
|
117 |
return true;
|
118 |
|
119 |
}
|
120 |
|
121 |
-
|
122 |
}
|
123 |
-
|
124 |
-
|
2 |
class Mss_Connector_Model_Observer
|
3 |
{
|
4 |
const XML_SECURE_KEY = 'magentomobileshop/secure/key';
|
5 |
+
const ACTIVATION_URL = 'https://www.magentomobileshop.com/mobile-connect';
|
6 |
const TRNS_EMAIL = 'trans_email/ident_general/email';
|
7 |
+
|
8 |
public function notificationMessage()
|
9 |
{
|
10 |
+
$adminsession = Mage::getSingleton('admin/session', array('name'=>'adminhtml'));
|
11 |
+
|
12 |
if(!Mage::getStoreConfig('web/url/use_store')):
|
13 |
$mssSwitch = new Mage_Core_Model_Config();
|
14 |
$mssSwitch->saveConfig('web/url/use_store', 1);
|
15 |
endif;
|
16 |
+
|
17 |
|
18 |
+
if(!Mage::getStoreConfig(self::XML_SECURE_KEY) AND $adminsession->isLoggedIn()):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
+
$href = self::ACTIVATION_URL.'?email='.Mage::getStoreConfig(self::TRNS_EMAIL).'&url='.Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
21 |
+
|
22 |
+
Mage::getSingleton('core/session')->addError('Magentomobileshop extension is not activated yet, <a href="'.$href.'" target="_blank">Click here</a> to activate your extension.');
|
23 |
+
|
24 |
+
endif;
|
25 |
|
26 |
+
$configValue = Mage::getStoreConfig('mss/connector/email');
|
27 |
+
|
28 |
+
/*if($configValue =='' AND $adminsession->isLoggedIn())
|
29 |
+
$this->sendemail();*/
|
|
|
|
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
|
|
|
35 |
public function sendemail(){
|
36 |
|
37 |
+
|
38 |
$current_store_url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);;
|
39 |
$current_store_name = Mage::getStoreConfig('general/store_information/name');
|
40 |
$current_store_phone =Mage::getStoreConfig('general/store_information/phone');
|
50 |
Thank you,
|
51 |
MagentoMobileshop Dev Tem
|
52 |
MESSAGE;
|
53 |
+
|
54 |
+
|
55 |
$to = "contact@magentomobileshop.com";
|
56 |
+
|
57 |
$subject = "New Connector Installation ";
|
58 |
$headers = "MIME-Version: 1.0" . "\r\n";
|
59 |
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
|
60 |
$headers .= 'From: <contact@magentomobileshop.com>' . "\r\n";
|
61 |
$headers .= 'Cc: mss.yogendra@gmail.com' . "\r\n";
|
62 |
$email = mail($to,$subject,$message,$headers);
|
63 |
+
|
64 |
if($email):
|
65 |
$mssSwitch = new Mage_Core_Model_Config();
|
66 |
$mssSwitch->saveConfig('mss/connector/email', 1);
|
67 |
endif;
|
68 |
+
|
69 |
+
|
70 |
return true;
|
71 |
|
72 |
}
|
73 |
|
|
|
74 |
}
|
|
|
|
app/code/local/Mss/Connector/controllers/Adminhtml/SupportController.php
CHANGED
@@ -30,12 +30,5 @@ class Mss_Connector_Adminhtml_SupportController extends Mage_Adminhtml_Controlle
|
|
30 |
}
|
31 |
return $msg;
|
32 |
}
|
33 |
-
|
34 |
-
public function landingAction() {
|
35 |
-
|
36 |
-
$this->loadLayout();
|
37 |
-
$this->_title($this->__("Verification"));
|
38 |
-
$this->renderLayout();
|
39 |
-
}
|
40 |
}
|
41 |
|
30 |
}
|
31 |
return $msg;
|
32 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
|
app/code/local/Mss/Connector/controllers/CartController.php
CHANGED
@@ -407,7 +407,7 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
407 |
{
|
408 |
echo json_encode ( array (
|
409 |
'status' => 'error',
|
410 |
-
'message' => $this->__("Coupon code
|
411 |
));
|
412 |
return false;
|
413 |
}
|
@@ -504,7 +504,7 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
504 |
->setCollectShippingRates(true);
|
505 |
}
|
506 |
$quote->save();
|
507 |
-
$quote->getShippingAddress()->setShippingMethod($shipping_method
|
508 |
}
|
509 |
|
510 |
$quote->collectTotals ()->save ();
|
@@ -527,7 +527,7 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
527 |
->setCollectShippingRates(true);
|
528 |
}
|
529 |
$quote->save();
|
530 |
-
$quote->getShippingAddress()->setShippingMethod($shipping_method
|
531 |
}
|
532 |
$quote->collectTotals ()->save ();
|
533 |
$amount=$quote->getShippingAddress();
|
@@ -803,7 +803,7 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
803 |
|
804 |
|
805 |
####get all enabled shipping methods
|
806 |
-
public function getshippingmethodsAction(){
|
807 |
|
808 |
$methods = Mage::getSingleton('shipping/config')->getActiveCarriers();
|
809 |
$shipMethods = array();
|
@@ -813,32 +813,42 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
813 |
foreach ($methods as $shippigCode=>$shippingModel)
|
814 |
{
|
815 |
|
816 |
-
|
817 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
818 |
$shippingTitle = Mage::getStoreConfig('carriers/'.$shippigCode.'/title');
|
819 |
$shippingPrice = Mage::getStoreConfig('carriers/'.$shippigCode.'/price');
|
820 |
$shipMethods[]=array(
|
821 |
-
'code'=>$
|
822 |
'value'=>$shippingTitle,
|
823 |
'price'=>number_format ( Mage::helper ( 'directory' )
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
);
|
828 |
endif;
|
|
|
829 |
|
830 |
-
|
831 |
-
$shippingTitle = Mage::getStoreConfig('carriers/'.$shippigCode.'/title');
|
832 |
-
$shippingPrice = Mage::getStoreConfig('carriers/'.$shippigCode.'/price');
|
833 |
-
$shipMethods[]=array(
|
834 |
-
'code'=>$shippigCode,
|
835 |
-
'value'=>$shippingTitle,
|
836 |
-
'price'=>number_format ( Mage::helper ( 'directory' )
|
837 |
-
->currencyConvert ( $shippingPrice,
|
838 |
-
$baseCurrency,
|
839 |
-
$currentCurrency ), 2, '.', '' )
|
840 |
-
);
|
841 |
-
endif;
|
842 |
|
843 |
|
844 |
}
|
@@ -905,14 +915,15 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
905 |
|
906 |
|
907 |
$session = Mage::getSingleton ( 'customer/session' );
|
908 |
-
$customerId=$session->getId();
|
|
|
|
|
909 |
|
910 |
##Get current quote
|
911 |
$totalItems = Mage::helper('checkout/cart')->getSummaryCount();
|
912 |
|
913 |
if($totalItems > 0):
|
914 |
-
#get the addressid
|
915 |
-
|
916 |
$addressId=(int)$this->getRequest()->getParam('addressid');
|
917 |
$shipping_method=$this->getRequest()->getParam('shippingmethod');
|
918 |
$paymentmethod=$this->getRequest()->getParam('paymentmethod');
|
@@ -920,6 +931,8 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
920 |
$card_details = $this->getRequest()->getParam('cards_details');
|
921 |
$save_cc = $this->getRequest()->getParam('save_cc');
|
922 |
|
|
|
|
|
923 |
if($paymentmethod == 'authorizenet')
|
924 |
$this->validateCarddtails(json_decode($card_details,1));
|
925 |
|
@@ -954,13 +967,13 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
954 |
try {
|
955 |
$addressData=Mage::getModel('customer/address')->load($addressId)->getData();
|
956 |
$quote=Mage::getSingleton ( 'checkout/session' )->getQuote();
|
957 |
-
|
958 |
|
959 |
$billingAddress = $quote->getBillingAddress()->addData($addressData);
|
960 |
$shippingAddress = $quote->getShippingAddress()->addData($addressData);
|
961 |
|
962 |
$shippingAddress->setCollectShippingRates(true)->collectShippingRates()
|
963 |
-
->setShippingMethod($shipping_method
|
964 |
|
965 |
if($paymentmethod != 'authorizenet'):
|
966 |
$shippingAddress->setPaymentMethod($paymentmethod);
|
@@ -990,6 +1003,7 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
990 |
$service = Mage::getModel('sales/service_quote', $quote);
|
991 |
$service->submitAll();
|
992 |
$order = $service->getOrder();
|
|
|
993 |
$quote->delete();
|
994 |
|
995 |
$cart = Mage::helper ( 'checkout/cart' )->getCart ();
|
@@ -1000,7 +1014,6 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
1000 |
|
1001 |
$result=array( 'message'=>$this->__('Order placed successfully.'),
|
1002 |
'orderid'=>$order->getIncrementId(),
|
1003 |
-
'result'=>'success',
|
1004 |
'result'=>'success'
|
1005 |
|
1006 |
);
|
@@ -1049,7 +1062,7 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
1049 |
endif;
|
1050 |
|
1051 |
$checkout_session =Mage::getModel ( 'checkout/session' )->getQuoteId();
|
1052 |
-
Mage::getSingleton ( 'checkout/session' )->getQuote()->setMms_order_type('app')->save();
|
1053 |
|
1054 |
$quote = Mage::getModel('sales/quote')->load($checkout_session);
|
1055 |
$quote->setStoreId(Mage::app()->getStore()->getId());
|
@@ -1087,7 +1100,7 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
1087 |
|
1088 |
$quote->getShippingAddress()
|
1089 |
->addData($billingAddress)
|
1090 |
-
->setShippingMethod($shipping_method
|
1091 |
|
1092 |
$quote->getShippingAddress()->setCollectShippingRates(true)->collectShippingRates();
|
1093 |
$quote->collectTotals();
|
@@ -1117,6 +1130,7 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
1117 |
$service = Mage::getModel('sales/service_quote', $quote);
|
1118 |
$service->submitAll();
|
1119 |
$order = $service->getOrder();
|
|
|
1120 |
|
1121 |
$increment_id = $order->getRealOrderId();
|
1122 |
$quote = $customer = $service = null;
|
@@ -1292,7 +1306,6 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
1292 |
public function getcheckoutcartAction(){
|
1293 |
$customerId =(int)$this->getRequest()->getParam('customerid');
|
1294 |
|
1295 |
-
|
1296 |
if ($customerId) {
|
1297 |
|
1298 |
$customer = Mage::getModel('customer/customer')->load($customerId);
|
@@ -1300,7 +1313,7 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
1300 |
$cart = Mage::getModel('sales/quote') ->loadByCustomer($customer);
|
1301 |
|
1302 |
if(!count($cart->getAllItems())):
|
1303 |
-
echo json_encode(array('status'=>'success','message'
|
1304 |
exit;
|
1305 |
endif;
|
1306 |
$product_model = Mage::getModel ( 'catalog/product' );
|
@@ -1308,7 +1321,8 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
1308 |
$baseCurrency = Mage::app ()->getStore ()->getBaseCurrency ()->getCode ();
|
1309 |
$currentCurrency = $this->currency;
|
1310 |
|
1311 |
-
foreach ($cart->getAllVisibleItems() as $item) {
|
|
|
1312 |
$productName= array();
|
1313 |
$productName['cart_item_id'] = $item->getId();
|
1314 |
$productName['id'] = $item->getProductId();
|
@@ -1335,14 +1349,14 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
1335 |
$product['subtotal'] = $cart->getSubtotal();
|
1336 |
$product['grandtotal'] = $cart->getGrandTotal();
|
1337 |
$product['totalitems'] = $cart->getItemsCount();
|
1338 |
-
|
1339 |
|
1340 |
-
echo json_encode(array('status'=>'success','message'
|
1341 |
|
1342 |
}
|
1343 |
catch(exception $e)
|
1344 |
{
|
1345 |
-
echo json_encode(array('status'=>'error','message'=> $e->getMessage()));
|
1346 |
}
|
1347 |
}
|
1348 |
else {
|
@@ -1358,7 +1372,6 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
1358 |
$items = $quote->getAllVisibleItems ();
|
1359 |
$cartItemArr='';
|
1360 |
foreach ( $items as $item ){
|
1361 |
-
|
1362 |
$productName= array();
|
1363 |
$productName['cart_item_id'] = $item->getId();
|
1364 |
$productName['id'] = $item->getProductId();
|
407 |
{
|
408 |
echo json_encode ( array (
|
409 |
'status' => 'error',
|
410 |
+
'message' => $this->__("Coupon code is not Valid" )
|
411 |
));
|
412 |
return false;
|
413 |
}
|
504 |
->setCollectShippingRates(true);
|
505 |
}
|
506 |
$quote->save();
|
507 |
+
$quote->getShippingAddress()->setShippingMethod($shipping_method)->save();
|
508 |
}
|
509 |
|
510 |
$quote->collectTotals ()->save ();
|
527 |
->setCollectShippingRates(true);
|
528 |
}
|
529 |
$quote->save();
|
530 |
+
$quote->getShippingAddress()->setShippingMethod($shipping_method)->save();
|
531 |
}
|
532 |
$quote->collectTotals ()->save ();
|
533 |
$amount=$quote->getShippingAddress();
|
803 |
|
804 |
|
805 |
####get all enabled shipping methods
|
806 |
+
public function getshippingmethodsAction(){
|
807 |
|
808 |
$methods = Mage::getSingleton('shipping/config')->getActiveCarriers();
|
809 |
$shipMethods = array();
|
813 |
foreach ($methods as $shippigCode=>$shippingModel)
|
814 |
{
|
815 |
|
816 |
+
if( $carrierMethods = $shippingModel->getAllowedMethods() )
|
817 |
+
{
|
818 |
+
foreach ($carrierMethods as $methodCode => $method)
|
819 |
+
{
|
820 |
+
$code= $shippigCode.'_'.$methodCode;
|
821 |
+
|
822 |
+
|
823 |
+
if($shippigCode == 'freeshipping'):
|
824 |
+
if(Mage::getStoreConfig('carriers/'.$shippigCode.'/free_shipping_subtotal') < Mage::helper('checkout/cart')->getQuote()->getBaseSubtotalWithDiscount()):
|
825 |
+
$shippingTitle = Mage::getStoreConfig('carriers/'.$shippigCode.'/title');
|
826 |
+
$shippingPrice = Mage::getStoreConfig('carriers/'.$shippigCode.'/price');
|
827 |
+
$shipMethods[]=array(
|
828 |
+
'code'=>$shippigCode.'_'.$shippigCode,
|
829 |
+
'value'=>$shippingTitle,
|
830 |
+
'price'=>number_format ( Mage::helper ( 'directory' )
|
831 |
+
->currencyConvert ( $shippingPrice,
|
832 |
+
$baseCurrency,
|
833 |
+
$currentCurrency ), 2, '.', '' )
|
834 |
+
);
|
835 |
+
endif;
|
836 |
+
|
837 |
+
else:
|
838 |
$shippingTitle = Mage::getStoreConfig('carriers/'.$shippigCode.'/title');
|
839 |
$shippingPrice = Mage::getStoreConfig('carriers/'.$shippigCode.'/price');
|
840 |
$shipMethods[]=array(
|
841 |
+
'code'=>$code,
|
842 |
'value'=>$shippingTitle,
|
843 |
'price'=>number_format ( Mage::helper ( 'directory' )
|
844 |
+
->currencyConvert ( $shippingPrice,
|
845 |
+
$baseCurrency,
|
846 |
+
$currentCurrency ), 2, '.', '' )
|
847 |
);
|
848 |
endif;
|
849 |
+
}
|
850 |
|
851 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
852 |
|
853 |
|
854 |
}
|
915 |
|
916 |
|
917 |
$session = Mage::getSingleton ( 'customer/session' );
|
918 |
+
$customerId=$session->getId();
|
919 |
+
|
920 |
+
|
921 |
|
922 |
##Get current quote
|
923 |
$totalItems = Mage::helper('checkout/cart')->getSummaryCount();
|
924 |
|
925 |
if($totalItems > 0):
|
926 |
+
#get the addressid
|
|
|
927 |
$addressId=(int)$this->getRequest()->getParam('addressid');
|
928 |
$shipping_method=$this->getRequest()->getParam('shippingmethod');
|
929 |
$paymentmethod=$this->getRequest()->getParam('paymentmethod');
|
931 |
$card_details = $this->getRequest()->getParam('cards_details');
|
932 |
$save_cc = $this->getRequest()->getParam('save_cc');
|
933 |
|
934 |
+
|
935 |
+
|
936 |
if($paymentmethod == 'authorizenet')
|
937 |
$this->validateCarddtails(json_decode($card_details,1));
|
938 |
|
967 |
try {
|
968 |
$addressData=Mage::getModel('customer/address')->load($addressId)->getData();
|
969 |
$quote=Mage::getSingleton ( 'checkout/session' )->getQuote();
|
970 |
+
//$quote->setMms_order_type('app')->save();
|
971 |
|
972 |
$billingAddress = $quote->getBillingAddress()->addData($addressData);
|
973 |
$shippingAddress = $quote->getShippingAddress()->addData($addressData);
|
974 |
|
975 |
$shippingAddress->setCollectShippingRates(true)->collectShippingRates()
|
976 |
+
->setShippingMethod($shipping_method);
|
977 |
|
978 |
if($paymentmethod != 'authorizenet'):
|
979 |
$shippingAddress->setPaymentMethod($paymentmethod);
|
1003 |
$service = Mage::getModel('sales/service_quote', $quote);
|
1004 |
$service->submitAll();
|
1005 |
$order = $service->getOrder();
|
1006 |
+
$order->setMms_order_type('app')->save();
|
1007 |
$quote->delete();
|
1008 |
|
1009 |
$cart = Mage::helper ( 'checkout/cart' )->getCart ();
|
1014 |
|
1015 |
$result=array( 'message'=>$this->__('Order placed successfully.'),
|
1016 |
'orderid'=>$order->getIncrementId(),
|
|
|
1017 |
'result'=>'success'
|
1018 |
|
1019 |
);
|
1062 |
endif;
|
1063 |
|
1064 |
$checkout_session =Mage::getModel ( 'checkout/session' )->getQuoteId();
|
1065 |
+
//Mage::getSingleton ( 'checkout/session' )->getQuote()->setMms_order_type('app')->save();
|
1066 |
|
1067 |
$quote = Mage::getModel('sales/quote')->load($checkout_session);
|
1068 |
$quote->setStoreId(Mage::app()->getStore()->getId());
|
1100 |
|
1101 |
$quote->getShippingAddress()
|
1102 |
->addData($billingAddress)
|
1103 |
+
->setShippingMethod($shipping_method);
|
1104 |
|
1105 |
$quote->getShippingAddress()->setCollectShippingRates(true)->collectShippingRates();
|
1106 |
$quote->collectTotals();
|
1130 |
$service = Mage::getModel('sales/service_quote', $quote);
|
1131 |
$service->submitAll();
|
1132 |
$order = $service->getOrder();
|
1133 |
+
$order->setMms_order_type('app')->save();
|
1134 |
|
1135 |
$increment_id = $order->getRealOrderId();
|
1136 |
$quote = $customer = $service = null;
|
1306 |
public function getcheckoutcartAction(){
|
1307 |
$customerId =(int)$this->getRequest()->getParam('customerid');
|
1308 |
|
|
|
1309 |
if ($customerId) {
|
1310 |
|
1311 |
$customer = Mage::getModel('customer/customer')->load($customerId);
|
1313 |
$cart = Mage::getModel('sales/quote') ->loadByCustomer($customer);
|
1314 |
|
1315 |
if(!count($cart->getAllItems())):
|
1316 |
+
echo json_encode(array('status'=>'success','message'=>$product));
|
1317 |
exit;
|
1318 |
endif;
|
1319 |
$product_model = Mage::getModel ( 'catalog/product' );
|
1321 |
$baseCurrency = Mage::app ()->getStore ()->getBaseCurrency ()->getCode ();
|
1322 |
$currentCurrency = $this->currency;
|
1323 |
|
1324 |
+
foreach ($cart->getAllVisibleItems() as $item) {
|
1325 |
+
|
1326 |
$productName= array();
|
1327 |
$productName['cart_item_id'] = $item->getId();
|
1328 |
$productName['id'] = $item->getProductId();
|
1349 |
$product['subtotal'] = $cart->getSubtotal();
|
1350 |
$product['grandtotal'] = $cart->getGrandTotal();
|
1351 |
$product['totalitems'] = $cart->getItemsCount();
|
1352 |
+
$product['symbol'] = Mage::helper('connector')->getCurrencysymbolByCode($this->currency);
|
1353 |
|
1354 |
+
echo json_encode(array('status'=>'success','message'=>$product));
|
1355 |
|
1356 |
}
|
1357 |
catch(exception $e)
|
1358 |
{
|
1359 |
+
echo json_encode(array('status'=>'error','message'=> $this->__($e->getMessage())));
|
1360 |
}
|
1361 |
}
|
1362 |
else {
|
1372 |
$items = $quote->getAllVisibleItems ();
|
1373 |
$cartItemArr='';
|
1374 |
foreach ( $items as $item ){
|
|
|
1375 |
$productName= array();
|
1376 |
$productName['cart_item_id'] = $item->getId();
|
1377 |
$productName['id'] = $item->getProductId();
|
app/code/local/Mss/Connector/controllers/CustomerController.php
CHANGED
@@ -54,17 +54,15 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
54 |
|
55 |
$customerinfo = array ();
|
56 |
|
57 |
-
if (Mage::getSingleton ( 'customer/session' )->isLoggedIn()) {
|
58 |
-
$customer = Mage::getSingleton ( 'customer/session' )->getCustomer ();
|
59 |
$storeUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
|
60 |
|
61 |
-
|
62 |
$customerinfo = array (
|
63 |
'id'=>$customer->getId(),
|
64 |
'name' => $customer->getFirstname () .' '.$customer->getLastname (),
|
65 |
'email' => $customer->getEmail (),
|
66 |
);
|
67 |
-
|
68 |
|
69 |
return $customerinfo;
|
70 |
} else return false;
|
@@ -78,15 +76,12 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
78 |
|
79 |
|
80 |
$session = Mage::getSingleton ( 'customer/session' );
|
81 |
-
|
82 |
-
if (Mage::getSingleton ( 'customer/session' )->isLoggedIn ()) {
|
83 |
$session->logout ();
|
84 |
}
|
85 |
$username = Mage::app ()->getRequest ()->getParam ( 'username' );
|
86 |
-
|
87 |
-
|
88 |
-
//Mage::log(print_r($username, true),null,'cust.log');
|
89 |
-
|
90 |
try {
|
91 |
if (!$session->login ( $username, $password )) {
|
92 |
echo json_encode(array('status' => 'error','message'=> $this->__('wrong username or password.')));
|
@@ -177,12 +172,13 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
177 |
}
|
178 |
|
179 |
echo json_encode ( array (
|
180 |
-
|
181 |
-
|
|
|
182 |
) );
|
183 |
} else {
|
184 |
echo json_encode ( array (
|
185 |
-
|
186 |
'0x1000',
|
187 |
$errors
|
188 |
) );
|
@@ -196,11 +192,14 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
196 |
$message = $this->__($e->getMessage ());
|
197 |
}
|
198 |
echo json_encode ( array (
|
199 |
-
|
200 |
-
'
|
|
|
|
|
|
|
201 |
) );
|
202 |
} catch ( Exception $e ) {
|
203 |
-
echo json_encode ( array (
|
204 |
false,
|
205 |
'0x1000',
|
206 |
$this->__($e->getMessage () )
|
@@ -220,7 +219,7 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
220 |
$customer = Mage::getModel ( 'customer/customer' )->setWebsiteId ( Mage::app ()->getStore ()->getWebsiteId () )->loadByEmail ( $email );
|
221 |
$this->_sendEmailTemplate ( $customer,self::XML_PATH_FORGOT_EMAIL_TEMPLATE, self::XML_PATH_FORGOT_EMAIL_IDENTITY, array (
|
222 |
'customer' => $customer
|
223 |
-
), $
|
224 |
echo json_encode ( array (
|
225 |
'status' => 'error',
|
226 |
'message' => $this->__('Request has sent to your Email.')
|
@@ -397,7 +396,7 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
397 |
$id=(int)$this->getRequest()->getParam('addressid');
|
398 |
|
399 |
|
400 |
-
$address=Mage::getModel('customer/address')->load($id);
|
401 |
|
402 |
if($address->getId()):
|
403 |
|
@@ -673,18 +672,16 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
673 |
"name" => $name,
|
674 |
"sku" => $sku,
|
675 |
"id" => $ids,
|
676 |
-
"quantity" =>
|
677 |
"unitprice" => $unitPrice,
|
678 |
"image" => $images,
|
679 |
"total_item_count" => $itemcount,
|
680 |
"price_org" => $test_p,
|
681 |
"price_based_curr" => 1,
|
682 |
);
|
683 |
-
|
684 |
|
685 |
} # item foreach close
|
686 |
-
|
687 |
-
Mage::log(print_r( $productlist, true),null,'cust.log');
|
688 |
|
689 |
$order_date = $order->getCreatedAtStoreDate().'';
|
690 |
$orderData = array(
|
@@ -742,8 +739,7 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
742 |
|
743 |
if(Mage::getSingleton('customer/session')->isLoggedIn()):
|
744 |
$info=array();
|
745 |
-
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
746 |
-
|
747 |
$info['firstname'] = $customer->getFirstname();
|
748 |
$info['lastname'] = $customer->getLastname();
|
749 |
$customerAddressId =$customer->getDefaultBilling();
|
@@ -859,7 +855,7 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
859 |
Response : JSON
|
860 |
|
861 |
*/
|
862 |
-
|
863 |
|
864 |
if (Mage::getSingleton ( 'customer/session' )->isLoggedIn()):
|
865 |
|
@@ -959,8 +955,8 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
959 |
|
960 |
|
961 |
}
|
962 |
-
|
963 |
-
|
964 |
|
965 |
/*
|
966 |
URL : baseurl/restapi/customer/deleteAddress
|
54 |
|
55 |
$customerinfo = array ();
|
56 |
|
57 |
+
if (Mage::getSingleton ( 'customer/session' )->isLoggedIn()) {
|
58 |
+
$customer = Mage::getSingleton ( 'customer/session' )->getCustomer ();
|
59 |
$storeUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
|
60 |
|
|
|
61 |
$customerinfo = array (
|
62 |
'id'=>$customer->getId(),
|
63 |
'name' => $customer->getFirstname () .' '.$customer->getLastname (),
|
64 |
'email' => $customer->getEmail (),
|
65 |
);
|
|
|
66 |
|
67 |
return $customerinfo;
|
68 |
} else return false;
|
76 |
|
77 |
|
78 |
$session = Mage::getSingleton ( 'customer/session' );
|
79 |
+
if (Mage::getSingleton ( 'customer/session' )->isLoggedIn ()) {
|
|
|
80 |
$session->logout ();
|
81 |
}
|
82 |
$username = Mage::app ()->getRequest ()->getParam ( 'username' );
|
83 |
+
$password = Mage::app ()->getRequest ()->getParam ( 'password' );
|
84 |
+
|
|
|
|
|
85 |
try {
|
86 |
if (!$session->login ( $username, $password )) {
|
87 |
echo json_encode(array('status' => 'error','message'=> $this->__('wrong username or password.')));
|
172 |
}
|
173 |
|
174 |
echo json_encode ( array (
|
175 |
+
true,
|
176 |
+
'0x0000',
|
177 |
+
array ()
|
178 |
) );
|
179 |
} else {
|
180 |
echo json_encode ( array (
|
181 |
+
false,
|
182 |
'0x1000',
|
183 |
$errors
|
184 |
) );
|
192 |
$message = $this->__($e->getMessage ());
|
193 |
}
|
194 |
echo json_encode ( array (
|
195 |
+
false,
|
196 |
+
'0x1000',
|
197 |
+
array (
|
198 |
+
$message
|
199 |
+
)
|
200 |
) );
|
201 |
} catch ( Exception $e ) {
|
202 |
+
echo json_encode ( array (
|
203 |
false,
|
204 |
'0x1000',
|
205 |
$this->__($e->getMessage () )
|
219 |
$customer = Mage::getModel ( 'customer/customer' )->setWebsiteId ( Mage::app ()->getStore ()->getWebsiteId () )->loadByEmail ( $email );
|
220 |
$this->_sendEmailTemplate ( $customer,self::XML_PATH_FORGOT_EMAIL_TEMPLATE, self::XML_PATH_FORGOT_EMAIL_IDENTITY, array (
|
221 |
'customer' => $customer
|
222 |
+
), $storeId );
|
223 |
echo json_encode ( array (
|
224 |
'status' => 'error',
|
225 |
'message' => $this->__('Request has sent to your Email.')
|
396 |
$id=(int)$this->getRequest()->getParam('addressid');
|
397 |
|
398 |
|
399 |
+
$address=Mage::getModel('customer/address')->load($id);
|
400 |
|
401 |
if($address->getId()):
|
402 |
|
672 |
"name" => $name,
|
673 |
"sku" => $sku,
|
674 |
"id" => $ids,
|
675 |
+
"quantity" =>(int)$qty,
|
676 |
"unitprice" => $unitPrice,
|
677 |
"image" => $images,
|
678 |
"total_item_count" => $itemcount,
|
679 |
"price_org" => $test_p,
|
680 |
"price_based_curr" => 1,
|
681 |
);
|
|
|
682 |
|
683 |
} # item foreach close
|
684 |
+
|
|
|
685 |
|
686 |
$order_date = $order->getCreatedAtStoreDate().'';
|
687 |
$orderData = array(
|
739 |
|
740 |
if(Mage::getSingleton('customer/session')->isLoggedIn()):
|
741 |
$info=array();
|
742 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
|
|
743 |
$info['firstname'] = $customer->getFirstname();
|
744 |
$info['lastname'] = $customer->getLastname();
|
745 |
$customerAddressId =$customer->getDefaultBilling();
|
855 |
Response : JSON
|
856 |
|
857 |
*/
|
858 |
+
public function editCustomerAddressAction(){
|
859 |
|
860 |
if (Mage::getSingleton ( 'customer/session' )->isLoggedIn()):
|
861 |
|
955 |
|
956 |
|
957 |
}
|
958 |
+
|
959 |
+
/*Delete Address API*/
|
960 |
|
961 |
/*
|
962 |
URL : baseurl/restapi/customer/deleteAddress
|
app/code/local/Mss/Connector/controllers/ProductsController.php
CHANGED
@@ -535,11 +535,14 @@ class Mss_Connector_ProductsController extends Mage_Core_Controller_Front_Action
|
|
535 |
|
536 |
$products = Mage::getModel('catalog/product')->getCollection();
|
537 |
$products->addAttributeToSelect(array('name','entity_id','status','visibility'),'inner')
|
538 |
-
|
539 |
-
->addAttributeToFilter(
|
540 |
-
|
|
|
|
|
|
|
541 |
->addAttributeToFilter ( 'visibility', array ('neq' => 1 ) )
|
542 |
-
|
543 |
|
544 |
$productlist = array ();
|
545 |
$baseCurrency = Mage::app ()->getStore ()->getBaseCurrency ()->getCode ();
|
535 |
|
536 |
$products = Mage::getModel('catalog/product')->getCollection();
|
537 |
$products->addAttributeToSelect(array('name','entity_id','status','visibility'),'inner')
|
538 |
+
->setPageSize ($limit)
|
539 |
+
->addAttributeToFilter(array(
|
540 |
+
array('attribute'=>'name', 'like' => '%'.$searchstring.'%'),
|
541 |
+
array('attribute'=>'description', 'like' => '%'.$searchstring.'%'),
|
542 |
+
))
|
543 |
+
->addAttributeToFilter ( 'status', 1 )
|
544 |
->addAttributeToFilter ( 'visibility', array ('neq' => 1 ) )
|
545 |
+
->setPage ( $page, $limit );
|
546 |
|
547 |
$productlist = array ();
|
548 |
$baseCurrency = Mage::app ()->getStore ()->getBaseCurrency ()->getCode ();
|
app/code/local/Mss/Connector/controllers/TokenController.php
CHANGED
@@ -255,128 +255,4 @@ class Mss_Connector_TokenController extends Mage_Core_Controller_Front_Action {
|
|
255 |
|
256 |
|
257 |
}
|
258 |
-
|
259 |
-
/*
|
260 |
-
Working url : baseURL/restapi/token/getConfiguration/
|
261 |
-
Name : getAppData
|
262 |
-
Method : GET
|
263 |
-
Response : JSON
|
264 |
-
Return Response :
|
265 |
-
{
|
266 |
-
"total": "1",
|
267 |
-
"ios": "1",
|
268 |
-
"android": "1",
|
269 |
-
"date": "0"
|
270 |
-
}
|
271 |
-
*/
|
272 |
-
|
273 |
-
public function getAppDatassAction()
|
274 |
-
{
|
275 |
-
|
276 |
-
$Url_secureKey = "a3d9588249672e80380ffa0cd0e46c52";
|
277 |
-
if(Mage::getStoreConfig(self::XML_SECURE_KEY) == $Url_secureKey) {
|
278 |
-
$array = array();
|
279 |
-
$array['total_count'] = 2;
|
280 |
-
$array['android_count'] = 2;
|
281 |
-
$array['ios_count'] =2 ;
|
282 |
-
$array['status']=true;
|
283 |
-
$array['date']= Mage::getModel('core/date')->date('Y-m-d');
|
284 |
-
echo json_encode($array);
|
285 |
-
echo "true";
|
286 |
-
} else {
|
287 |
-
return false;
|
288 |
-
echo "false";
|
289 |
-
}
|
290 |
-
|
291 |
-
}
|
292 |
-
|
293 |
-
|
294 |
-
public function totalsAction() {
|
295 |
-
|
296 |
-
$array = array();
|
297 |
-
$secureKey = $this->getRequest()->getParam('mms_id');
|
298 |
-
//$secureKey = "a3d9588249672e80380ffa0cd0e46c52";
|
299 |
-
//$current_date = Mage::getModel('core/date')->date('Y-m-d');
|
300 |
-
$current_date =date("Y-m-d");
|
301 |
-
$prev_date = date('Y-m-d', strtotime($current_date.' -1 day'));
|
302 |
-
|
303 |
-
try {
|
304 |
-
if(Mage::getStoreConfig(self::XML_SECURE_KEY) == $secureKey) {
|
305 |
-
|
306 |
-
$collection = Mage::getModel('pushnotification/pushnotification')->getCollection()
|
307 |
-
//->addAttributeToSelect('*')
|
308 |
-
->addFieldToFilter(
|
309 |
-
array(
|
310 |
-
array('attribute'=>'create_date','eq'=>$prev_date),
|
311 |
-
array('attribute'=>'device_type', 'eq'=>'1')
|
312 |
-
)
|
313 |
-
);
|
314 |
-
$collection->printLogQuery(true);
|
315 |
-
print_r($collection); die;
|
316 |
-
} else {
|
317 |
-
$array['status'] = "false";
|
318 |
-
$array['message'] = "invalid secure key";
|
319 |
-
echo json_encode($array);
|
320 |
-
}
|
321 |
-
|
322 |
-
}
|
323 |
-
catch (Exception $e) {
|
324 |
-
$array['status'] = 'false';
|
325 |
-
echo json_encode($array);
|
326 |
-
|
327 |
-
}
|
328 |
-
}
|
329 |
-
|
330 |
-
public function getAppDataAction() {
|
331 |
-
|
332 |
-
$array = array();
|
333 |
-
$encodeKey = $this->getRequest()->getParam('mms_id');
|
334 |
-
$secureKey = base64_decode($encodeKey);
|
335 |
-
//print_r($secureKey); die('test');
|
336 |
-
$current_date =date("Y-m-d");
|
337 |
-
$prev_date = date('Y-m-d', strtotime($current_date.' -1 day'));
|
338 |
-
|
339 |
-
try {
|
340 |
-
if(Mage::getStoreConfig(self::XML_SECURE_KEY) == $secureKey) {
|
341 |
-
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
|
342 |
-
$sql = "Select Count(*) AS 'total_count' from notification where `create_date`='".$prev_date."' ";
|
343 |
-
|
344 |
-
$total_count = $connection->fetchAll($sql);
|
345 |
-
foreach ($total_count as $key => $value) {
|
346 |
-
$array['total_count'] = $value['total_count'];
|
347 |
-
}
|
348 |
-
|
349 |
-
$sql = "Select Count(*) AS 'ios_count' from notification where `create_date`='".$prev_date."' AND `device_type` =1 ";
|
350 |
-
$ios_count = $connection->fetchAll($sql);
|
351 |
-
foreach ($ios_count as $key => $value) {
|
352 |
-
$array['ios_count'] = $value['ios_count'];
|
353 |
-
}
|
354 |
-
|
355 |
-
$sql = "Select Count(*) AS 'android_count' from notification where `create_date`='".$prev_date."' AND `device_type` =0";
|
356 |
-
$android_count = $connection->fetchAll($sql);
|
357 |
-
|
358 |
-
foreach ($android_count as $key => $value) {
|
359 |
-
$array['android_count'] = $value['android_count'];
|
360 |
-
}
|
361 |
-
$array['date'] = $prev_date;
|
362 |
-
$array['status']=true;
|
363 |
-
|
364 |
-
echo json_encode($array);
|
365 |
-
} else {
|
366 |
-
$array['status'] = "false";
|
367 |
-
$array['message'] = "invalid secure key";
|
368 |
-
echo json_encode($array);
|
369 |
-
}
|
370 |
-
|
371 |
-
}
|
372 |
-
catch (Exception $e) {
|
373 |
-
echo json_encode('false');
|
374 |
-
|
375 |
-
}
|
376 |
-
}
|
377 |
-
|
378 |
-
public function getVersionAction(){
|
379 |
-
|
380 |
-
return Mage::getConfig()->getModuleConfig("Mss_Connector")->version;
|
381 |
-
}
|
382 |
}
|
255 |
|
256 |
|
257 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
}
|
app/code/local/Mss/Connector/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Mss_Connector>
|
5 |
-
<version>2.
|
6 |
</Mss_Connector>
|
7 |
</modules>
|
8 |
<frontend>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Mss_Connector>
|
5 |
+
<version>2.4.0</version>
|
6 |
</Mss_Connector>
|
7 |
</modules>
|
8 |
<frontend>
|
app/code/local/Mss/Pushnotification/Helper/Data.php
CHANGED
@@ -173,9 +173,6 @@ class Mss_Pushnotification_Helper_Data extends Mage_Core_Helper_Abstract
|
|
173 |
->addFieldToFilter('registration_id',array(eq=>$notification['registration_id']));
|
174 |
|
175 |
if(!$filter->count()):
|
176 |
-
$notification['create_date'] = Mage::getModel('core/date')->date('Y-m-d');
|
177 |
-
$notification['update_date'] = Mage::getModel('core/date')->date('Y-m-d');
|
178 |
-
$notification['app_status'] = 1;
|
179 |
$collection->setData($notification)->save();
|
180 |
endif;
|
181 |
|
173 |
->addFieldToFilter('registration_id',array(eq=>$notification['registration_id']));
|
174 |
|
175 |
if(!$filter->count()):
|
|
|
|
|
|
|
176 |
$collection->setData($notification)->save();
|
177 |
endif;
|
178 |
|
app/code/local/Mss/Pushnotification/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Mss_Pushnotification>
|
5 |
-
<version>0.1.
|
6 |
</Mss_Pushnotification>
|
7 |
</modules>
|
8 |
<adminhtml>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Mss_Pushnotification>
|
5 |
+
<version>0.1.6</version>
|
6 |
</Mss_Pushnotification>
|
7 |
</modules>
|
8 |
<adminhtml>
|
app/design/adminhtml/default/default/layout/connector.xml
CHANGED
@@ -10,10 +10,4 @@
|
|
10 |
<block type="connector/adminhtml_support" name="connector_support" template="connector/support.phtml"/>
|
11 |
</reference>
|
12 |
</connector_adminhtml_support_support>
|
13 |
-
|
14 |
-
<connector_adminhtml_support_landing>
|
15 |
-
<reference name="content">
|
16 |
-
<block type="connector/adminhtml_support" name="connector_support" template="connector/landing.phtml"/>
|
17 |
-
</reference>
|
18 |
-
</connector_adminhtml_support_landing>
|
19 |
</layout>
|
10 |
<block type="connector/adminhtml_support" name="connector_support" template="connector/support.phtml"/>
|
11 |
</reference>
|
12 |
</connector_adminhtml_support_support>
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
</layout>
|
app/design/adminhtml/default/default/template/connector/landing.phtml
CHANGED
@@ -1,7 +1,11 @@
|
|
|
|
|
|
|
|
1 |
<script>
|
2 |
function showResult()
|
3 |
{
|
4 |
-
window.location.href = 'https://www.magentomobileshop.com/user';
|
|
|
5 |
}
|
6 |
</script>
|
7 |
|
1 |
+
<?php $secure_key = Mage::getStoreConfig('magentomobileshop/secure/key');
|
2 |
+
$decode = base64_encode($secure_key);
|
3 |
+
?>
|
4 |
<script>
|
5 |
function showResult()
|
6 |
{
|
7 |
+
//window.location.href = 'https://www.magentomobileshop.com/user';
|
8 |
+
window.location.href = 'http://mastersoftwaretechnologies.com/magentomobilecart/user/activating-app?app=<?php echo $decode; ?>';
|
9 |
}
|
10 |
</script>
|
11 |
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Mss_Connector</name>
|
4 |
-
<version>2.
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL v1.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Mobile Multi store app for Android and Iphone</summary>
|
10 |
<description>Mobile Multistore app for Android and Iphone</description>
|
11 |
-
<notes>
|
12 |
<authors><author><name>mss</name><user>mss</user><email>mss.yogendra@gmail.com</email></author></authors>
|
13 |
-
<date>2016-06-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magelocal"><dir name="Mss"><dir name="Bannerslider"><dir name="Block"><dir name="Adminhtml"><dir name="Bannerslider"><dir name="Edit"><file name="Form.php" hash="e3aac16542691916765e57238b3679a5"/><dir name="Tab"><file name="Form.php" hash="2aa3ba5ce44ad1ce15393b208008a4f4"/></dir><file name="Tabs.php" hash="d9421ac78bfe2f678b7514e6eea19ade"/></dir><file name="Edit.php" hash="9bca5bea62d4cedb8e458022fa683f92"/><file name="Grid.php" hash="8243e69694f860a3be9b4b2447b04843"/><dir name="Helper"><file name="Image.php" hash="f468b25e5344015483e0519da10bdd43"/></dir></dir><file name="Grid.php" hash="fbf2ede9f191ff040fa7b21e98ac440d"/><dir name="Renderer"><file name="Image.php" hash="451a2fc188826a8cbaee1ea6fc692435"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="2943733d060971766ca6d5f9498024fb"/></dir><dir name="Model"><file name="Bannerslider.php" hash="cd768d1bc28ed0a4c1d65d148252227d"/><dir name="Mysql4"><dir name="Bannerslider"><file name="Collection.php" hash="564694cc9b21e2e0a3c5202a6cc2eb99"/></dir><file name="Bannerslider.php" hash="46fc65447f3e41dbbe6194ddf9395e45"/></dir><file name="Observer.php" hash="b3bfac53fe96e0b10ddfeb8eed5bafd0"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BannersliderController.php" hash="18ac4e1526c5c1e34a8e2459ef051b25"/></dir><file name="BannerController.php" hash="6dd6b9f224e8368a0250b9b5af763607"/></dir><dir name="etc"><file name="adminhtml.xml" hash="31787cf6a7b306a7fbc8522d8933473c"/><file name="config.xml" hash="34154e2434504e7c0769776199a2cc82"/></dir><dir name="sql"><dir name="bannerslider_setup"><file name="mysql4-install-0.1.0.php" hash="d668f47b50c8910ad91e802afc718ba7"/></dir></dir></dir><dir name="Connector"><dir name="Block"><dir name="Adminhtml"><file name="Notifications.php" hash="6f24014b5a24a4f56410e9754b8aa2d5"/><file name="Support.php" hash="d120e7f8945a01d791d0f3d2c32dcfcf"/></dir><dir name="System"><dir name="Config"><file name="About.php" hash="2e9dc040ee2d42a57d5c9411f0b999e4"/><file name="Authorizenet.php" hash="ed644e9814fef74147bdddf24cfd75c1"/><file name="Banktransfer.php" hash="77f6ebf2074462cdadf4bccbe2f0d19a"/><file name="Checkmo.php" hash="edfc0fc0b233cd349392e563eeac57ed"/><file name="Cod.php" hash="37d1757764340fd02b8be7ac32434967"/><file name="Mpaypal.php" hash="e69d6a2d58618cf741d4cf503ede70ca"/><file name="Payu.php" hash="d0307013bdf58700a29aa7838ee94e51"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.0</min><max>7.0.5</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Mss_Connector</name>
|
4 |
+
<version>2.4.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL v1.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Mobile Multi store app for Android and Iphone</summary>
|
10 |
<description>Mobile Multistore app for Android and Iphone</description>
|
11 |
+
<notes>We have updated advanced functionality for Shipping</notes>
|
12 |
<authors><author><name>mss</name><user>mss</user><email>mss.yogendra@gmail.com</email></author></authors>
|
13 |
+
<date>2016-06-06</date>
|
14 |
+
<time>14:28:12</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Mss"><dir name="Bannerslider"><dir name="Block"><dir name="Adminhtml"><dir name="Bannerslider"><dir name="Edit"><file name="Form.php" hash="e3aac16542691916765e57238b3679a5"/><dir name="Tab"><file name="Form.php" hash="2aa3ba5ce44ad1ce15393b208008a4f4"/></dir><file name="Tabs.php" hash="d9421ac78bfe2f678b7514e6eea19ade"/></dir><file name="Edit.php" hash="9bca5bea62d4cedb8e458022fa683f92"/><file name="Grid.php" hash="8243e69694f860a3be9b4b2447b04843"/><dir name="Helper"><file name="Image.php" hash="f468b25e5344015483e0519da10bdd43"/></dir></dir><file name="Grid.php" hash="fbf2ede9f191ff040fa7b21e98ac440d"/><dir name="Renderer"><file name="Image.php" hash="451a2fc188826a8cbaee1ea6fc692435"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="2943733d060971766ca6d5f9498024fb"/></dir><dir name="Model"><file name="Bannerslider.php" hash="cd768d1bc28ed0a4c1d65d148252227d"/><dir name="Mysql4"><dir name="Bannerslider"><file name="Collection.php" hash="564694cc9b21e2e0a3c5202a6cc2eb99"/></dir><file name="Bannerslider.php" hash="46fc65447f3e41dbbe6194ddf9395e45"/></dir><file name="Observer.php" hash="b3bfac53fe96e0b10ddfeb8eed5bafd0"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BannersliderController.php" hash="18ac4e1526c5c1e34a8e2459ef051b25"/></dir><file name="BannerController.php" hash="6dd6b9f224e8368a0250b9b5af763607"/></dir><dir name="etc"><file name="adminhtml.xml" hash="31787cf6a7b306a7fbc8522d8933473c"/><file name="config.xml" hash="34154e2434504e7c0769776199a2cc82"/></dir><dir name="sql"><dir name="bannerslider_setup"><file name="mysql4-install-0.1.0.php" hash="d668f47b50c8910ad91e802afc718ba7"/></dir></dir></dir><dir name="Connector"><dir name="Block"><dir name="Adminhtml"><file name="Notifications.php" hash="6f24014b5a24a4f56410e9754b8aa2d5"/><file name="Support.php" hash="d120e7f8945a01d791d0f3d2c32dcfcf"/></dir><dir name="System"><dir name="Config"><file name="About.php" hash="2e9dc040ee2d42a57d5c9411f0b999e4"/><file name="Authorizenet.php" hash="ed644e9814fef74147bdddf24cfd75c1"/><file name="Banktransfer.php" hash="77f6ebf2074462cdadf4bccbe2f0d19a"/><file name="Checkmo.php" hash="edfc0fc0b233cd349392e563eeac57ed"/><file name="Cod.php" hash="37d1757764340fd02b8be7ac32434967"/><file name="Mpaypal.php" hash="e69d6a2d58618cf741d4cf503ede70ca"/><file name="Payu.php" hash="d0307013bdf58700a29aa7838ee94e51"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="b51ae561a28511678a7092f94641240b"/></dir><dir name="Model"><file name="Connector.php" hash="e9a927bc0a5974d092ab3af257ee7607"/><dir name="Mysql4"><dir name="Connector"><file name="Collection.php" hash="1f3bb37f160abdf974859f7419a19b65"/></dir><file name="Connector.php" hash="185189264d3275af813349e721ee46fb"/></dir><file name="Observer.php" hash="1e0e34bb8a94b77cb139940dab6f8b38"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="SupportController.php" hash="1feb0faebb6103e8c45a0b831fa16466"/></dir><file name="CartController.php" hash="b92585690963c1267f905d47e56285c9"/><file name="CreditController.php" hash="a489dd0ed95914fb2b58491410f6f92f"/><file name="CustomerController.php" hash="903d8094cccd3ee4d1360c422d1d5929"/><file name="FeedbackController.php" hash="2b9e092984c0c64397cd25fe1d2266d5"/><file name="IndexController.php" hash="4990dde9ef192c497ab98711e88e8925"/><file name="ItemsController.php" hash="bbf85a2f1514ce73e4c0858ebf7d26f9"/><file name="ProductsController.php" hash="738830c361f7da0dc885cee01acde60c"/><file name="StaticpagesController.php" hash="5767e970653233d769acbe28ce88c4b4"/><file name="StoreinfoController.php" hash="30822190e5b65e119e22e055219aaa8f"/><file name="TokenController.php" hash="ebbb672b1587c84ed914cd67bd7dc529"/><file name="WishlistController.php" hash="082445ed48fde71569305aba02177337"/></dir><dir name="etc"><file name="adminhtml.xml" hash="dace418dcc6eee76831169b5c70176e7"/><file name="config.xml" hash="764a279d6fd53c879be83da8c83b7ebf"/><file name="system.xml" hash="09be5e92b65afa6e91d062b3f7082e57"/></dir><dir name="sql"><dir name="connector_setup"><file name="mysql4-install-0.1.0.php" hash="4325ba30b21f9680b11d4b124b9e8181"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="eaa00e880b38ba41580b67785b33ed10"/></dir></dir></dir><dir name="Mpaypal"><dir name="Helper"><file name="Data.php" hash="c3ba57e7cc86210346b1b3f279083c0f"/></dir><dir name="Model"><file name="Mpaypal.php" hash="f49b32aad7d7bed49333534139fd07b7"/><file name="Observer.php" hash="4b92aaf547f0b080d8495cf064574d10"/></dir><dir name="controllers"><file name="IndexController.php" hash="c12439366cff0f0d0813543a2fd90f7f"/></dir><dir name="etc"><file name="config.xml" hash="9ed76ff53b5e0232b4ea442a7e046b14"/><file name="system.xml" hash="2f51ad686858a69e07e8c21baf5d690e"/></dir></dir><dir name="Payu"><dir name="Block"><file name="Index.php" hash="f6a324c1ac4b0c1dcfac775c51c2a34c"/></dir><dir name="Helper"><file name="Data.php" hash="7800e0e58258b78d0f23a7fec482d120"/></dir><dir name="controllers"><file name="IndexController.php" hash="b5254620aaf3913b8639555413d36a26"/></dir><dir name="etc"><file name="config.xml" hash="c6867fb0cc7efdde39c32a3ecbf62433"/></dir></dir><dir name="Pushnotification"><dir name="Block"><dir name="Adminhtml"><file name="Pushnotificationbackend.php" hash="6b9e143ee7b5fe4fc2642eee977b44bf"/></dir></dir><dir name="Helper"><file name="Data.php" hash="c60f7196c3b01881dfe079aec2fad39f"/></dir><dir name="Model"><dir name="Entity"><file name="Resource.php" hash="93b6a261762541433fa601aefb60d0a7"/></dir><dir name="Mysql4"><dir name="Pushnotification"><file name="Collection.php" hash="392612adedcb14ec5dcaaa4ea9858091"/></dir><file name="Pushnotification.php" hash="77f6cadb7682377a1de6b275310c1cf6"/></dir><file name="Pushnotification.php" hash="ad5fe0f74049c61402ff99fc32d8164a"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="File.php" hash="d7c74e49b78bb9da3453bd5f414a445f"/><file name="Image.php" hash="e1d98dbf511fe16581b37a8b7b43f5b4"/><file name="Iosmode.php" hash="ff1794ef4844019b7af64192fbd4e122"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="PushnotificationbackendController.php" hash="ec4ebd0ad1cfee78d2e67a69698a14e5"/></dir></dir><dir name="etc"><file name="config.xml" hash="f62215f94167b81c5f73aea794a334c4"/><file name="system.xml" hash="23a622dec8250a355bbaed9e83f1f82d"/></dir><dir name="sql"><dir name="pushnotification_setup"><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="418e997bb72afa725389593d4ca2f111"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="e5939f147e797d9d8b7a9643f8cda7d8"/></dir></dir></dir><dir name="Sociallogin"><dir name="Helper"><file name="Data.php" hash="8965f0b6a0127d0965d99987aa0a300c"/></dir><dir name="Model"><dir name="Mysql4"><file name="Sociallogin.php" hash="b881bc47c5ee70b1c4c02b59501ffbc5"/></dir><file name="Sociallogin.php" hash="0ba90dadb0f34528c2296704c5cea233"/></dir><dir name="etc"><file name="config.xml" hash="eac1dc2364bc283a9cd5326eb7e852a9"/></dir><dir name="sql"><dir name="sociallogin_setup"><file name="mysql4-install-0.1.0.php" hash="163332cb130dae297af332cbefde58f3"/></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="pushnotification"><file name="pushnotificationbackend.phtml" hash="138add7171fdd7fb326abc4a4f9dbe5a"/></dir><dir name="connector"><file name="landing.phtml" hash="c74d8592d0f5b874ca29ef22f3873054"/><file name="notification.phtml" hash="164e5f9e7dcfc5c2d2451f0e77776d77"/><file name="support.phtml" hash="7c799c058795eafbf96239e16e3326ca"/><file name="landing.phtml" hash="c74d8592d0f5b874ca29ef22f3873054"/><file name="notification.phtml" hash="164e5f9e7dcfc5c2d2451f0e77776d77"/><file name="support.phtml" hash="7c799c058795eafbf96239e16e3326ca"/></dir></dir><dir name="layout"><file name="bannerslider.xml" hash="a5a76f30bbedca5804646d53e783cdac"/><file name="pushnotification.xml" hash="f7fd974e63c4c7eb5ffac7b059470946"/><file name="connector.xml" hash="94731fdd2e7e65ea3ad14bedf43e993b"/><file name="connector.xml" hash="94731fdd2e7e65ea3ad14bedf43e993b"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="payu.xml" hash="473595488f536cb588c5588a744915a3"/><file name="mpaypal.xml" hash="7b75c5bed6f3142c8bc9e4c1233bf1e9"/></dir><dir name="template"><dir name="payu"><file name="index.phtml" hash="5f54a8eb245364534e7695b1a8fcbf30"/><file name="test.phtml" hash="da4701ff5b2c64444a49f77571e8a00c"/></dir><dir name="mpaypal"><file name="index.phtml" hash="df077c063b2006b9321c96cd6744b19f"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Mss_Bannerslider.xml" hash="7d03ee71d8e860c51478aff5200b0deb"/><file name="Mss_Connector.xml" hash="ba8a5609c9c8c3636f183c5bfe04d664"/><file name="Mss_Payu.xml" hash="5feac03d698b481473223fbe6a8814b1"/><file name="Mss_Pushnotification.xml" hash="2e8e9bc56a5f0ff8bb42f43fb5a3a3db"/><file name="Mss_Sociallogin.xml" hash="8671199bdad3bdecbfe0c47ce9ff05e6"/><file name="Mss_Mpaypal.xml" hash="4d6a7f8d862de8c449b1366727ef0a6d"/></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="magentomobileshop"><file name="magentomobileshop_loader.gif" hash="453272c9cacd32efe6465961ea8a61dd"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="magentomobileshop"><file name="magento_logo.png" hash="d1800a3c95de49500f158bfb6ca9c70c"/></dir></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.0</min><max>7.0.5</max></php></required></dependencies>
|
18 |
</package>
|