Version Notes
Add Shipping estimate cost feature.
Download this release
Release Info
Developer | mss |
Extension | Mss_Connector |
Version | 2.2.0 |
Comparing to | |
See all releases |
Code changes from version 2.1.0 to 2.2.0
app/code/local/Mss/Connector/controllers/CartController.php
CHANGED
@@ -22,7 +22,7 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
22 |
$this->viewId = Mage::app()->getFrontController()->getRequest()->getHeader('viewId');
|
23 |
$this->currency = Mage::app()->getFrontController()->getRequest()->getHeader('currency');
|
24 |
|
25 |
-
Mage::app()->setCurrentStore($this->
|
26 |
|
27 |
parent::_construct();
|
28 |
|
@@ -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->__("
|
411 |
));
|
412 |
return false;
|
413 |
}
|
@@ -481,47 +481,59 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
481 |
$addressId = $this->getRequest()->getParam('address_id');
|
482 |
$countryId = $this->getRequest()->getParam('country_id');
|
483 |
$setRegionId = $this->getRequest()->getParam('region_id');
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
} else {
|
515 |
-
|
516 |
-
|
517 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
518 |
}
|
519 |
-
$quote->save();
|
520 |
-
$quote->getShippingAddress()->setShippingMethod('flatrate_flatrate')->save();
|
521 |
-
$amount=$quote->getShippingAddress();
|
522 |
-
$shipping_amount = $amount['shipping_incl_tax'];
|
523 |
-
return $shipping_amount;
|
524 |
-
}
|
525 |
}
|
526 |
|
527 |
protected function _getCartInformation() {
|
@@ -893,15 +905,14 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
893 |
|
894 |
|
895 |
$session = Mage::getSingleton ( 'customer/session' );
|
896 |
-
$customerId=$session->getId();
|
897 |
-
|
898 |
-
|
899 |
|
900 |
##Get current quote
|
901 |
$totalItems = Mage::helper('checkout/cart')->getSummaryCount();
|
902 |
|
903 |
if($totalItems > 0):
|
904 |
-
#get the addressid
|
|
|
905 |
$addressId=(int)$this->getRequest()->getParam('addressid');
|
906 |
$shipping_method=$this->getRequest()->getParam('shippingmethod');
|
907 |
$paymentmethod=$this->getRequest()->getParam('paymentmethod');
|
@@ -909,8 +920,6 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
909 |
$card_details = $this->getRequest()->getParam('cards_details');
|
910 |
$save_cc = $this->getRequest()->getParam('save_cc');
|
911 |
|
912 |
-
|
913 |
-
|
914 |
if($paymentmethod == 'authorizenet')
|
915 |
$this->validateCarddtails(json_decode($card_details,1));
|
916 |
|
@@ -991,6 +1000,7 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
991 |
|
992 |
$result=array( 'message'=>$this->__('Order placed successfully.'),
|
993 |
'orderid'=>$order->getIncrementId(),
|
|
|
994 |
'result'=>'success'
|
995 |
|
996 |
);
|
@@ -1282,6 +1292,7 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
1282 |
public function getcheckoutcartAction(){
|
1283 |
$customerId =(int)$this->getRequest()->getParam('customerid');
|
1284 |
|
|
|
1285 |
if ($customerId) {
|
1286 |
|
1287 |
$customer = Mage::getModel('customer/customer')->load($customerId);
|
@@ -1289,7 +1300,7 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
1289 |
$cart = Mage::getModel('sales/quote') ->loadByCustomer($customer);
|
1290 |
|
1291 |
if(!count($cart->getAllItems())):
|
1292 |
-
echo json_encode(array('status'=>'success','message'=> $
|
1293 |
exit;
|
1294 |
endif;
|
1295 |
$product_model = Mage::getModel ( 'catalog/product' );
|
@@ -1297,8 +1308,7 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
1297 |
$baseCurrency = Mage::app ()->getStore ()->getBaseCurrency ()->getCode ();
|
1298 |
$currentCurrency = $this->currency;
|
1299 |
|
1300 |
-
foreach ($cart->getAllVisibleItems() as $item) {
|
1301 |
-
|
1302 |
$productName= array();
|
1303 |
$productName['cart_item_id'] = $item->getId();
|
1304 |
$productName['id'] = $item->getProductId();
|
@@ -1327,12 +1337,12 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
1327 |
$product['totalitems'] = $cart->getItemsCount();
|
1328 |
$product['symbol'] = Mage::helper('connector')->getCurrencysymbolByCode($this->currency);
|
1329 |
|
1330 |
-
echo json_encode(array('status'=>'success','message'=> $
|
1331 |
|
1332 |
}
|
1333 |
catch(exception $e)
|
1334 |
{
|
1335 |
-
echo json_encode(array('status'=>'error','message'=> $
|
1336 |
}
|
1337 |
}
|
1338 |
else {
|
@@ -1348,6 +1358,7 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
1348 |
$items = $quote->getAllVisibleItems ();
|
1349 |
$cartItemArr='';
|
1350 |
foreach ( $items as $item ){
|
|
|
1351 |
$productName= array();
|
1352 |
$productName['cart_item_id'] = $item->getId();
|
1353 |
$productName['id'] = $item->getProductId();
|
22 |
$this->viewId = Mage::app()->getFrontController()->getRequest()->getHeader('viewId');
|
23 |
$this->currency = Mage::app()->getFrontController()->getRequest()->getHeader('currency');
|
24 |
|
25 |
+
Mage::app()->setCurrentStore(Mage::app()->getStore($this->viewId));
|
26 |
|
27 |
parent::_construct();
|
28 |
|
407 |
{
|
408 |
echo json_encode ( array (
|
409 |
'status' => 'error',
|
410 |
+
'message' => $this->__("Coupon code Is not Valid" )
|
411 |
));
|
412 |
return false;
|
413 |
}
|
481 |
$addressId = $this->getRequest()->getParam('address_id');
|
482 |
$countryId = $this->getRequest()->getParam('country_id');
|
483 |
$setRegionId = $this->getRequest()->getParam('region_id');
|
484 |
+
$shipping_method = $this->getRequest()->getParam('shippingmethod');
|
485 |
+
if (isset($addressId)){
|
486 |
+
$customer = Mage::getModel('customer/address')
|
487 |
+
->load($addressId);
|
488 |
+
$countryId = $customer['country_id'];
|
489 |
+
$setRegionId = $customer['region_id'];
|
490 |
+
$regionName = $customer['region'];
|
491 |
+
$quote=Mage::getSingleton ( 'checkout/cart' )->getQuote();
|
492 |
+
|
493 |
+
$shippingCheck = $quote->getShippingAddress()->getData();
|
494 |
+
if($shippingCheck['shipping_method'] != $shipping_method) {
|
495 |
+
if (isset($setRegionId)){
|
496 |
+
$quote->getShippingAddress()
|
497 |
+
->setCountryId($countryId)
|
498 |
+
->setRegionId($setRegionId)
|
499 |
+
->setCollectShippingRates(true);
|
500 |
+
} else {
|
501 |
+
$quote->getShippingAddress()
|
502 |
+
->setCountryId($countryId)
|
503 |
+
->setRegion($regionName)
|
504 |
+
->setCollectShippingRates(true);
|
505 |
+
}
|
506 |
+
$quote->save();
|
507 |
+
$quote->getShippingAddress()->setShippingMethod($shipping_method.'_'.$shipping_method)->save();
|
508 |
+
}
|
509 |
+
|
510 |
+
$quote->collectTotals ()->save ();
|
511 |
+
$amount=$quote->getShippingAddress()->getData();
|
512 |
+
$shipping_amount = $amount['shipping_incl_tax'];
|
513 |
+
return $shipping_amount;
|
514 |
} else {
|
515 |
+
$quote=Mage::getSingleton ( 'checkout/cart' )->getQuote();
|
516 |
+
$shippingCheck = $quote->getShippingAddress()->getData();
|
517 |
+
|
518 |
+
if($shippingCheck['shipping_method'] != $shipping_method) {
|
519 |
+
if (isset($setRegionId)){
|
520 |
+
$quote->getShippingAddress()
|
521 |
+
->setCountryId($countryId)
|
522 |
+
->setRegionId($setRegionId)
|
523 |
+
->setCollectShippingRates(true);
|
524 |
+
} else {
|
525 |
+
$quote->getShippingAddress()
|
526 |
+
->setCountryId($countryId)
|
527 |
+
->setCollectShippingRates(true);
|
528 |
+
}
|
529 |
+
$quote->save();
|
530 |
+
$quote->getShippingAddress()->setShippingMethod($shipping_method.'_'.$shipping_method)->save();
|
531 |
+
}
|
532 |
+
$quote->collectTotals ()->save ();
|
533 |
+
$amount=$quote->getShippingAddress();
|
534 |
+
$shipping_amount = $amount['shipping_incl_tax'];
|
535 |
+
return $shipping_amount;
|
536 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
537 |
}
|
538 |
|
539 |
protected function _getCartInformation() {
|
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 |
$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 |
|
1000 |
|
1001 |
$result=array( 'message'=>$this->__('Order placed successfully.'),
|
1002 |
'orderid'=>$order->getIncrementId(),
|
1003 |
+
'result'=>'success',
|
1004 |
'result'=>'success'
|
1005 |
|
1006 |
);
|
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 |
$cart = Mage::getModel('sales/quote') ->loadByCustomer($customer);
|
1301 |
|
1302 |
if(!count($cart->getAllItems())):
|
1303 |
+
echo json_encode(array('status'=>'success','message'=> $product));
|
1304 |
exit;
|
1305 |
endif;
|
1306 |
$product_model = Mage::getModel ( 'catalog/product' );
|
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();
|
1337 |
$product['totalitems'] = $cart->getItemsCount();
|
1338 |
$product['symbol'] = Mage::helper('connector')->getCurrencysymbolByCode($this->currency);
|
1339 |
|
1340 |
+
echo json_encode(array('status'=>'success','message'=> $product));
|
1341 |
|
1342 |
}
|
1343 |
catch(exception $e)
|
1344 |
{
|
1345 |
+
echo json_encode(array('status'=>'error','message'=> $e->getMessage()));
|
1346 |
}
|
1347 |
}
|
1348 |
else {
|
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();
|
app/code/local/Mss/Connector/controllers/CustomerController.php
CHANGED
@@ -54,15 +54,17 @@ 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 |
$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,12 +78,15 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
76 |
|
77 |
|
78 |
$session = Mage::getSingleton ( 'customer/session' );
|
79 |
-
|
|
|
80 |
$session->logout ();
|
81 |
}
|
82 |
$username = Mage::app ()->getRequest ()->getParam ( 'username' );
|
83 |
-
|
84 |
-
|
|
|
|
|
85 |
try {
|
86 |
if (!$session->login ( $username, $password )) {
|
87 |
echo json_encode(array('status' => 'error','message'=> $this->__('wrong username or password.')));
|
@@ -396,7 +401,7 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
396 |
$id=(int)$this->getRequest()->getParam('addressid');
|
397 |
|
398 |
|
399 |
-
$address=Mage::getModel('customer/address')->load($id);
|
400 |
|
401 |
if($address->getId()):
|
402 |
|
@@ -449,7 +454,8 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
449 |
#loop to create the array
|
450 |
foreach ($customer->getAddresses() as $address)
|
451 |
{
|
452 |
-
|
|
|
453 |
|
454 |
'id'=>$address->getId(),
|
455 |
'firstname'=>$address->getFirstname(),
|
@@ -457,8 +463,10 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
457 |
'street'=>$address->getStreet1().''.$address->getStreet2(),
|
458 |
'city'=>$address->getCity(),
|
459 |
// 'country_id'=>$address->getCountryId(),
|
460 |
-
|
461 |
-
|
|
|
|
|
462 |
'postcode'=>$address->getPostcode(),
|
463 |
'telephone'=>$address->getTelephone(),
|
464 |
'fax'=>$address->getFax(),
|
@@ -466,6 +474,17 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
466 |
|
467 |
|
468 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
469 |
}
|
470 |
|
471 |
echo json_encode($customerAddress);
|
@@ -626,7 +645,7 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
626 |
|
627 |
}
|
628 |
|
629 |
-
$items = $order->
|
630 |
$itemcount=count($items);
|
631 |
$name=array();
|
632 |
$unitPrice=array();
|
@@ -650,7 +669,7 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
650 |
$sku=$item->getSku();
|
651 |
$ids=$item->getProductId();
|
652 |
//$qty[]=$item->getQtyToInvoice();
|
653 |
-
$qty= $item->getQtyOrdered();
|
654 |
$products = Mage::getModel('catalog/product')->load($item->getProductId());
|
655 |
$images= Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).'/media/catalog/product'.$products->getThumbnail();
|
656 |
|
@@ -658,17 +677,18 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
658 |
"name" => $name,
|
659 |
"sku" => $sku,
|
660 |
"id" => $ids,
|
661 |
-
"quantity" => $qty,
|
662 |
"unitprice" => $unitPrice,
|
663 |
"image" => $images,
|
664 |
"total_item_count" => $itemcount,
|
665 |
"price_org" => $test_p,
|
666 |
"price_based_curr" => 1,
|
667 |
);
|
|
|
668 |
|
669 |
} # item foreach close
|
670 |
|
671 |
-
|
672 |
|
673 |
$order_date = $order->getCreatedAtStoreDate().'';
|
674 |
$orderData = array(
|
@@ -686,14 +706,14 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
686 |
"products" => $productlist,
|
687 |
"order_currency" => $order->getOrderCurrencyCode(),
|
688 |
"order_currency_symbol" => Mage::app()->getLocale()->currency($order->getOrderCurrencyCode())->getSymbol(),
|
689 |
-
"currency" => $currency,
|
690 |
"couponUsed" => 0
|
691 |
);
|
692 |
$couponCode = $order->getCouponCode();
|
693 |
if($couponCode!="") {
|
694 |
$orderData["couponUsed"] = 1;
|
695 |
$orderData["couponCode"] = $couponCode;
|
696 |
-
$orderData["discount_amount"] = floatval(number_format($this->convert_currency(floatval($order->getDiscountAmount()),$basecurrencycode,$currency), 2, '.', ''))*-1;
|
697 |
}
|
698 |
|
699 |
$res["data"][] = $orderData;
|
@@ -726,7 +746,8 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
726 |
|
727 |
if(Mage::getSingleton('customer/session')->isLoggedIn()):
|
728 |
$info=array();
|
729 |
-
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
|
|
730 |
$info['firstname'] = $customer->getFirstname();
|
731 |
$info['lastname'] = $customer->getLastname();
|
732 |
$customerAddressId =$customer->getDefaultBilling();
|
@@ -849,6 +870,10 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
849 |
$addressId = $this->getRequest ()->getParam ('addressId');
|
850 |
$addressData = json_decode($this->getRequest ()->getParam ('addressData'),1);
|
851 |
|
|
|
|
|
|
|
|
|
852 |
$customer = Mage::getModel('customer/customer')->load(Mage::getSingleton ( 'customer/session' )->getCustomer()->getId());
|
853 |
$customer->setFirstname($addressData['firstname']);
|
854 |
$customer->setLastname ($addressData['lastname']);
|
@@ -939,4 +964,36 @@ class Mss_Connector_CustomerController extends Mage_Core_Controller_Front_Action
|
|
939 |
|
940 |
}
|
941 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
942 |
}
|
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 |
|
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 |
+
$password = Mage::app ()->getRequest ()->getParam ( 'password' );
|
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.')));
|
401 |
$id=(int)$this->getRequest()->getParam('addressid');
|
402 |
|
403 |
|
404 |
+
$address=Mage::getModel('customer/address')->load($id);
|
405 |
|
406 |
if($address->getId()):
|
407 |
|
454 |
#loop to create the array
|
455 |
foreach ($customer->getAddresses() as $address)
|
456 |
{
|
457 |
+
|
458 |
+
$address_array = array(
|
459 |
|
460 |
'id'=>$address->getId(),
|
461 |
'firstname'=>$address->getFirstname(),
|
463 |
'street'=>$address->getStreet1().''.$address->getStreet2(),
|
464 |
'city'=>$address->getCity(),
|
465 |
// 'country_id'=>$address->getCountryId(),
|
466 |
+
'country_name'=>Mage::getModel('directory/country')->loadByCode($address->getCountryId())->getName(),
|
467 |
+
'country_id'=>$address->getCountryId(),
|
468 |
+
|
469 |
+
//'region'=>$address->getRegion(),
|
470 |
'postcode'=>$address->getPostcode(),
|
471 |
'telephone'=>$address->getTelephone(),
|
472 |
'fax'=>$address->getFax(),
|
474 |
|
475 |
|
476 |
);
|
477 |
+
|
478 |
+
if ($address->getRegionId()) {
|
479 |
+
$address_array['region_id'] = $address->getRegionId();
|
480 |
+
$address_array['region'] = Mage::getModel('directory/region')->load($address->getRegionId())->getName();
|
481 |
+
|
482 |
+
} else {
|
483 |
+
$address_array['region'] = $address->getRegion();
|
484 |
+
}
|
485 |
+
|
486 |
+
|
487 |
+
$customerAddress[] = $address_array;
|
488 |
}
|
489 |
|
490 |
echo json_encode($customerAddress);
|
645 |
|
646 |
}
|
647 |
|
648 |
+
$items = $order->getAllVisibleItems();
|
649 |
$itemcount=count($items);
|
650 |
$name=array();
|
651 |
$unitPrice=array();
|
669 |
$sku=$item->getSku();
|
670 |
$ids=$item->getProductId();
|
671 |
//$qty[]=$item->getQtyToInvoice();
|
672 |
+
$qty= (int)$item->getQtyOrdered();
|
673 |
$products = Mage::getModel('catalog/product')->load($item->getProductId());
|
674 |
$images= Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).'/media/catalog/product'.$products->getThumbnail();
|
675 |
|
677 |
"name" => $name,
|
678 |
"sku" => $sku,
|
679 |
"id" => $ids,
|
680 |
+
"quantity" => (int)$qty,
|
681 |
"unitprice" => $unitPrice,
|
682 |
"image" => $images,
|
683 |
"total_item_count" => $itemcount,
|
684 |
"price_org" => $test_p,
|
685 |
"price_based_curr" => 1,
|
686 |
);
|
687 |
+
|
688 |
|
689 |
} # item foreach close
|
690 |
|
691 |
+
Mage::log(print_r( $productlist, true),null,'cust.log');
|
692 |
|
693 |
$order_date = $order->getCreatedAtStoreDate().'';
|
694 |
$orderData = array(
|
706 |
"products" => $productlist,
|
707 |
"order_currency" => $order->getOrderCurrencyCode(),
|
708 |
"order_currency_symbol" => Mage::app()->getLocale()->currency($order->getOrderCurrencyCode())->getSymbol(),
|
709 |
+
"currency" => $this->currency,
|
710 |
"couponUsed" => 0
|
711 |
);
|
712 |
$couponCode = $order->getCouponCode();
|
713 |
if($couponCode!="") {
|
714 |
$orderData["couponUsed"] = 1;
|
715 |
$orderData["couponCode"] = $couponCode;
|
716 |
+
$orderData["discount_amount"] = floatval(number_format($this->convert_currency(floatval($order->getDiscountAmount()),$basecurrencycode,$this->currency), 2, '.', ''))*-1;
|
717 |
}
|
718 |
|
719 |
$res["data"][] = $orderData;
|
746 |
|
747 |
if(Mage::getSingleton('customer/session')->isLoggedIn()):
|
748 |
$info=array();
|
749 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
750 |
+
|
751 |
$info['firstname'] = $customer->getFirstname();
|
752 |
$info['lastname'] = $customer->getLastname();
|
753 |
$customerAddressId =$customer->getDefaultBilling();
|
870 |
$addressId = $this->getRequest ()->getParam ('addressId');
|
871 |
$addressData = json_decode($this->getRequest ()->getParam ('addressData'),1);
|
872 |
|
873 |
+
if (!array_key_exists('region_id', $addressData)) {
|
874 |
+
$addressData['region_id'] = '';
|
875 |
+
}
|
876 |
+
|
877 |
$customer = Mage::getModel('customer/customer')->load(Mage::getSingleton ( 'customer/session' )->getCustomer()->getId());
|
878 |
$customer->setFirstname($addressData['firstname']);
|
879 |
$customer->setLastname ($addressData['lastname']);
|
964 |
|
965 |
}
|
966 |
|
967 |
+
/*Delete Address API*/
|
968 |
+
|
969 |
+
/*
|
970 |
+
URL : baseurl/restapi/customer/deleteAddress
|
971 |
+
Name : deleteAddress
|
972 |
+
Method : GET
|
973 |
+
Required fields : addressId*
|
974 |
+
Response : JSON
|
975 |
+
|
976 |
+
*/
|
977 |
+
|
978 |
+
public function deleteAddressAction()
|
979 |
+
{
|
980 |
+
$customer = Mage::getSingleton ( 'customer/session' );
|
981 |
+
$addressId = $this->getRequest ()->getParam ('addressId');
|
982 |
+
if (!$addressId) {
|
983 |
+
echo json_encode(array('status'=>'error','message'=>'Address Id is missing.'));
|
984 |
+
exit;
|
985 |
+
}
|
986 |
+
if ($customer->isLoggedIn()) {
|
987 |
+
$address = Mage::getModel('customer/address')->load($addressId);
|
988 |
+
$address->delete();
|
989 |
+
echo json_encode(array('status'=>'success','message'=>'Request complete.'));
|
990 |
+
exit;
|
991 |
+
|
992 |
+
} else {
|
993 |
+
echo json_encode(array('status'=>'error','message'=>'Login first.'));
|
994 |
+
exit;
|
995 |
+
}
|
996 |
+
|
997 |
+
}
|
998 |
+
|
999 |
}
|
app/code/local/Mss/Connector/controllers/StoreinfoController.php
CHANGED
@@ -139,6 +139,7 @@ class Mss_Connector_StoreinfoController extends Mage_Core_Controller_Front_Actio
|
|
139 |
public function getCurrentCurrencyAction() {
|
140 |
|
141 |
$codes = Mage::app()->getStore()->getAvailableCurrencyCodes(true);
|
|
|
142 |
|
143 |
if (is_array($codes) && count($codes) > 1):
|
144 |
$rates = Mage::getModel('directory/currency')->getCurrencyRates(
|
139 |
public function getCurrentCurrencyAction() {
|
140 |
|
141 |
$codes = Mage::app()->getStore()->getAvailableCurrencyCodes(true);
|
142 |
+
$currencies = array();
|
143 |
|
144 |
if (is_array($codes) && count($codes) > 1):
|
145 |
$rates = Mage::getModel('directory/currency')->getCurrencyRates(
|
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.2.0</version>
|
6 |
</Mss_Connector>
|
7 |
</modules>
|
8 |
<frontend>
|
package.xml
CHANGED
@@ -1,20 +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 Multistore app for Android and Iphone.</summary>
|
10 |
-
<description>Store owner can create Android, iPhone apps simply using this plugin. This plugin provide the integration API to create and connect mobile apps with the Magento store. Mobile App provides end user account management, product catalog browsing, CMS page content, shopping cart functionality , Notifications and fast checkout process
|
11 |
-
<notes>
|
12 |
-
1 ) Calculate Shipping estimate cost 
|
13 |
-
2 ) Improve price display including tax price</notes>
|
14 |
<authors><author><name>mss</name><user>mss</user><email>mss.yogendra@gmail.com</email></author></authors>
|
15 |
-
<date>2016-
|
16 |
-
<time>
|
17 |
-
<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="
|
18 |
<compatible/>
|
19 |
<dependencies><required><php><min>5.3.0</min><max>7.0.5</max></php></required></dependencies>
|
20 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Mss_Connector</name>
|
4 |
+
<version>2.2.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL v1.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Mobile Multistore app for Android and Iphone.</summary>
|
10 |
+
<description>Store owner can create Android, iPhone apps simply using this plugin. This plugin provide the integration API to create and connect mobile apps with the Magento store. Mobile App provides end user account management, product catalog browsing, CMS page content, shopping cart functionality , Notifications and fast checkout process .</description>
|
11 |
+
<notes>Add Shipping estimate cost feature.</notes>
|
|
|
|
|
12 |
<authors><author><name>mss</name><user>mss</user><email>mss.yogendra@gmail.com</email></author></authors>
|
13 |
+
<date>2016-05-20</date>
|
14 |
+
<time>04:40:47</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="094c8acb0af74e7a6acb90afed0288c5"/><file name="CreditController.php" hash="a489dd0ed95914fb2b58491410f6f92f"/><file name="CustomerController.php" hash="04d600021a1ba6bc1c6d84dd7f675c21"/><file name="FeedbackController.php" hash="2b9e092984c0c64397cd25fe1d2266d5"/><file name="IndexController.php" hash="4990dde9ef192c497ab98711e88e8925"/><file name="ItemsController.php" hash="bbf85a2f1514ce73e4c0858ebf7d26f9"/><file name="ProductsController.php" hash="28d783cd84dbf6e0bfe6a21cf40cd1a8"/><file name="StaticpagesController.php" hash="86bfe2d07268507d60c4ee3c8834de08"/><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="0b5e0068f0930a5a37f632f5df0ac4f8"/><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"/></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="notification.phtml" hash="164e5f9e7dcfc5c2d2451f0e77776d77"/><file name="support.phtml" hash="7c799c058795eafbf96239e16e3326ca"/><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></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.0</min><max>7.0.5</max></php></required></dependencies>
|
18 |
</package>
|