emizenmobileadmin - Version 1.0.4

Version Notes

You can Now Track you all the Magento Backend Activity Using our Emizentech Magento Mobile Apps . IT has very great feature API to display All the Sales Activity with Graph . You can now easily see all the Magento Orders Listing , Product Listing, Customer Listing .

Features :

* Wonderful View of your Sales with Days Filter Graph
* Sales Listing View with Details.
* Customer Listing View with Details
* Product Listing View With Details
* Store view Selection For Dashboard,
* Multistore Support

Download this release

Release Info

Developer Emizen Tech Private Limited
Extension emizenmobileadmin
Version 1.0.4
Comparing to
See all releases


Code changes from version 1.0.3 to 1.0.4

app/code/local/EmizenTech/MobileAdmin/controllers/ConfigurationController.php CHANGED
@@ -28,19 +28,13 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
28
  // Default countries Process
29
  $countryAcion['countries'] = Mage::getModel('directory/country')->getResourceCollection()->load()->toOptionArray(false);
30
 
31
- $countryAcion['selectedCountryValue'] = Mage::getStoreConfig('general/country/default', $storeId);
32
-
33
- //Mage::log($countryAcion['selectedCountryValue'],null,"cart_android.log");
34
-
35
- $countryAcion['selectedCountryLabel'] = Mage::getModel("directory/country")->load($countryAcion['selectedCountryValue'])->getName();
36
- //Mage::log($countryAcion['selectedCountryLabel'],null,"cart_android.log");
37
- $countryValue = $post_data['countryVal'];
38
- if(!empty($countryValue))
39
  {
40
  if($storeId == 0)
41
  {
42
- Mage::getConfig()->saveConfig('general/country/default', $countryValue);
43
- Mage::getConfig()->saveConfig('general/country/default', $countryValue, 'stores', $storeId);
44
  }
45
  else
46
  {
@@ -53,9 +47,38 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
53
  Mage::getConfig()->reinit();
54
  Mage::app()->reinitStores();
55
  }
 
 
 
 
 
 
 
56
 
57
 
58
  // Allow Countries Process
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  $allowCountriesSelectedValue = Mage::getStoreConfig('general/country/allow', $storeId);
60
  $explodedVal = explode(",", $allowCountriesSelectedValue);
61
  foreach ($explodedVal as $value)
@@ -82,33 +105,22 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
82
  $countryAcion['allowCountriesStatus'][] = $counVal;
83
  }
84
  }
85
- //Mage::log($countryAcion['allowCountriesStatus'],null,"cart_android.log");
86
- $allowCountriesValue = $post_data['allowCountryVal'];
87
- if(!empty($allowCountriesValue))
 
 
 
88
  {
89
- $csv = implode(",", $allowCountriesValue);
90
- // Mage::log($storeId,null,"cart_android.log");
91
- // Mage::log($csv,null,"cart_android.log");
92
  $config = Mage::getModel('core/config');
93
- //Mage::getConfig()->saveConfig('general/country/allow', $csv, 'default', $storeId);
94
- if($storeId == 0)
95
- {
96
- Mage::getConfig()->saveConfig('general/country/allow', $csv, 'default', $storeId);
97
- }
98
- else
99
- {
100
- Mage::getConfig()->saveConfig('general/country/allow', $csv, 'stores', $storeId);
101
- }
102
- $countryAcion['successMessage'] = "Allow Countries Has Been Saved On ".$storeName." Store.";
103
- //Mage::log($countryAcion['successMessage'],null,"cart_android.log");
104
  Mage::getConfig()->reinit();
105
  Mage::app()->reinitStores();
106
  }
107
-
108
-
109
-
110
- //Postal Code is Optional for the following countries Pocess
111
- $postalCodeSelectedValue = Mage::getStoreConfig('general/country/optional_zip_countries', $storeId);
112
  $postalExplodedVal = explode(",", $postalCodeSelectedValue);
113
  foreach ($postalExplodedVal as $value)
114
  {
@@ -133,21 +145,20 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
133
  }
134
  }
135
 
136
- $postalCountriesValue = $post_data['postalCountryVal'];
137
- if(!empty($postalCountriesValue))
 
 
 
138
  {
139
- $csv = implode(",", $postalCountriesValue);
140
  //Mage::log($csv,null,"cart_android.log");
141
- $config = Mage::getModel('core/config');
142
- Mage::getConfig()->saveConfig('general/country/optional_zip_countries', $csv, 'default', $storeId);
143
- $countryAcion['successMessage'] = "Postal Code Has Been Saved For The Following Countries On ".$storeName." Store.";
144
  Mage::getConfig()->reinit();
145
  Mage::app()->reinitStores();
146
  }
147
-
148
-
149
-
150
- //European Union Countries
151
  $unionCountriesValue = Mage::getStoreConfig('general/country/eu_countries', $storeId);
152
  $unionExplodedVal = explode(",", $unionCountriesValue);
153
  foreach ($unionExplodedVal as $value)
@@ -173,17 +184,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
173
  }
174
  }
175
 
176
- $unionCountriesValue = $post_data['unionCountryVal'];
177
- if(!empty($unionCountriesValue))
178
- {
179
- $csv = implode(",", $unionCountriesValue);
180
- //Mage::log($csv,null,"cart_android.log");
181
- //$config = Mage::getModel('core/config');
182
- Mage::getConfig()->saveConfig('general/country/eu_countries', $csv, 'default', $storeId);
183
- $countryAcion['successMessage'] = "European Union Countries Has Been Saved On ".$storeName." Store.";
184
- Mage::getConfig()->reinit();
185
- Mage::app()->reinitStores();
186
- }
187
 
188
  //echo "<pre>"; print_r($countryAcion); die;
189
  $jsonData = Mage::helper('core')->jsonEncode($countryAcion);
@@ -226,6 +226,19 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
226
  // State is required for
227
  $statesCountries = Mage::getModel('directory/country')->getResourceCollection()->load()->toOptionArray(false);
228
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  $statesValue = Mage::getStoreConfig('general/region/state_required','default');
230
  $statesExplodedVal = explode(",", $statesValue);
231
 
@@ -255,24 +268,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
255
  }
256
  }
257
 
258
- $statesCountriesValue = $post_data['statesCountryVal'];
259
- if(!empty($statesCountriesValue))
260
- {
261
- $csv = implode(",", $statesCountriesValue);
262
- //Mage::log($csv,null,"cart_android.log");
263
- //Mage::getConfig()->saveConfig('general/region/state_required', $csv, 'default', $storeId);
264
- Mage::getConfig()->saveConfig('general/region/state_required', $csv);
265
- $statesAcion['successMessage'] = "State Has Been Saved For The Following Countries On ".$storeName." Store.";
266
- Mage::getConfig()->reinit();
267
- Mage::app()->reinitStores();
268
- }
269
-
270
 
271
  // Display not required State
272
- $statesValueDisplay = Mage::getStoreConfig('general/region/display_all');
273
-
274
- $statesAcion['statesDsiplayVal'] = $statesValueDisplay;
275
-
276
  $statesReqValue = $post_data['statesReq'];
277
  if($statesReqValue == 0 || $statesReqValue == 1)
278
  {
@@ -283,6 +280,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
283
  Mage::app()->reinitStores();
284
  }
285
 
 
 
 
 
 
286
  //echo "<pre>"; print_r($statesExplodedVal); die;
287
  $jsonData = Mage::helper('core')->jsonEncode($statesAcion);
288
  return Mage::app()->getResponse()->setBody($jsonData);
@@ -325,6 +327,16 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
325
  // Timezone
326
  $timezones = Mage::getModel('core/locale')->getOptionTimezones();
327
  //$localeAction['timezones'] = $timezones;
 
 
 
 
 
 
 
 
 
 
328
  $timezoneValues = Mage::getStoreConfig('general/locale/timezone');
329
  //$localeAction['timezoneSelected'] = $timezoneValues;
330
  //echo "<pre>"; print_r($timezones); die;
@@ -347,16 +359,7 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
347
  }
348
  $localeAction['timezoneListSelected'] = $timezoneAnotherArr;
349
  // /echo $timezoneValues; die;
350
-
351
-
352
- $timezonesVal = $post_data['timezoneVal'];
353
- if(!empty($timezonesVal))
354
- {
355
- Mage::getConfig()->saveConfig('general/locale/timezone', $timezonesVal, 'default');
356
- $localeAction['successMessage'] = "Timezone Saved On ".$storeName." Store.";
357
- Mage::getConfig()->reinit();
358
- Mage::app()->reinitStores();
359
- }
360
 
361
 
362
 
@@ -388,6 +391,22 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
388
 
389
 
390
  // First day of week
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
391
  $weekDaySelected = Mage::getStoreConfig('general/locale/firstday', $storeId);
392
  //$weekDaySelected['slel'][] = Mage::getStoreConfig('general/locale/firstday');
393
 
@@ -412,26 +431,26 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
412
  }
413
  }
414
  $localeAction['weekDaysArr'] = $makeAnotherArr;
 
415
 
416
- $weekDayVal = $post_data['weekDays'];
417
- if(!empty($weekDayVal))
 
 
418
  {
 
419
  if($storeId == 0)
420
  {
421
- Mage::getConfig()->saveConfig('general/locale/firstday', $weekDayVal, 'default', $storeId);
422
  }
423
  else
424
  {
425
- Mage::getConfig()->saveConfig('general/locale/firstday', $weekDayVal, 'stores', $storeId);
426
  }
427
- $localeAction['successMessage'] = "First Day Of Week Saved On ".$storeName." Store.";
428
  Mage::getConfig()->reinit();
429
  Mage::app()->reinitStores();
430
  }
431
-
432
-
433
-
434
- // Weekend Days
435
  $weekendDaySelected = Mage::getStoreConfig('general/locale/weekend', $storeId);
436
  //echo $weekendDaySelected;
437
  $weekendExplode = explode(',', $weekendDaySelected);
@@ -461,22 +480,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
461
  }
462
  $localeAction['weekendDaysMulti'] = $weekendAnotherArr;
463
 
464
- $weekendDayVal = $post_data['weekendDays'];
465
- if(!empty($weekendDayVal))
466
- {
467
- $makeStr = implode(',', $weekendDayVal);
468
- if($storeId == 0)
469
- {
470
- Mage::getConfig()->saveConfig('general/locale/weekend', $makeStr, 'default', $storeId);
471
- }
472
- else
473
- {
474
- Mage::getConfig()->saveConfig('general/locale/weekend', $makeStr, 'stores', $storeId);
475
- }
476
- $localeAction['successMessage'] = "Weekend Days Saved On ".$storeName." Store.";
477
- Mage::getConfig()->reinit();
478
- Mage::app()->reinitStores();
479
- }
480
 
481
  //echo "<pre>"; print_r($weekendAnotherArr); die;
482
  $jsonData = Mage::helper('core')->jsonEncode($localeAction);
@@ -529,8 +532,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
529
  // die;
530
 
531
  // Add store code to URL's
532
- $storeCodeUrlAction['selectedStoreCode'] = Mage::getStoreConfig('web/url/use_store');
533
-
534
  //$storeCodeValue = is;
535
  if(isset($post_data['selectedStoreVal']))
536
  {
@@ -539,12 +540,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
539
  Mage::getConfig()->reinit();
540
  Mage::app()->reinitStores();
541
  }
 
542
 
543
 
544
 
545
  // Auto-redirect to Base URL
546
- $storeCodeUrlAction['selectedAutoRedirect'] = Mage::getStoreConfig('web/url/redirect_to_base');
547
-
548
  // $autoRedirectValue = $post_data['selectedRedirect'];
549
  if(isset($post_data['selectedRedirect']))
550
  {
@@ -555,12 +555,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
555
  Mage::getConfig()->reinit();
556
  Mage::app()->reinitStores();
557
  }
 
558
 
559
 
560
 
561
  // Search Engines Optimization
562
- $storeCodeUrlAction['webServerRewriteSlectedValue'] = Mage::getStoreConfig('web/seo/use_rewrites', $storeId);
563
-
564
  //$webRewritesValue = $post_data['webRewriteVal'];
565
  if(isset($post_data['webRewriteVal']))
566
  {
@@ -579,17 +578,16 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
579
  }
580
 
581
  $storeCodeUrlAction['successMessage'] = "Search Engine Optimization Saved On ".$storeName." Store.";
582
- Mage::getConfig()->reinit();
583
- Mage::app()->reinitStores();
584
  }
 
585
 
586
 
587
 
588
  //////// Unsecure
589
 
590
  //Base URL
591
- $storeCodeUrlAction['baseUrlSelectedValue'] = Mage::getStoreConfig('web/unsecure/base_url', $storeId);
592
-
593
  //$baseUrlValue = $post_data['baseUrlVal'];
594
  if(isset($post_data['baseUrlVal']))
595
  {
@@ -611,11 +609,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
611
  Mage::getConfig()->reinit();
612
  Mage::app()->reinitStores();
613
  }
 
 
 
614
 
615
 
616
  //Base Link URL
617
- $storeCodeUrlAction['baseLinkUrlSelectedValue'] = Mage::getStoreConfig('web/unsecure/base_link_url', $storeId);
618
-
619
  // $baseLinkUrlValue = $post_data['baseLinkUrlVal'];
620
  if(isset($post_data['baseLinkUrlVal']))
621
  {
@@ -637,11 +636,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
637
  Mage::getConfig()->reinit();
638
  Mage::app()->reinitStores();
639
  }
 
640
 
 
641
 
642
- //Base Skin URL
643
- $storeCodeUrlAction['baseSkinUrlSelectedValue'] = Mage::getStoreConfig('web/unsecure/base_skin_url', $storeId);
644
 
 
645
  // $baseSkinUrlValue = $post_data['baseSkinUrlVal'];
646
  if(isset($post_data['baseSkinUrlVal']))
647
  {
@@ -663,12 +663,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
663
  Mage::getConfig()->reinit();
664
  Mage::app()->reinitStores();
665
  }
 
666
 
667
 
668
 
669
- //Base Media URL
670
- $storeCodeUrlAction['baseMediaUrlSelectedValue'] = Mage::getStoreConfig('web/unsecure/base_media_url', $storeId);
671
 
 
672
  //$baseMediaUrlValue = $post_data['baseMediaUrlVal'];
673
  if(isset($post_data['baseMediaUrlVal']))
674
  {
@@ -690,13 +690,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
690
  Mage::getConfig()->reinit();
691
  Mage::app()->reinitStores();
692
  }
 
 
693
 
694
 
695
 
696
  //Base JavaScript URL
697
- $storeCodeUrlAction['baseJavaUrlSelectedValue'] = Mage::getStoreConfig('web/unsecure/base_js_url', $storeId);
698
- //Mage::log($storeCodeUrlAction['baseJavaUrlSelectedValue'], null, "cart_android.log");
699
- //$baseJavaUrlValue = $post_data['baseJavaUrlVal'];
700
  if(isset($post_data['baseJavaUrlVal']))
701
  {
702
  //Mage::log($baseJavaUrlValue, null, "cart_android.log");
@@ -722,6 +721,10 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
722
  Mage::getConfig()->reinit();
723
  Mage::app()->reinitStores();
724
  }
 
 
 
 
725
 
726
 
727
 
@@ -729,8 +732,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
729
  //////// Secure
730
 
731
  //Base URL
732
- $storeCodeUrlAction['baseUrlSecureSelectedValue'] = Mage::getStoreConfig('web/secure/base_url', $storeId);
733
-
734
  //$baseUrlSecureValue = $post_data['baseUrlSecureVal'];
735
  if(isset($post_data['baseUrlSecureVal']))
736
  {
@@ -752,11 +753,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
752
  Mage::getConfig()->reinit();
753
  Mage::app()->reinitStores();
754
  }
 
755
 
 
756
 
757
- //Base Link URL
758
- $storeCodeUrlAction['baseLinkUrlSecureSelectedValue'] = Mage::getStoreConfig('web/secure/base_link_url', $storeId);
759
 
 
760
  // $baseLinkUrlSecureValue = $post_data['baseLinkUrlSecureVal'];
761
  if(isset($post_data['baseLinkUrlSecureVal']))
762
  {
@@ -778,11 +780,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
778
  Mage::getConfig()->reinit();
779
  Mage::app()->reinitStores();
780
  }
 
781
 
 
782
 
783
- //Base Skin URL
784
- $storeCodeUrlAction['baseSkinUrlSecureSelectedValue'] = Mage::getStoreConfig('web/secure/base_skin_url', $storeId);
785
 
 
786
  //$baseSkinUrlSecureValue = $post_data['baseSkinUrlSecureVal'];
787
  if(isset($post_data['baseSkinUrlSecureVal']))
788
  {
@@ -804,12 +807,13 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
804
  Mage::getConfig()->reinit();
805
  Mage::app()->reinitStores();
806
  }
 
807
 
 
808
 
809
 
810
- //Base Media URL
811
- $storeCodeUrlAction['baseMediaUrlSecureSelectedValue'] = Mage::getStoreConfig('web/secure/base_media_url', $storeId);
812
 
 
813
  //$baseMediaUrlSecureValue = $post_data['baseMediaUrlSecureVal'];
814
  if(isset($post_data['baseMediaUrlSecureVal']))
815
  {
@@ -831,12 +835,13 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
831
  Mage::getConfig()->reinit();
832
  Mage::app()->reinitStores();
833
  }
 
 
 
834
 
835
 
836
 
837
  //Base JavaScript URL
838
- $storeCodeUrlAction['baseJavaUrlSecureSelectedValue'] = Mage::getStoreConfig('web/secure/base_js_url', $storeId);
839
-
840
  //$baseJavaUrlSecureValue = $post_data['baseJavaUrlSecureVal'];
841
  if(isset($post_data['baseJavaUrlSecureVal']))
842
  {
@@ -858,11 +863,13 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
858
  Mage::getConfig()->reinit();
859
  Mage::app()->reinitStores();
860
  }
 
 
 
861
 
862
 
863
 
864
  //Use Secure URLs in Frontend
865
- $storeCodeUrlAction['secureUrlFrontendSelectedValue'] = Mage::getStoreConfig('web/secure/use_in_frontend', $storeId);
866
  //$secureUrlFrontendValue = $post_data['secureUrlFrontendVal'];
867
  if(isset($post_data['secureUrlFrontendVal']))
868
  {
@@ -879,11 +886,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
879
  Mage::getConfig()->reinit();
880
  Mage::app()->reinitStores();
881
  }
 
 
882
 
883
 
884
 
885
  //Use Secure URLs in Admin
886
- $storeCodeUrlAction['secureUrlAdminSelectedValue'] = Mage::getStoreConfig('web/secure/use_in_adminhtml');
887
  //$secureUrlAdminValue = $post_data['secureUrlAdminVal'];
888
  if(isset($post_data['secureUrlAdminVal']))
889
  {
@@ -893,11 +901,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
893
  Mage::getConfig()->reinit();
894
  Mage::app()->reinitStores();
895
  }
 
 
896
 
897
 
898
 
899
  //Offloader header
900
- $storeCodeUrlAction['offloaderHeaderSelectedValue'] = Mage::getStoreConfig('web/secure/offloader_header');
901
  //$offloaderHeaderValue = $post_data['offloaderHeaderVal'];
902
  if(isset($post_data['offloaderHeaderVal']))
903
  {
@@ -907,13 +916,14 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
907
  Mage::getConfig()->reinit();
908
  Mage::app()->reinitStores();
909
  }
 
 
910
 
911
 
912
 
913
  //Default Pages
914
 
915
  //Default Web URL
916
- $storeCodeUrlAction['defaultWebUrlSelectedValue'] = Mage::getStoreConfig('web/default/front', $storeId);
917
  //$defaultWebUrlValue = $post_data['defaultWebUrlVal'];
918
  if(isset($post_data['defaultWebUrlVal']))
919
  {
@@ -930,12 +940,31 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
930
  Mage::getConfig()->reinit();
931
  Mage::app()->reinitStores();
932
  }
 
 
933
 
934
 
935
 
936
  //CMS Home Page
937
  $AllCmsPages = Mage::getModel('cms/page')->getCollection()->toOptionArray();
938
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
939
  $selected = Mage::getStoreConfig('web/default/cms_home_page', $storeId);
940
 
941
  foreach ($AllCmsPages as $value)
@@ -956,47 +985,49 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
956
  }
957
  }
958
 
959
- //$cmsHomeValue = $post_data['cmsHomeVal'];
960
- if(isset($post_data['cmsHomeVal']))
 
 
 
 
961
  {
962
  if($storeId == 0)
963
  {
964
- Mage::getConfig()->saveConfig('web/default/cms_home_page', $post_data['cmsHomeVal'], 'default', $storeId);
965
  }
966
  else
967
  {
968
- Mage::getConfig()->saveConfig('web/default/cms_home_page', $post_data['cmsHomeVal'], 'stores', $storeId);
969
  }
970
 
971
- $storeCodeUrlAction['successMessage'] = "Default Home Page Saved On ".$storeName." Store.";
972
  Mage::getConfig()->reinit();
973
  Mage::app()->reinitStores();
974
  }
975
-
976
-
977
- //Default No-route URL
978
  $storeCodeUrlAction['noRouteSelectedValue'] = Mage::getStoreConfig('web/default/no_route', 1);
979
  //Mage::log($storeId, null, "cart_android.log");
980
- //$noRouteValue = $post_data['noRouteVal'];
981
- if(isset($post_data['noRouteVal']))
 
 
 
 
 
982
  {
983
  if($storeId == 0)
984
  {
985
- Mage::getConfig()->saveConfig('web/default/no_route', $post_data['noRouteVal'], 'default', $storeId);
986
  }
987
  else
988
  {
989
- Mage::getConfig()->saveConfig('web/default/no_route', $post_data['noRouteVal'], 'stores', $storeId);
990
  }
991
 
992
- $storeCodeUrlAction['successMessage'] = "Default No Route URL Saved On ".$storeName." Store.";
993
  Mage::getConfig()->reinit();
994
  Mage::app()->reinitStores();
995
  }
996
-
997
-
998
-
999
- //CMS No Route Page
1000
  $noRoutePageselected = Mage::getStoreConfig('web/default/cms_no_route', $storeId);
1001
 
1002
  foreach ($AllCmsPages as $value)
@@ -1017,27 +1048,28 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1017
  }
1018
  }
1019
 
1020
- //$CmsNoRouteValue = $post_data['CmsNoRouteVal'];
1021
- if(isset($post_data['CmsNoRouteVal']))
 
 
 
 
 
 
1022
  {
1023
  if($storeId == 0)
1024
  {
1025
- Mage::getConfig()->saveConfig('web/default/cms_no_route', $post_data['CmsNoRouteVal'], 'default', $storeId);
1026
  }
1027
  else
1028
  {
1029
- Mage::getConfig()->saveConfig('web/default/cms_no_route', $post_data['CmsNoRouteVal'], 'stores', $storeId);
1030
  }
1031
 
1032
- $storeCodeUrlAction['successMessage'] = "Cmd No-Route Page Saved On ".$storeName." Store.";
1033
  Mage::getConfig()->reinit();
1034
  Mage::app()->reinitStores();
1035
  }
1036
-
1037
-
1038
-
1039
-
1040
- //CMS No Cookies Page
1041
  $noCookiesPageselected = Mage::getStoreConfig('web/default/cms_no_cookies', $storeId);
1042
 
1043
  foreach ($AllCmsPages as $value)
@@ -1058,27 +1090,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1058
  }
1059
  }
1060
 
1061
- //$noCookiesValue = $post_data['noCookiesVal'];
1062
- if(isset($post_data['noCookiesVal']))
1063
- {
1064
- if($storeId == 0)
1065
- {
1066
- Mage::getConfig()->saveConfig('web/default/cms_no_cookies', $post_data['noCookiesVal'], 'default', $storeId);
1067
- }
1068
- else
1069
- {
1070
- Mage::getConfig()->saveConfig('web/default/cms_no_cookies', $post_data['noCookiesVal'], 'stores', $storeId);
1071
- }
1072
-
1073
- $storeCodeUrlAction['successMessage'] = "Cmd No-Cookies Value Page Saved On ".$storeName." Store.";
1074
- Mage::getConfig()->reinit();
1075
- Mage::app()->reinitStores();
1076
- }
1077
 
1078
 
1079
 
1080
  //Show Breadcrumbs for CMS Pages
1081
- $storeCodeUrlAction['breadCrumbsValue'] = Mage::getStoreConfig('web/default/show_cms_breadcrumbs', $storeId);
1082
  //$breadcrumbsValue = $post_data['breadCrumbsVal'];
1083
  if(isset($post_data['breadCrumbsVal']))
1084
  {
@@ -1095,13 +1111,14 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1095
  Mage::getConfig()->reinit();
1096
  Mage::app()->reinitStores();
1097
  }
 
 
1098
 
1099
 
1100
 
1101
  //Polls
1102
 
1103
  //Disallow Voting in a Poll Multiple Times from Same IP-address
1104
- $storeCodeUrlAction['pollsValue'] = Mage::getStoreConfig('web/polls/poll_check_by_ip', $storeId);
1105
  //$pollValue = $post_data['pollVal'];
1106
  if(isset($post_data['pollVal']))
1107
  {
@@ -1118,13 +1135,14 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1118
  Mage::getConfig()->reinit();
1119
  Mage::app()->reinitStores();
1120
  }
 
 
1121
 
1122
 
1123
 
1124
  //Session Cookie Management
1125
 
1126
  //Cookie Lifetime
1127
- $storeCodeUrlAction['cookieLifetimeValue'] = Mage::getStoreConfig('web/cookie/cookie_lifetime', $storeId);
1128
  //$cookieLifetimeValue = $post_data['cookieLifetimeVal'];
1129
  if(isset($post_data['cookieLifetimeVal']))
1130
  {
@@ -1141,10 +1159,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1141
  Mage::getConfig()->reinit();
1142
  Mage::app()->reinitStores();
1143
  }
 
 
1144
 
1145
 
1146
  //Cookie Path
1147
- $storeCodeUrlAction['cookiePaathValue'] = Mage::getStoreConfig('web/cookie/cookie_path', $storeId);
1148
  // $cookiePaathValue = $post_data['cookiePaathVal'];
1149
  if(isset($post_data['cookiePaathVal']))
1150
  {
@@ -1161,11 +1180,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1161
  Mage::getConfig()->reinit();
1162
  Mage::app()->reinitStores();
1163
  }
 
 
1164
 
1165
 
1166
 
1167
  //Cookie Domain
1168
- $storeCodeUrlAction['cookieDomainValue'] = Mage::getStoreConfig('web/cookie/cookie_domain', $storeId);
1169
  //$cookieDomainValue = $post_data['cookieDomainVal'];
1170
  if(isset($post_data['cookieDomainVal']))
1171
  {
@@ -1182,11 +1202,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1182
  Mage::getConfig()->reinit();
1183
  Mage::app()->reinitStores();
1184
  }
 
 
1185
 
1186
 
1187
 
1188
  //Use HTTP Only
1189
- $storeCodeUrlAction['httpOnlyValue'] = Mage::getStoreConfig('web/cookie/cookie_httponly', $storeId);
1190
  //$httpOnlyValue = $post_data['httpOnlyVal'];
1191
  if(isset($post_data['httpOnlyVal']))
1192
  {
@@ -1203,11 +1224,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1203
  Mage::getConfig()->reinit();
1204
  Mage::app()->reinitStores();
1205
  }
 
 
1206
 
1207
 
1208
 
1209
  //Cookie Restriction Mode
1210
- $storeCodeUrlAction['cookieRestrictionModeValue'] = Mage::getStoreConfig('web/cookie/cookie_restriction');
1211
  //$cookieRestrictionModeValue = $post_data['cookieRestrictionModeVal'];
1212
  if(isset($post_data['cookieRestrictionModeVal']))
1213
  {
@@ -1217,6 +1239,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1217
  Mage::getConfig()->reinit();
1218
  Mage::app()->reinitStores();
1219
  }
 
 
1220
 
1221
 
1222
 
@@ -1224,7 +1248,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1224
  //Session Validation Settings
1225
 
1226
  //Validate REMOTE_ADDR
1227
- $storeCodeUrlAction['validateRemoteValue'] = Mage::getStoreConfig('web/session/use_remote_addr');
1228
  //$validateRemoteValue = $post_data['validateRemoteVal'];
1229
  if(isset($post_data['validateRemoteVal']))
1230
  {
@@ -1234,11 +1257,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1234
  Mage::getConfig()->reinit();
1235
  Mage::app()->reinitStores();
1236
  }
 
 
1237
 
1238
 
1239
 
1240
  //Validate HTTP_VIA
1241
- $storeCodeUrlAction['validateHttpValue'] = Mage::getStoreConfig('web/session/use_http_via');
1242
  //$validateHttpValue = $post_data['validateHttpVal'];
1243
  if(isset($post_data['validateHttpVal']))
1244
  {
@@ -1248,11 +1272,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1248
  Mage::getConfig()->reinit();
1249
  Mage::app()->reinitStores();
1250
  }
 
 
1251
 
1252
 
1253
 
1254
  //Validate HTTP_X_FORWARDED_FOR
1255
- $storeCodeUrlAction['validateHttpXXValue'] = Mage::getStoreConfig('web/session/use_http_x_forwarded_for');
1256
  //$validateHttpXXValue = $post_data['validateHttpXXVal'];
1257
  if(isset($post_data['validateHttpXXVal']))
1258
  {
@@ -1262,11 +1287,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1262
  Mage::getConfig()->reinit();
1263
  Mage::app()->reinitStores();
1264
  }
 
 
1265
 
1266
 
1267
 
1268
  //Validate HTTP_USER_AGENT
1269
- $storeCodeUrlAction['validateHttpUserValue'] = Mage::getStoreConfig('web/session/use_http_user_agent');
1270
  //$validateHttpUserValue = $post_data['validateHttpUserVal'];
1271
  if(isset($post_data['validateHttpUserVal']))
1272
  {
@@ -1276,11 +1302,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1276
  Mage::getConfig()->reinit();
1277
  Mage::app()->reinitStores();
1278
  }
 
 
1279
 
1280
 
1281
 
1282
  //Use SID on Frontend
1283
- $storeCodeUrlAction['useSIDValue'] = Mage::getStoreConfig('web/session/use_frontend_sid');
1284
  //$useSIDValue = $post_data['useSIDVal'];
1285
  if(isset($post_data['useSIDVal']))
1286
  {
@@ -1291,12 +1318,14 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1291
  Mage::app()->reinitStores();
1292
  }
1293
 
 
 
 
1294
 
1295
 
1296
  //Browser Capabilities Detection
1297
 
1298
  //Redirect to CMS-page if Cookies are Disabled
1299
- $storeCodeUrlAction['redirectToCmsValue'] = Mage::getStoreConfig('web/browser_capabilities/cookies', $storeId);
1300
  //$redirectToCmsValue = $post_data['redirectToCmsVal'];
1301
  if(isset($post_data['redirectToCmsVal']))
1302
  {
@@ -1313,11 +1342,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1313
  Mage::getConfig()->reinit();
1314
  Mage::app()->reinitStores();
1315
  }
 
 
1316
 
1317
 
1318
 
1319
  //Show Notice if JavaScript is Disabled
1320
- $storeCodeUrlAction['showNoticeValue'] = Mage::getStoreConfig('web/browser_capabilities/javascript', $storeId);
1321
  //$showNoticeValue = $post_data['showNoticeVal'];
1322
  if(isset($post_data['showNoticeVal']))
1323
  {
@@ -1334,8 +1364,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1334
  Mage::getConfig()->reinit();
1335
  Mage::app()->reinitStores();
1336
  }
1337
-
1338
-
1339
 
1340
  // echo "<pre>"; print_r($storeCodeUrlAction); die;
1341
  $jsonData = Mage::helper('core')->jsonEncode($storeCodeUrlAction);
@@ -1389,6 +1419,18 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1389
 
1390
  //Base Currency
1391
  $currenciesList = Mage::app()->getLocale()->getOptionCurrencies();
 
 
 
 
 
 
 
 
 
 
 
 
1392
  $selectedCurrency = Mage::getStoreConfig('currency/options/base', 0);
1393
 
1394
  foreach ($currenciesList as $value)
@@ -1409,20 +1451,28 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1409
  }
1410
  }
1411
 
1412
- //$baseCurrValue = $post_data['baseCurrVal'];
1413
- if(isset($post_data['baseCurrVal']))
 
 
 
 
 
1414
  {
1415
- //Mage::log($post_data['baseCurrVal'], null, "cart_android.log");
1416
- Mage::getConfig()->saveConfig('currency/options/base', $post_data['baseCurrVal'], 'default', 0);
 
 
 
 
 
 
 
1417
 
1418
- //$storeCodeUrlAction['successMessage'] = "Base Currency Value Saved On ".$storeName." Store.";
1419
  Mage::getConfig()->reinit();
1420
  Mage::app()->reinitStores();
1421
  }
1422
-
1423
-
1424
-
1425
- //Default Display Currency
1426
  $selectedDefaultCurrency = Mage::getStoreConfig('currency/options/default', $storeId);
1427
 
1428
  foreach ($currenciesList as $value)
@@ -1443,27 +1493,28 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1443
  }
1444
  }
1445
 
1446
- //$defaultDisCurrValue = $post_data['defaultDisplayCurrVal'];
1447
- if(isset($post_data['defaultDisplayCurrVal']))
 
 
 
 
1448
  {
1449
- //Mage::log("nav", null, "cart_android.log");
 
1450
  if($storeId == 0)
1451
  {
1452
- Mage::getConfig()->saveConfig('currency/options/default', $post_data['defaultDisplayCurrVal'], 'default', $storeId);
1453
  }
1454
  else
1455
  {
1456
- Mage::getConfig()->saveConfig('currency/options/default', $post_data['defaultDisplayCurrVal'], 'stores', $storeId);
1457
  }
1458
 
1459
- $currencySetupAction['successMessage'] = "Default Display Currency Value Saved On ".$storeName." Store.";
1460
  Mage::getConfig()->reinit();
1461
  Mage::app()->reinitStores();
1462
  }
1463
- //echo "<pre>"; print_r($currencySetupAction); die;
1464
-
1465
-
1466
- //Allowed Currencies
1467
  $allowedCurrencies = Mage::getStoreConfig('currency/options/allow', $storeId);
1468
  $explodedCurr = explode(',', $allowedCurrencies);
1469
  foreach ($explodedCurr as $value)
@@ -1489,24 +1540,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1489
  }
1490
  }
1491
  //echo "<pre>"; print_r($currencySetupAction1); die;
1492
- //$allowedCurrValue = $post_data['allowedCurrVal'];
1493
- if(isset($post_data['allowedCurrVal']))
1494
- {
1495
- //Mage::log($post_data['allowedCurrVal'], null, "cart_android.log");
1496
- $implodeVal = implode(',', $post_data['allowedCurrVal']);
1497
- if($storeId == 0)
1498
- {
1499
- Mage::getConfig()->saveConfig('currency/options/allow', $implodeVal, 'default', $storeId);
1500
- }
1501
- else
1502
- {
1503
- Mage::getConfig()->saveConfig('currency/options/allow', $implodeVal, 'stores', $storeId);
1504
- }
1505
-
1506
- $currencySetupAction['successMessage'] = "Allowed Currencies Value Saved On ".$storeName." Store.";
1507
- Mage::getConfig()->reinit();
1508
- Mage::app()->reinitStores();
1509
- }
1510
 
1511
 
1512
 
@@ -1514,17 +1547,17 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1514
  //Webservicex
1515
 
1516
  //Connection Timeout in Seconds
1517
- $currencySetupAction['connectionTimedOutSelectedValue'] = Mage::getStoreConfig('currency/webservicex/timeout');
1518
-
1519
  if(isset($post_data['connectionTimedOutVal']))
1520
  {
1521
  //Mage::log($post_data['baseCurrVal'], null, "cart_android.log");
1522
  Mage::getConfig()->saveConfig('currency/webservicex/timeout', $post_data['connectionTimedOutVal'], 'default', 0);
1523
 
1524
  $storeCodeUrlAction['successMessage'] = "Connection Timeout Value Saved in Seconds On ".$storeName." Store.";
1525
- Mage::getConfig()->reinit();
1526
- Mage::app()->reinitStores();
1527
  }
 
 
1528
 
1529
  //echo "<pre>"; print_r($currencySetupAction); die;
1530
  $jsonData = Mage::helper('core')->jsonEncode($currencySetupAction);
@@ -1571,8 +1604,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1571
  //General Contact
1572
 
1573
  //Sender Name
1574
- $storeEmailAddresses['generalSenderNameSelectedValue'] = Mage::getStoreConfig('trans_email/ident_general/name', $storeId);
1575
-
1576
  if(isset($post_data['generalSenderNameVal']))
1577
  {
1578
  if($storeId == 0)
@@ -1588,10 +1619,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1588
  Mage::getConfig()->reinit();
1589
  Mage::app()->reinitStores();
1590
  }
 
 
 
1591
 
1592
  //Sender Email
1593
- $storeEmailAddresses['generalSenderEmailSelectedValue'] = Mage::getStoreConfig('trans_email/ident_general/email', $storeId);
1594
-
1595
  if(isset($post_data['generalSenderEmailVal']))
1596
  {
1597
  if($storeId == 0)
@@ -1607,6 +1639,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1607
  Mage::getConfig()->reinit();
1608
  Mage::app()->reinitStores();
1609
  }
 
 
1610
 
1611
 
1612
 
@@ -1614,8 +1648,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1614
  //Sales Representative
1615
 
1616
  //Sender Name
1617
- $storeEmailAddresses['salesSenderNameSelectedValue'] = Mage::getStoreConfig('trans_email/ident_sales/name', $storeId);
1618
-
1619
  if(isset($post_data['salesSenderNameVal']))
1620
  {
1621
  if($storeId == 0)
@@ -1631,10 +1663,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1631
  Mage::getConfig()->reinit();
1632
  Mage::app()->reinitStores();
1633
  }
 
 
 
1634
 
1635
  //Sender Email
1636
- $storeEmailAddresses['salesSenderEmailSelectedValue'] = Mage::getStoreConfig('trans_email/ident_sales/email', $storeId);
1637
-
1638
  if(isset($post_data['salesSenderEmailVal']))
1639
  {
1640
  if($storeId == 0)
@@ -1650,6 +1683,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1650
  Mage::getConfig()->reinit();
1651
  Mage::app()->reinitStores();
1652
  }
 
 
1653
 
1654
 
1655
 
@@ -1657,8 +1692,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1657
  //Customer Support
1658
 
1659
  //Sender Name
1660
- $storeEmailAddresses['customerSenderNameSelectedValue'] = Mage::getStoreConfig('trans_email/ident_support/name', $storeId);
1661
-
1662
  if(isset($post_data['customerSenderNameVal']))
1663
  {
1664
  if($storeId == 0)
@@ -1674,10 +1707,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1674
  Mage::getConfig()->reinit();
1675
  Mage::app()->reinitStores();
1676
  }
 
 
 
1677
 
1678
  //Sender Email
1679
- $storeEmailAddresses['customerSenderEmailSelectedValue'] = Mage::getStoreConfig('trans_email/ident_support/email', $storeId);
1680
-
1681
  if(isset($post_data['customerSenderEmailVal']))
1682
  {
1683
  if($storeId == 0)
@@ -1693,6 +1727,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1693
  Mage::getConfig()->reinit();
1694
  Mage::app()->reinitStores();
1695
  }
 
 
1696
 
1697
 
1698
 
@@ -1700,8 +1736,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1700
  //Custom Email 1
1701
 
1702
  //Sender Name
1703
- $storeEmailAddresses['custom1NameSelectedValue'] = Mage::getStoreConfig('trans_email/ident_custom1/name', $storeId);
1704
-
1705
  if(isset($post_data['custom1SenderNameVal']))
1706
  {
1707
  if($storeId == 0)
@@ -1717,10 +1751,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1717
  Mage::getConfig()->reinit();
1718
  Mage::app()->reinitStores();
1719
  }
 
 
 
1720
 
1721
  //Sender Email
1722
- $storeEmailAddresses['custom1EmailSelectedValue'] = Mage::getStoreConfig('trans_email/ident_custom1/email', $storeId);
1723
-
1724
  if(isset($post_data['custom1EmailVal']))
1725
  {
1726
  if($storeId == 0)
@@ -1736,6 +1771,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1736
  Mage::getConfig()->reinit();
1737
  Mage::app()->reinitStores();
1738
  }
 
 
1739
 
1740
 
1741
 
@@ -1743,8 +1780,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1743
  //Custom Email 2
1744
 
1745
  //Sender Name
1746
- $storeEmailAddresses['custom2NameSelectedValue'] = Mage::getStoreConfig('trans_email/ident_custom2/name', $storeId);
1747
-
1748
  if(isset($post_data['custom2SenderNameVal']))
1749
  {
1750
  if($storeId == 0)
@@ -1760,10 +1795,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1760
  Mage::getConfig()->reinit();
1761
  Mage::app()->reinitStores();
1762
  }
 
 
 
1763
 
1764
  //Sender Email
1765
- $storeEmailAddresses['custom2EmailSelectedValue'] = Mage::getStoreConfig('trans_email/ident_custom2/email', $storeId);
1766
-
1767
  if(isset($post_data['custom2EmailVal']))
1768
  {
1769
  if($storeId == 0)
@@ -1779,6 +1815,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1779
  Mage::getConfig()->reinit();
1780
  Mage::app()->reinitStores();
1781
  }
 
 
1782
 
1783
  //echo "<pre>"; print_r($storeEmailAddresses); die;
1784
  $jsonData = Mage::helper('core')->jsonEncode($storeEmailAddresses);
@@ -1844,8 +1882,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1844
  //Contact Us
1845
 
1846
  //Enable Contact Us
1847
- $storeContacts['enableContactUsSelectedValue'] = Mage::getStoreConfig('contacts/contacts/enabled', $storeId);
1848
-
1849
  if(isset($post_data['enableContactUsVal']))
1850
  {
1851
  if($storeId == 0)
@@ -1861,14 +1897,14 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1861
  Mage::getConfig()->reinit();
1862
  Mage::app()->reinitStores();
1863
  }
 
 
1864
 
1865
 
1866
 
1867
  //Email Options
1868
 
1869
  //Send Emails To
1870
- $storeContacts['sendEmailsToSelectedValue'] = Mage::getStoreConfig('contacts/email/recipient_email', $storeId);
1871
-
1872
  if(isset($post_data['sendEmailsToVal']))
1873
  {
1874
  if($storeId == 0)
@@ -1884,9 +1920,27 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1884
  Mage::getConfig()->reinit();
1885
  Mage::app()->reinitStores();
1886
  }
 
 
1887
 
1888
 
1889
  //Email Sender
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1890
  $emailSenderSelectedValue = Mage::getStoreConfig('contacts/email/sender_email_identity', $storeId);
1891
  foreach ($this->emailSendersListArray() as $value)
1892
  {
@@ -1906,25 +1960,25 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1906
  }
1907
  }
1908
 
1909
- if(isset($post_data['senderEmailVal']))
1910
- {
 
 
 
 
1911
  if($storeId == 0)
1912
  {
1913
- Mage::getConfig()->saveConfig('contacts/email/sender_email_identity', $post_data['senderEmailVal'], 'default', $storeId);
1914
  }
1915
  else
1916
  {
1917
- Mage::getConfig()->saveConfig('contacts/email/sender_email_identity', $post_data['senderEmailVal'], 'stores', $storeId);
1918
  }
1919
 
1920
- $storeContacts['successMessage'] = "Email Sender updated On ".$storeName." Store.";
1921
  Mage::getConfig()->reinit();
1922
  Mage::app()->reinitStores();
1923
  }
1924
-
1925
-
1926
-
1927
- //Email Template
1928
  $emailTemplateSelectedValue = Mage::getStoreConfig('contacts/email/email_template', $storeId);
1929
 
1930
  $emailTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -1953,21 +2007,7 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
1953
  }
1954
  }
1955
  //echo $post_data['emailTemplateVal']."***";
1956
- if(isset($post_data['emailTemplateVal']))
1957
- {
1958
- if($storeId == 0)
1959
- {
1960
- Mage::getConfig()->saveConfig('contacts/email/email_template', $post_data['emailTemplateVal'], 'default', $storeId);
1961
- }
1962
- else
1963
- {
1964
- Mage::getConfig()->saveConfig('contacts/email/email_template', $post_data['emailTemplateVal'], 'stores', $storeId);
1965
- }
1966
-
1967
- $storeContacts['successMessage'] = "Conatct Email Template updated On ".$storeName." Store.";
1968
- Mage::getConfig()->reinit();
1969
- Mage::app()->reinitStores();
1970
- }
1971
 
1972
  //echo "<pre>"; print_r($storeContacts); die;
1973
  $jsonData = Mage::helper('core')->jsonEncode($storeContacts);
@@ -2012,6 +2052,22 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2012
  //WYSIWYG Options
2013
 
2014
  //Enable WYSIWYG Editor
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2015
  $enableEditorSelectedValue = Mage::getStoreConfig('cms/wysiwyg/enabled', $storeId);
2016
 
2017
  $ediorObj = new Mage_Adminhtml_Model_System_Config_Source_Cms_Wysiwyg_Enabled();
@@ -2037,26 +2093,10 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2037
  }
2038
  }
2039
 
2040
- if(isset($post_data['editorVal']))
2041
- {
2042
- if($storeId == 0)
2043
- {
2044
- Mage::getConfig()->saveConfig('cms/wysiwyg/enabled', $post_data['editorVal'], 'default', $storeId);
2045
- }
2046
- else
2047
- {
2048
- Mage::getConfig()->saveConfig('cms/wysiwyg/enabled', $post_data['editorVal'], 'stores', $storeId);
2049
- }
2050
-
2051
- $contentManagementAcion['successMessage'] = "WYSIWYG Editor Option updated On ".$storeName." Store.";
2052
- Mage::getConfig()->reinit();
2053
- Mage::app()->reinitStores();
2054
- }
2055
 
2056
 
2057
 
2058
  //Use Static URLs for Media Content in WYSIWYG for Catalog
2059
- $contentManagementAcion['contentStaticSelectedValue'] = Mage::getStoreConfig('cms/wysiwyg/use_static_urls_in_catalog');
2060
  if(isset($post_data['contentStaticUrlVal']))
2061
  {
2062
  Mage::getConfig()->saveConfig('cms/wysiwyg/use_static_urls_in_catalog', $post_data['contentStaticUrlVal'], 'default', 0);
@@ -2065,7 +2105,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2065
  Mage::getConfig()->reinit();
2066
  Mage::app()->reinitStores();
2067
  }
2068
-
 
2069
 
2070
  //echo "<pre>"; print_r($contentManagementAcion); die;
2071
  $jsonData = Mage::helper('core')->jsonEncode($contentManagementAcion);
@@ -2111,7 +2152,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2111
  //General
2112
 
2113
  //Hide Customer IP
2114
- $salesAcion['hideCustomerIpSelectedValue'] = Mage::getStoreConfig('sales/general/hide_customer_ip', $storeId);
2115
  if(isset($post_data['hideCustomerIpVal']))
2116
  {
2117
  if($storeId == 0)
@@ -2127,12 +2167,13 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2127
  Mage::getConfig()->reinit();
2128
  Mage::app()->reinitStores();
2129
  }
 
 
2130
 
2131
 
2132
  //Checkout Totals Sort Order
2133
 
2134
  //Subtotal
2135
- $salesAcion['subtotalSelectedValue'] = Mage::getStoreConfig('sales/totals_sort/subtotal');
2136
  if(isset($post_data['subtotalVal']))
2137
  {
2138
  Mage::getConfig()->saveConfig('sales/totals_sort/subtotal', $post_data['subtotalVal'], 'default', 0);
@@ -2141,10 +2182,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2141
  Mage::getConfig()->reinit();
2142
  Mage::app()->reinitStores();
2143
  }
 
 
2144
 
2145
 
2146
  //Discount
2147
- $salesAcion['discountSelectedValue'] = Mage::getStoreConfig('sales/totals_sort/discount');
2148
  if(isset($post_data['discountVal']))
2149
  {
2150
  Mage::getConfig()->saveConfig('sales/totals_sort/discount', $post_data['discountVal'], 'default', 0);
@@ -2153,10 +2195,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2153
  Mage::getConfig()->reinit();
2154
  Mage::app()->reinitStores();
2155
  }
 
 
2156
 
2157
 
2158
  //Shipping
2159
- $salesAcion['shippingSelectedValue'] = Mage::getStoreConfig('sales/totals_sort/shipping');
2160
  if(isset($post_data['shippingVal']))
2161
  {
2162
  Mage::getConfig()->saveConfig('sales/totals_sort/shipping', $post_data['shippingVal'], 'default', 0);
@@ -2165,10 +2208,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2165
  Mage::getConfig()->reinit();
2166
  Mage::app()->reinitStores();
2167
  }
 
 
2168
 
2169
 
2170
  //Fixed Product Tax
2171
- $salesAcion['fixProductTaxSelectedValue'] = Mage::getStoreConfig('sales/totals_sort/weee');
2172
  if(isset($post_data['fixProductTaxVal']))
2173
  {
2174
  Mage::getConfig()->saveConfig('sales/totals_sort/weee', $post_data['fixProductTaxVal'], 'default', 0);
@@ -2177,10 +2221,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2177
  Mage::getConfig()->reinit();
2178
  Mage::app()->reinitStores();
2179
  }
 
 
2180
 
2181
 
2182
  //Tax
2183
- $salesAcion['taxSelectedValue'] = Mage::getStoreConfig('sales/totals_sort/tax');
2184
  if(isset($post_data['taxVal']))
2185
  {
2186
  Mage::getConfig()->saveConfig('sales/totals_sort/tax', $post_data['taxVal'], 'default', 0);
@@ -2189,10 +2234,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2189
  Mage::getConfig()->reinit();
2190
  Mage::app()->reinitStores();
2191
  }
 
 
2192
 
2193
 
2194
  //Grand Total
2195
- $salesAcion['grandTotalSelectedValue'] = Mage::getStoreConfig('sales/totals_sort/grand_total');
2196
  if(isset($post_data['grandTotalVal']))
2197
  {
2198
  Mage::getConfig()->saveConfig('sales/totals_sort/grand_total', $post_data['grandTotalVal'], 'default', 0);
@@ -2201,13 +2247,14 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2201
  Mage::getConfig()->reinit();
2202
  Mage::app()->reinitStores();
2203
  }
 
 
2204
 
2205
 
2206
 
2207
  //Reorder
2208
 
2209
  //Allow Reorder
2210
- $salesAcion['allowReorderSelectedValue'] = Mage::getStoreConfig('sales/reorder/allow', $storeId);
2211
  if(isset($post_data['allowReorderVal']))
2212
  {
2213
  if($storeId == 0)
@@ -2223,13 +2270,14 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2223
  Mage::getConfig()->reinit();
2224
  Mage::app()->reinitStores();
2225
  }
 
 
2226
 
2227
 
2228
 
2229
  //Minimum Order Amount
2230
 
2231
  //Enable
2232
- $salesAcion['minOrderEnableSelectedValue'] = Mage::getStoreConfig('sales/minimum_order/active');
2233
  if(isset($post_data['minOrderEnableVal']))
2234
  {
2235
  Mage::getConfig()->saveConfig('sales/minimum_order/active', $post_data['minOrderEnableVal'], 'default', 0);
@@ -2238,11 +2286,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2238
  Mage::getConfig()->reinit();
2239
  Mage::app()->reinitStores();
2240
  }
 
 
2241
 
2242
 
2243
 
2244
  //Minimum Amount
2245
- $salesAcion['minAmountSelectedValue'] = Mage::getStoreConfig('sales/minimum_order/amount');
2246
  if(isset($post_data['minAmountVal']))
2247
  {
2248
  Mage::getConfig()->saveConfig('sales/minimum_order/amount', $post_data['minAmountVal'], 'default', 0);
@@ -2251,10 +2300,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2251
  Mage::getConfig()->reinit();
2252
  Mage::app()->reinitStores();
2253
  }
 
 
2254
 
2255
 
2256
  //Description Message
2257
- $salesAcion['descriptionMessSelectedValue'] = Mage::getStoreConfig('sales/minimum_order/description', $storeId);
2258
  if(isset($post_data['descriptionMessVal']))
2259
  {
2260
  if($storeId == 0)
@@ -2270,10 +2320,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2270
  Mage::getConfig()->reinit();
2271
  Mage::app()->reinitStores();
2272
  }
 
 
2273
 
2274
 
2275
  //Error to Show in Shopping Cart
2276
- $salesAcion['errorMessSelectedValue'] = Mage::getStoreConfig('sales/minimum_order/error_message', $storeId);
2277
  if(isset($post_data['errorMessVal']))
2278
  {
2279
  if($storeId == 0)
@@ -2289,10 +2340,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2289
  Mage::getConfig()->reinit();
2290
  Mage::app()->reinitStores();
2291
  }
 
 
2292
 
2293
 
2294
  //Validate Each Address Separately in Multi-address Checkout
2295
- $salesAcion['validateAddressSelectedValue'] = Mage::getStoreConfig('sales/minimum_order/multi_address');
2296
  if(isset($post_data['validateAddressVal']))
2297
  {
2298
  Mage::getConfig()->saveConfig('sales/minimum_order/multi_address', $post_data['validateAddressVal'], 'default', 0);
@@ -2301,10 +2353,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2301
  Mage::getConfig()->reinit();
2302
  Mage::app()->reinitStores();
2303
  }
 
 
2304
 
2305
 
2306
  //Multi-address Description Message
2307
- $salesAcion['multiAddressSelectedValue'] = Mage::getStoreConfig('sales/minimum_order/multi_address_description', $storeId);
2308
  if(isset($post_data['multiAddressVal']))
2309
  {
2310
  if($storeId == 0)
@@ -2320,10 +2373,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2320
  Mage::getConfig()->reinit();
2321
  Mage::app()->reinitStores();
2322
  }
 
 
2323
 
2324
 
2325
  //Multi-address Error to Show in Shopping Cart
2326
- $salesAcion['multiAddressErrorSelectedValue'] = Mage::getStoreConfig('sales/minimum_order/multi_address_error_message', $storeId);
2327
  if(isset($post_data['multiAddressErrorVal']))
2328
  {
2329
  if($storeId == 0)
@@ -2339,6 +2393,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2339
  Mage::getConfig()->reinit();
2340
  Mage::app()->reinitStores();
2341
  }
 
 
2342
 
2343
 
2344
 
@@ -2346,7 +2402,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2346
  //Dashboard
2347
 
2348
  //Use Aggregated Data (beta)
2349
- $salesAcion['useAggregatedSelectedValue'] = Mage::getStoreConfig('sales/dashboard/use_aggregated_data');
2350
  if(isset($post_data['useAggregatedVal']))
2351
  {
2352
  Mage::getConfig()->saveConfig('sales/dashboard/use_aggregated_data', $post_data['useAggregatedVal'], 'default', 0);
@@ -2355,6 +2410,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2355
  Mage::getConfig()->reinit();
2356
  Mage::app()->reinitStores();
2357
  }
 
 
2358
 
2359
 
2360
 
@@ -2362,7 +2419,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2362
  //Gift Options
2363
 
2364
  //Allow Gift Messages on Order Level
2365
- $salesAcion['allowGiftSelectedValue'] = Mage::getStoreConfig('sales/gift_options/allow_order');
2366
  if(isset($post_data['allowGiftVal']))
2367
  {
2368
  Mage::getConfig()->saveConfig('sales/gift_options/allow_order', $post_data['allowGiftVal'], 'default', 0);
@@ -2371,10 +2427,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2371
  Mage::getConfig()->reinit();
2372
  Mage::app()->reinitStores();
2373
  }
 
 
2374
 
2375
 
2376
  //Allow Gift Messages for Order Items
2377
- $salesAcion['allowGiftOrderSelectedValue'] = Mage::getStoreConfig('sales/gift_options/allow_items');
2378
  if(isset($post_data['allowGiftOrderVal']))
2379
  {
2380
  Mage::getConfig()->saveConfig('sales/gift_options/allow_items', $post_data['allowGiftOrderVal'], 'default', 0);
@@ -2383,6 +2440,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2383
  Mage::getConfig()->reinit();
2384
  Mage::app()->reinitStores();
2385
  }
 
 
2386
 
2387
 
2388
 
@@ -2390,7 +2449,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2390
  //Minimum Advertised Price
2391
 
2392
  //Enable MAP
2393
- $salesAcion['enableMapSelectedValue'] = Mage::getStoreConfig('sales/msrp/enabled');
2394
  if(isset($post_data['enableMapVal']))
2395
  {
2396
  Mage::getConfig()->saveConfig('sales/msrp/enabled', $post_data['enableMapVal'], 'default', 0);
@@ -2399,10 +2457,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2399
  Mage::getConfig()->reinit();
2400
  Mage::app()->reinitStores();
2401
  }
 
 
2402
 
2403
 
2404
  //Apply MAP (Default Value)
2405
- $salesAcion['applyMapSelectedValue'] = Mage::getStoreConfig('sales/msrp/apply_for_all');
2406
  if(isset($post_data['applyMapVal']))
2407
  {
2408
  Mage::getConfig()->saveConfig('sales/msrp/apply_for_all', $post_data['applyMapVal'], 'default', 0);
@@ -2411,10 +2470,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2411
  Mage::getConfig()->reinit();
2412
  Mage::app()->reinitStores();
2413
  }
 
 
2414
 
2415
 
2416
  //Display Actual Price
2417
- $salesAcion['displayActualSelectedValue'] = Mage::getStoreConfig('sales/msrp/display_price_type');
2418
  if(isset($post_data['displayActualVal']))
2419
  {
2420
  Mage::getConfig()->saveConfig('sales/msrp/display_price_type', $post_data['displayActualVal'], 'default', 0);
@@ -2423,10 +2483,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2423
  Mage::getConfig()->reinit();
2424
  Mage::app()->reinitStores();
2425
  }
 
 
2426
 
2427
 
2428
  //Default Popup Text Message
2429
- $salesAcion['defaultPopUpSelectedValue'] = Mage::getStoreConfig('sales/msrp/explanation_message', $storeId);
2430
  if(isset($post_data['defaultPopUpVal']))
2431
  {
2432
  if($storeId == 0)
@@ -2442,10 +2503,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2442
  Mage::getConfig()->reinit();
2443
  Mage::app()->reinitStores();
2444
  }
 
 
2445
 
2446
 
2447
  //Default "What's This" Text Message
2448
- $salesAcion['defaultWhatsTextSelectedValue'] = Mage::getStoreConfig('sales/msrp/explanation_message_whats_this', $storeId);
2449
  if(isset($post_data['defaultWhatsTextVal']))
2450
  {
2451
  if($storeId == 0)
@@ -2461,6 +2523,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2461
  Mage::getConfig()->reinit();
2462
  Mage::app()->reinitStores();
2463
  }
 
 
2464
 
2465
  //echo "<pre>"; print_r($salesAcion); die;
2466
  $jsonData = Mage::helper('core')->jsonEncode($salesAcion);
@@ -2507,7 +2571,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2507
  //Order
2508
 
2509
  //Enabled
2510
- $salesEmailsAcion['salesEmailEnableSelectedValue'] = Mage::getStoreConfig('sales_email/order/enabled', $storeId);
2511
  if(isset($post_data['salesEmailEnableVal']))
2512
  {
2513
  if($storeId == 0)
@@ -2523,9 +2586,27 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2523
  Mage::getConfig()->reinit();
2524
  Mage::app()->reinitStores();
2525
  }
 
 
2526
 
2527
 
2528
  //New Order Confirmation Email Sender
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2529
  $newOrderConfirmationSelectedValue = Mage::getStoreConfig('sales_email/order/identity', $storeId);
2530
 
2531
  foreach ($this->emailSendersListArray() as $value)
@@ -2547,26 +2628,24 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2547
 
2548
  }
2549
 
2550
- if(isset($post_data['newOrderConfirmationVal']))
 
 
2551
  {
2552
  if($storeId == 0)
2553
  {
2554
- Mage::getConfig()->saveConfig('sales_email/order/identity', $post_data['newOrderConfirmationVal'], 'default', $storeId);
2555
  }
2556
  else
2557
  {
2558
- Mage::getConfig()->saveConfig('sales_email/order/identity', $post_data['newOrderConfirmationVal'], 'stores', $storeId);
2559
  }
2560
 
2561
- $salesEmailsAcion['successMessage'] = "New Order Confirmation Email Sender updated On ".$storeName." Store.";
2562
  Mage::getConfig()->reinit();
2563
  Mage::app()->reinitStores();
2564
  }
2565
 
2566
-
2567
-
2568
-
2569
- //New Order Confirmation Template
2570
  $newOrderEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/order/template', $storeId);
2571
 
2572
  $newOrderEmailTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -2580,39 +2659,39 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2580
  {
2581
  if($value['value'] == $newOrderEmailTemplateSelectedValue)
2582
  {
2583
- $newOrderEmailTemArr['label'] = $value['label'];
2584
  $newOrderEmailTemArr['value'] = $value['value'];
2585
  $newOrderEmailTemArr['status'] = 1;
2586
  $salesEmailsAcion['newOrderEmailTempColl'][] = $newOrderEmailTemArr;
2587
  }
2588
  else
2589
  {
2590
- $newOrderEmailTemArr['label'] = $value['label'];
2591
  $newOrderEmailTemArr['value'] = $value['value'];
2592
  $newOrderEmailTemArr['status'] = 0;
2593
  $salesEmailsAcion['newOrderEmailTempColl'][] = $newOrderEmailTemArr;
2594
  }
2595
  }
2596
  //echo $post_data['emailTemplateVal']."***";
2597
- if(isset($post_data['newOrderEmailTemplateVal']))
 
 
 
2598
  {
2599
  if($storeId == 0)
2600
  {
2601
- Mage::getConfig()->saveConfig('sales_email/order/template', $post_data['newOrderEmailTemplateVal'], 'default', $storeId);
2602
  }
2603
  else
2604
  {
2605
- Mage::getConfig()->saveConfig('sales_email/order/template', $post_data['newOrderEmailTemplateVal'], 'stores', $storeId);
2606
  }
2607
 
2608
- $salesEmailsAcion['successMessage'] = "New Order Confirmation Template updated On ".$storeName." Store.";
2609
  Mage::getConfig()->reinit();
2610
  Mage::app()->reinitStores();
2611
  }
2612
 
2613
-
2614
-
2615
- //New Order Confirmation Template for Guest
2616
  $forGuestEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/order/guest_template', $storeId);
2617
 
2618
  $newOrderEmailGuestTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -2627,40 +2706,23 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2627
  {
2628
  if($value['value'] == $forGuestEmailTemplateSelectedValue)
2629
  {
2630
- $forGuestOrderEmailTemArr['label'] = $value['label'];
2631
  $forGuestOrderEmailTemArr['value'] = $value['value'];
2632
  $forGuestOrderEmailTemArr['status'] = 1;
2633
  $salesEmailsAcion['newOrderForGuestColl'][] = $forGuestOrderEmailTemArr;
2634
  }
2635
  else
2636
  {
2637
- $forGuestOrderEmailTemArr['label'] = $value['label'];
2638
  $forGuestOrderEmailTemArr['value'] = $value['value'];
2639
  $forGuestOrderEmailTemArr['status'] = 0;
2640
  $salesEmailsAcion['newOrderForGuestColl'][] = $forGuestOrderEmailTemArr;
2641
  }
2642
  }
2643
  //echo $post_data['emailTemplateVal']."***";
2644
- if(isset($post_data['newOrderForGuestVal']))
2645
- {
2646
- if($storeId == 0)
2647
- {
2648
- Mage::getConfig()->saveConfig('sales_email/order/guest_template', $post_data['newOrderForGuestVal'], 'default', $storeId);
2649
- }
2650
- else
2651
- {
2652
- Mage::getConfig()->saveConfig('sales_email/order/guest_template', $post_data['newOrderForGuestVal'], 'stores', $storeId);
2653
- }
2654
-
2655
- $salesEmailsAcion['successMessage'] = "New Order Confirmation Template for Guest updated On ".$storeName." Store.";
2656
- Mage::getConfig()->reinit();
2657
- Mage::app()->reinitStores();
2658
- }
2659
-
2660
-
2661
 
2662
  //Send Order Email Copy To
2663
- $salesEmailsAcion['emailCopyToSelectedValue'] = Mage::getStoreConfig('sales_email/order/copy_to', $storeId);
2664
  if(isset($post_data['emailCopyToVal']))
2665
  {
2666
  if($storeId == 0)
@@ -2676,10 +2738,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2676
  Mage::getConfig()->reinit();
2677
  Mage::app()->reinitStores();
2678
  }
 
 
2679
 
2680
 
2681
  //Send Order Email Copy Method
2682
- $salesEmailsAcion['orderEmailCopySelectedValue'] = Mage::getStoreConfig('sales_email/order/copy_method', $storeId);
2683
  if(isset($post_data['orderEmailCopyVal']))
2684
  {
2685
  if($storeId == 0)
@@ -2695,6 +2758,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2695
  Mage::getConfig()->reinit();
2696
  Mage::app()->reinitStores();
2697
  }
 
 
2698
 
2699
  // echo "<pre>"; print_r($salesEmailsAcion); die;
2700
  $jsonData = Mage::helper('core')->jsonEncode($salesEmailsAcion);
@@ -2737,7 +2802,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2737
  //Order Comments
2738
 
2739
  //Enabled
2740
- $salesEmailsAcion['salesEmailCommentEnableSelectedValue'] = Mage::getStoreConfig('sales_email/order_comment/enabled', $storeId);
2741
  if(isset($post_data['salesEmailCommentEnableVal']))
2742
  {
2743
  if($storeId == 0)
@@ -2753,9 +2817,26 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2753
  Mage::getConfig()->reinit();
2754
  Mage::app()->reinitStores();
2755
  }
 
 
2756
 
2757
 
2758
  //Order Comment Email Sender
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2759
  $newOrderConfirmationSelectedValue = Mage::getStoreConfig('sales_email/order_comment/identity', $storeId);
2760
 
2761
  foreach ($this->emailSendersListArray() as $value)
@@ -2777,26 +2858,25 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2777
 
2778
  }
2779
 
2780
- if(isset($post_data['newOrderConfirmationCommentVal']))
 
 
 
2781
  {
2782
  if($storeId == 0)
2783
  {
2784
- Mage::getConfig()->saveConfig('sales_email/order_comment/identity', $post_data['newOrderConfirmationCommentVal'], 'default', $storeId);
2785
  }
2786
  else
2787
  {
2788
- Mage::getConfig()->saveConfig('sales_email/order_comment/identity', $post_data['newOrderConfirmationCommentVal'], 'stores', $storeId);
2789
  }
2790
 
2791
- $salesEmailsAcion['successMessage'] = "Order Comment Email Sender updated On ".$storeName." Store.";
2792
  Mage::getConfig()->reinit();
2793
  Mage::app()->reinitStores();
2794
  }
2795
 
2796
-
2797
-
2798
-
2799
- //Order Comment Email Template
2800
  $newOrderEmailTemplateCommentSelectedValue = Mage::getStoreConfig('sales_email/order_comment/template', $storeId);
2801
 
2802
  $newOrderEmailCommentTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -2810,39 +2890,39 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2810
  {
2811
  if($value['value'] == $newOrderEmailTemplateCommentSelectedValue)
2812
  {
2813
- $newOrderEmailTemArr['label'] = $value['label'];
2814
  $newOrderEmailTemArr['value'] = $value['value'];
2815
  $newOrderEmailTemArr['status'] = 1;
2816
  $salesEmailsAcion['newOrderEmailTempCommentColl'][] = $newOrderEmailTemArr;
2817
  }
2818
  else
2819
  {
2820
- $newOrderEmailTemArr['label'] = $value['label'];
2821
  $newOrderEmailTemArr['value'] = $value['value'];
2822
  $newOrderEmailTemArr['status'] = 0;
2823
  $salesEmailsAcion['newOrderEmailTempCommentColl'][] = $newOrderEmailTemArr;
2824
  }
2825
  }
2826
  //echo $post_data['emailTemplateVal']."***";
2827
- if(isset($post_data['newOrderEmailCommentTemplateVal']))
 
 
 
 
2828
  {
2829
  if($storeId == 0)
2830
  {
2831
- Mage::getConfig()->saveConfig('sales_email/order_comment/template', $post_data['newOrderEmailCommentTemplateVal'], 'default', $storeId);
2832
  }
2833
  else
2834
  {
2835
- Mage::getConfig()->saveConfig('sales_email/order_comment/template', $post_data['newOrderEmailCommentTemplateVal'], 'stores', $storeId);
2836
  }
2837
 
2838
- $salesEmailsAcion['successMessage'] = "Order Comment Email Template updated On ".$storeName." Store.";
2839
  Mage::getConfig()->reinit();
2840
  Mage::app()->reinitStores();
2841
  }
2842
-
2843
-
2844
-
2845
- //Order Comment Email Template for Guest
2846
  $forGuestEmailTemplateCommentSelectedValue = Mage::getStoreConfig('sales_email/order_comment/guest_template', $storeId);
2847
 
2848
  $newOrderEmailGuestCommentTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -2857,40 +2937,25 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2857
  {
2858
  if($value['value'] == $forGuestEmailTemplateCommentSelectedValue)
2859
  {
2860
- $forGuestOrderEmailTemArr['label'] = $value['label'];
2861
  $forGuestOrderEmailTemArr['value'] = $value['value'];
2862
  $forGuestOrderEmailTemArr['status'] = 1;
2863
  $salesEmailsAcion['newOrderForGuestCommentColl'][] = $forGuestOrderEmailTemArr;
2864
  }
2865
  else
2866
  {
2867
- $forGuestOrderEmailTemArr['label'] = $value['label'];
2868
  $forGuestOrderEmailTemArr['value'] = $value['value'];
2869
  $forGuestOrderEmailTemArr['status'] = 0;
2870
  $salesEmailsAcion['newOrderForGuestCommentColl'][] = $forGuestOrderEmailTemArr;
2871
  }
2872
  }
2873
  //echo $post_data['emailTemplateVal']."***";
2874
- if(isset($post_data['newOrderForGuestCommentVal']))
2875
- {
2876
- if($storeId == 0)
2877
- {
2878
- Mage::getConfig()->saveConfig('sales_email/order_comment/guest_template', $post_data['newOrderForGuestCommentVal'], 'default', $storeId);
2879
- }
2880
- else
2881
- {
2882
- Mage::getConfig()->saveConfig('sales_email/order_comment/guest_template', $post_data['newOrderForGuestCommentVal'], 'stores', $storeId);
2883
- }
2884
-
2885
- $salesEmailsAcion['successMessage'] = "Order Comment Email Template for Guest updated On ".$storeName." Store.";
2886
- Mage::getConfig()->reinit();
2887
- Mage::app()->reinitStores();
2888
- }
2889
 
2890
 
2891
 
2892
  //Send Order Comment Email Copy To
2893
- $salesEmailsAcion['emailCopyCommentToSelectedValue'] = Mage::getStoreConfig('sales_email/order_comment/copy_to', $storeId);
2894
  if(isset($post_data['emailCopyToCommentVal']))
2895
  {
2896
  if($storeId == 0)
@@ -2906,10 +2971,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2906
  Mage::getConfig()->reinit();
2907
  Mage::app()->reinitStores();
2908
  }
 
 
2909
 
2910
 
2911
  //Send Order Comments Email Copy Method
2912
- $salesEmailsAcion['orderEmailCopyCommentSelectedValue'] = Mage::getStoreConfig('sales_email/order_comment/copy_method', $storeId);
2913
  if(isset($post_data['orderEmailCopyCommentVal']))
2914
  {
2915
  if($storeId == 0)
@@ -2925,6 +2991,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2925
  Mage::getConfig()->reinit();
2926
  Mage::app()->reinitStores();
2927
  }
 
 
2928
 
2929
  //echo "<pre>"; print_r($salesEmailsAcion); die;
2930
  $jsonData = Mage::helper('core')->jsonEncode($salesEmailsAcion);
@@ -2967,7 +3035,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2967
  //Invoice
2968
 
2969
  //Enabled
2970
- $salesEmailsAcion['salesEmailInvoiceEnableSelectedValue'] = Mage::getStoreConfig('sales_email/invoice/enabled', $storeId);
2971
  if(isset($post_data['salesEmailInvoiceEnableVal']))
2972
  {
2973
  if($storeId == 0)
@@ -2983,9 +3050,26 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
2983
  Mage::getConfig()->reinit();
2984
  Mage::app()->reinitStores();
2985
  }
 
 
2986
 
2987
 
2988
  //Invoice Email Sender
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2989
  $invoiceEmailSelectedValue = Mage::getStoreConfig('sales_email/invoice/identity', $storeId);
2990
 
2991
  foreach ($this->emailSendersListArray() as $value)
@@ -3007,26 +3091,25 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3007
 
3008
  }
3009
 
3010
- if(isset($post_data['invoiceEmailVal']))
 
 
 
 
3011
  {
3012
  if($storeId == 0)
3013
  {
3014
- Mage::getConfig()->saveConfig('sales_email/invoice/identity', $post_data['invoiceEmailVal'], 'default', $storeId);
3015
  }
3016
  else
3017
  {
3018
- Mage::getConfig()->saveConfig('sales_email/invoice/identity', $post_data['invoiceEmailVal'], 'stores', $storeId);
3019
  }
3020
 
3021
- $salesEmailsAcion['successMessage'] = "Invoice Email updated On ".$storeName." Store.";
3022
  Mage::getConfig()->reinit();
3023
  Mage::app()->reinitStores();
3024
  }
3025
-
3026
-
3027
-
3028
-
3029
- //Invoice Email Template
3030
  $newOrderInvoiceEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/invoice/template', $storeId);
3031
 
3032
  $newOrderInvoiceEmailTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -3040,39 +3123,40 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3040
  {
3041
  if($value['value'] == $newOrderInvoiceEmailTemplateSelectedValue)
3042
  {
3043
- $newOrderEmailTemArr['label'] = $value['label'];
3044
  $newOrderEmailTemArr['value'] = $value['value'];
3045
  $newOrderEmailTemArr['status'] = 1;
3046
  $salesEmailsAcion['newOrderInvoiceEmailTempColl'][] = $newOrderEmailTemArr;
3047
  }
3048
  else
3049
  {
3050
- $newOrderEmailTemArr['label'] = $value['label'];
3051
  $newOrderEmailTemArr['value'] = $value['value'];
3052
  $newOrderEmailTemArr['status'] = 0;
3053
  $salesEmailsAcion['newOrderInvoiceEmailTempColl'][] = $newOrderEmailTemArr;
3054
  }
3055
  }
3056
  //echo $post_data['emailTemplateVal']."***";
3057
- if(isset($post_data['newOrderInvoiceEmailTemplateVal']))
 
 
 
 
 
3058
  {
3059
  if($storeId == 0)
3060
  {
3061
- Mage::getConfig()->saveConfig('sales_email/invoice/template', $post_data['newOrderInvoiceEmailTemplateVal'], 'default', $storeId);
3062
  }
3063
  else
3064
  {
3065
- Mage::getConfig()->saveConfig('sales_email/invoice/template', $post_data['newOrderInvoiceEmailTemplateVal'], 'stores', $storeId);
3066
  }
3067
 
3068
- $salesEmailsAcion['successMessage'] = "Invoice Email Template updated On ".$storeName." Store.";
3069
  Mage::getConfig()->reinit();
3070
  Mage::app()->reinitStores();
3071
  }
3072
-
3073
-
3074
-
3075
- //Invoice Email Template for Guest
3076
  $forGuestInvoiceEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/invoice/guest_template', $storeId);
3077
 
3078
  $newOrderInvoiceEmailGuestTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -3087,40 +3171,25 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3087
  {
3088
  if($value['value'] == $forGuestInvoiceEmailTemplateSelectedValue)
3089
  {
3090
- $forGuestOrderEmailTemArr['label'] = $value['label'];
3091
  $forGuestOrderEmailTemArr['value'] = $value['value'];
3092
  $forGuestOrderEmailTemArr['status'] = 1;
3093
  $salesEmailsAcion['newOrderInvoiceForGuestColl'][] = $forGuestOrderEmailTemArr;
3094
  }
3095
  else
3096
  {
3097
- $forGuestOrderEmailTemArr['label'] = $value['label'];
3098
  $forGuestOrderEmailTemArr['value'] = $value['value'];
3099
  $forGuestOrderEmailTemArr['status'] = 0;
3100
  $salesEmailsAcion['newOrderInvoiceForGuestColl'][] = $forGuestOrderEmailTemArr;
3101
  }
3102
  }
3103
  //echo $post_data['emailTemplateVal']."***";
3104
- if(isset($post_data['newOrderInvoiceForGuestVal']))
3105
- {
3106
- if($storeId == 0)
3107
- {
3108
- Mage::getConfig()->saveConfig('sales_email/invoice/guest_template', $post_data['newOrderInvoiceForGuestVal'], 'default', $storeId);
3109
- }
3110
- else
3111
- {
3112
- Mage::getConfig()->saveConfig('sales_email/invoice/guest_template', $post_data['newOrderInvoiceForGuestVal'], 'stores', $storeId);
3113
- }
3114
-
3115
- $salesEmailsAcion['successMessage'] = "Invoice Email Template for Guest updated On ".$storeName." Store.";
3116
- Mage::getConfig()->reinit();
3117
- Mage::app()->reinitStores();
3118
- }
3119
 
3120
 
3121
 
3122
  //Send Invoice Email Copy To
3123
- $salesEmailsAcion['emailInvoiceCopyToSelectedValue'] = Mage::getStoreConfig('sales_email/invoice/copy_to', $storeId);
3124
  if(isset($post_data['emailInvoiceCopyToVal']))
3125
  {
3126
  if($storeId == 0)
@@ -3136,10 +3205,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3136
  Mage::getConfig()->reinit();
3137
  Mage::app()->reinitStores();
3138
  }
 
 
3139
 
3140
 
3141
  //Send Invoice Email Copy Method
3142
- $salesEmailsAcion['orderInvoiceEmailCopySelectedValue'] = Mage::getStoreConfig('sales_email/invoice/copy_method', $storeId);
3143
  if(isset($post_data['orderInvoiceEmailCopyVal']))
3144
  {
3145
  if($storeId == 0)
@@ -3155,6 +3225,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3155
  Mage::getConfig()->reinit();
3156
  Mage::app()->reinitStores();
3157
  }
 
 
3158
 
3159
  // echo "<pre>"; print_r($salesEmailsAcion); die;
3160
  $jsonData = Mage::helper('core')->jsonEncode($salesEmailsAcion);
@@ -3197,7 +3269,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3197
  //Invoice Comments
3198
 
3199
  //Enabled
3200
- $salesEmailsAcion['salesEmailInvoiceCommentEnableSelectedValue'] = Mage::getStoreConfig('sales_email/invoice_comment/enabled', $storeId);
3201
  if(isset($post_data['salesEmailInvoiceCommentEnableVal']))
3202
  {
3203
  if($storeId == 0)
@@ -3213,9 +3284,26 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3213
  Mage::getConfig()->reinit();
3214
  Mage::app()->reinitStores();
3215
  }
 
 
3216
 
3217
 
3218
  //Invoice Comment Email Sender
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3219
  $invoiceCommentEmailSelectedValue = Mage::getStoreConfig('sales_email/invoice_comment/identity', $storeId);
3220
 
3221
  foreach ($this->emailSendersListArray() as $value)
@@ -3237,26 +3325,24 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3237
 
3238
  }
3239
 
3240
- if(isset($post_data['invoiceCommentEmailVal']))
 
 
 
3241
  {
3242
  if($storeId == 0)
3243
  {
3244
- Mage::getConfig()->saveConfig('sales_email/invoice_comment/identity', $post_data['invoiceCommentEmailVal'], 'default', $storeId);
3245
  }
3246
  else
3247
  {
3248
- Mage::getConfig()->saveConfig('sales_email/invoice_comment/identity', $post_data['invoiceCommentEmailVal'], 'stores', $storeId);
3249
  }
3250
 
3251
- $salesEmailsAcion['successMessage'] = "Invoice Comment Email Sender updated On ".$storeName." Store.";
3252
  Mage::getConfig()->reinit();
3253
  Mage::app()->reinitStores();
3254
  }
3255
-
3256
-
3257
-
3258
-
3259
- //Invoice Comment Email Template
3260
  $newOrderInvoiceCommentEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/invoice_comment/template', $storeId);
3261
 
3262
  $newOrderInvoiceCommentEmailTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -3270,39 +3356,40 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3270
  {
3271
  if($value['value'] == $newOrderInvoiceCommentEmailTemplateSelectedValue)
3272
  {
3273
- $newOrderEmailTemArr['label'] = $value['label'];
3274
  $newOrderEmailTemArr['value'] = $value['value'];
3275
  $newOrderEmailTemArr['status'] = 1;
3276
  $salesEmailsAcion['newOrderInvoiceCommentEmailTempColl'][] = $newOrderEmailTemArr;
3277
  }
3278
  else
3279
  {
3280
- $newOrderEmailTemArr['label'] = $value['label'];
3281
  $newOrderEmailTemArr['value'] = $value['value'];
3282
  $newOrderEmailTemArr['status'] = 0;
3283
  $salesEmailsAcion['newOrderInvoiceCommentEmailTempColl'][] = $newOrderEmailTemArr;
3284
  }
3285
  }
3286
  //echo $post_data['emailTemplateVal']."***";
3287
- if(isset($post_data['newOrderInvoiceCommentEmailTemplateVal']))
 
 
 
 
 
3288
  {
3289
  if($storeId == 0)
3290
  {
3291
- Mage::getConfig()->saveConfig('sales_email/invoice_comment/template', $post_data['newOrderInvoiceCommentEmailTemplateVal'], 'default', $storeId);
3292
  }
3293
  else
3294
  {
3295
- Mage::getConfig()->saveConfig('sales_email/invoice_comment/template', $post_data['newOrderInvoiceCommentEmailTemplateVal'], 'stores', $storeId);
3296
  }
3297
 
3298
- $salesEmailsAcion['successMessage'] = "Invoice Comment Email Template updated On ".$storeName." Store.";
3299
  Mage::getConfig()->reinit();
3300
  Mage::app()->reinitStores();
3301
  }
3302
-
3303
-
3304
-
3305
- //Invoice Comment Email Template for Guest
3306
  $forGuestInvoiceCommentsEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/invoice_comment/guest_template', $storeId);
3307
 
3308
  $newOrderInvoiceCommentEmailGuestTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -3317,40 +3404,25 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3317
  {
3318
  if($value['value'] == $forGuestInvoiceCommentsEmailTemplateSelectedValue)
3319
  {
3320
- $forGuestOrderEmailTemArr['label'] = $value['label'];
3321
  $forGuestOrderEmailTemArr['value'] = $value['value'];
3322
  $forGuestOrderEmailTemArr['status'] = 1;
3323
  $salesEmailsAcion['newOrderInvoiceCommentsForGuestColl'][] = $forGuestOrderEmailTemArr;
3324
  }
3325
  else
3326
  {
3327
- $forGuestOrderEmailTemArr['label'] = $value['label'];
3328
  $forGuestOrderEmailTemArr['value'] = $value['value'];
3329
  $forGuestOrderEmailTemArr['status'] = 0;
3330
  $salesEmailsAcion['newOrderInvoiceCommentsForGuestColl'][] = $forGuestOrderEmailTemArr;
3331
  }
3332
  }
3333
  //echo $post_data['emailTemplateVal']."***";
3334
- if(isset($post_data['newOrderInvoiceCommentsForGuestVal']))
3335
- {
3336
- if($storeId == 0)
3337
- {
3338
- Mage::getConfig()->saveConfig('sales_email/invoice_comment/guest_template', $post_data['newOrderInvoiceCommentsForGuestVal'], 'default', $storeId);
3339
- }
3340
- else
3341
- {
3342
- Mage::getConfig()->saveConfig('sales_email/invoice_comment/guest_template', $post_data['newOrderInvoiceCommentsForGuestVal'], 'stores', $storeId);
3343
- }
3344
-
3345
- $salesEmailsAcion['successMessage'] = "Invoice Comment Email Template for Guest updated On ".$storeName." Store.";
3346
- Mage::getConfig()->reinit();
3347
- Mage::app()->reinitStores();
3348
- }
3349
 
3350
 
3351
 
3352
  //Send Invoice Comment Email Copy To
3353
- $salesEmailsAcion['emailInvoiceCommentsCopyToSelectedValue'] = Mage::getStoreConfig('sales_email/invoice_comment/copy_to', $storeId);
3354
  if(isset($post_data['emailInvoiceCommentCopyToVal']))
3355
  {
3356
  if($storeId == 0)
@@ -3366,10 +3438,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3366
  Mage::getConfig()->reinit();
3367
  Mage::app()->reinitStores();
3368
  }
 
 
3369
 
3370
 
3371
  //Send Invoice Comments Email Copy Method
3372
- $salesEmailsAcion['orderInvoiceCommentEmailCopySelectedValue'] = Mage::getStoreConfig('sales_email/invoice_comment/copy_method', $storeId);
3373
  if(isset($post_data['orderInvoiceCommentEmailCopyVal']))
3374
  {
3375
  if($storeId == 0)
@@ -3385,6 +3458,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3385
  Mage::getConfig()->reinit();
3386
  Mage::app()->reinitStores();
3387
  }
 
 
3388
 
3389
  // echo "<pre>"; print_r($salesEmailsAcion); die;
3390
  $jsonData = Mage::helper('core')->jsonEncode($salesEmailsAcion);
@@ -3427,7 +3502,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3427
  //Shipment
3428
 
3429
  //Enabled
3430
- $salesEmailsAcion['salesEmailShipmentEnableSelectedValue'] = Mage::getStoreConfig('sales_email/shipment/enabled', $storeId);
3431
  if(isset($post_data['salesEmailShipmentEnableVal']))
3432
  {
3433
  if($storeId == 0)
@@ -3443,9 +3517,26 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3443
  Mage::getConfig()->reinit();
3444
  Mage::app()->reinitStores();
3445
  }
 
 
3446
 
3447
 
3448
  //Shipment Email Sender
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3449
  $shipmentEmailSelectedValue = Mage::getStoreConfig('sales_email/shipment/identity', $storeId);
3450
 
3451
  foreach ($this->emailSendersListArray() as $value)
@@ -3467,26 +3558,25 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3467
 
3468
  }
3469
 
3470
- if(isset($post_data['shipmentEmailVal']))
 
 
 
 
3471
  {
3472
  if($storeId == 0)
3473
  {
3474
- Mage::getConfig()->saveConfig('sales_email/shipment/identity', $post_data['shipmentEmailVal'], 'default', $storeId);
3475
  }
3476
  else
3477
  {
3478
- Mage::getConfig()->saveConfig('sales_email/shipment/identity', $post_data['shipmentEmailVal'], 'stores', $storeId);
3479
  }
3480
 
3481
- $salesEmailsAcion['successMessage'] = "Shipment Email Sender updated On ".$storeName." Store.";
3482
  Mage::getConfig()->reinit();
3483
  Mage::app()->reinitStores();
3484
  }
3485
-
3486
-
3487
-
3488
-
3489
- //Shipment Email Template
3490
  $newOrderShipmentEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/shipment/template', $storeId);
3491
 
3492
  $newOrderShipmentEmailTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -3500,39 +3590,40 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3500
  {
3501
  if($value['value'] == $newOrderShipmentEmailTemplateSelectedValue)
3502
  {
3503
- $newOrderEmailTemArr['label'] = $value['label'];
3504
  $newOrderEmailTemArr['value'] = $value['value'];
3505
  $newOrderEmailTemArr['status'] = 1;
3506
  $salesEmailsAcion['newOrderShipmentEmailTempColl'][] = $newOrderEmailTemArr;
3507
  }
3508
  else
3509
  {
3510
- $newOrderEmailTemArr['label'] = $value['label'];
3511
  $newOrderEmailTemArr['value'] = $value['value'];
3512
  $newOrderEmailTemArr['status'] = 0;
3513
  $salesEmailsAcion['newOrderShipmentEmailTempColl'][] = $newOrderEmailTemArr;
3514
  }
3515
  }
3516
  //echo $post_data['emailTemplateVal']."***";
3517
- if(isset($post_data['newOrderShipmentEmailTemplateVal']))
 
 
 
 
 
3518
  {
3519
  if($storeId == 0)
3520
  {
3521
- Mage::getConfig()->saveConfig('sales_email/shipment/template', $post_data['newOrderShipmentEmailTemplateVal'], 'default', $storeId);
3522
  }
3523
  else
3524
  {
3525
- Mage::getConfig()->saveConfig('sales_email/shipment/template', $post_data['newOrderShipmentEmailTemplateVal'], 'stores', $storeId);
3526
  }
3527
 
3528
- $salesEmailsAcion['successMessage'] = "Shipment Email Template updated On ".$storeName." Store.";
3529
  Mage::getConfig()->reinit();
3530
  Mage::app()->reinitStores();
3531
  }
3532
-
3533
-
3534
-
3535
- //Shipment Email Template for Guest
3536
  $forGuestShipmentEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/shipment/guest_template', $storeId);
3537
 
3538
  $newOrderShipmentEmailGuestTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -3547,40 +3638,25 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3547
  {
3548
  if($value['value'] == $forGuestShipmentEmailTemplateSelectedValue)
3549
  {
3550
- $forGuestOrderEmailTemArr['label'] = $value['label'];
3551
  $forGuestOrderEmailTemArr['value'] = $value['value'];
3552
  $forGuestOrderEmailTemArr['status'] = 1;
3553
  $salesEmailsAcion['newOrderShipmentForGuestColl'][] = $forGuestOrderEmailTemArr;
3554
  }
3555
  else
3556
  {
3557
- $forGuestOrderEmailTemArr['label'] = $value['label'];
3558
  $forGuestOrderEmailTemArr['value'] = $value['value'];
3559
  $forGuestOrderEmailTemArr['status'] = 0;
3560
  $salesEmailsAcion['newOrderShipmentForGuestColl'][] = $forGuestOrderEmailTemArr;
3561
  }
3562
  }
3563
  //echo $post_data['emailTemplateVal']."***";
3564
- if(isset($post_data['newOrderShipmentForGuestVal']))
3565
- {
3566
- if($storeId == 0)
3567
- {
3568
- Mage::getConfig()->saveConfig('sales_email/shipment/guest_template', $post_data['newOrderShipmentForGuestVal'], 'default', $storeId);
3569
- }
3570
- else
3571
- {
3572
- Mage::getConfig()->saveConfig('sales_email/shipment/guest_template', $post_data['newOrderShipmentForGuestVal'], 'stores', $storeId);
3573
- }
3574
-
3575
- $salesEmailsAcion['successMessage'] = "Shipment Email Template for Guest updated On ".$storeName." Store.";
3576
- Mage::getConfig()->reinit();
3577
- Mage::app()->reinitStores();
3578
- }
3579
 
3580
 
3581
 
3582
  //Send Shipment Email Copy To
3583
- $salesEmailsAcion['emailShipmentCopyToSelectedValue'] = Mage::getStoreConfig('sales_email/shipment/copy_to', $storeId);
3584
  if(isset($post_data['emailShipmentCopyToVal']))
3585
  {
3586
  if($storeId == 0)
@@ -3596,10 +3672,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3596
  Mage::getConfig()->reinit();
3597
  Mage::app()->reinitStores();
3598
  }
 
 
3599
 
3600
 
3601
  //Send Shipment Email Copy Method
3602
- $salesEmailsAcion['orderShipmentEmailCopySelectedValue'] = Mage::getStoreConfig('sales_email/shipment/copy_method', $storeId);
3603
  if(isset($post_data['orderShipmentEmailCopyVal']))
3604
  {
3605
  if($storeId == 0)
@@ -3615,6 +3692,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3615
  Mage::getConfig()->reinit();
3616
  Mage::app()->reinitStores();
3617
  }
 
 
3618
 
3619
  // echo "<pre>"; print_r($salesEmailsAcion); die;
3620
  $jsonData = Mage::helper('core')->jsonEncode($salesEmailsAcion);
@@ -3657,7 +3736,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3657
  //Shipment Comments
3658
 
3659
  //Enabled
3660
- $salesEmailsAcion['salesEmailShipmentCommentsEnableSelectedValue'] = Mage::getStoreConfig('sales_email/shipment_comment/enabled', $storeId);
3661
  if(isset($post_data['salesEmailShipmentCommentsEnableVal']))
3662
  {
3663
  if($storeId == 0)
@@ -3673,19 +3751,36 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3673
  Mage::getConfig()->reinit();
3674
  Mage::app()->reinitStores();
3675
  }
 
 
3676
 
3677
 
3678
  //Shipment Comment Email Sender
3679
- $shipmentCommentsEmailSelectedValue = Mage::getStoreConfig('sales_email/shipment_comment/identity', $storeId);
3680
-
3681
- foreach ($this->emailSendersListArray() as $value)
3682
  {
3683
- if($value['value'] == $shipmentCommentsEmailSelectedValue)
3684
  {
3685
- $emailComArr['label'] = $value['label'];
3686
- $emailComArr['value'] = $value['value'];
3687
- $emailComArr['status'] = 1;
3688
- $salesEmailsAcion['shipmentCommentsEmailList'][] = $emailComArr;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3689
  }
3690
  else
3691
  {
@@ -3697,26 +3792,24 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3697
 
3698
  }
3699
 
3700
- if(isset($post_data['shipmentCommentsEmailVal']))
 
 
 
3701
  {
3702
  if($storeId == 0)
3703
  {
3704
- Mage::getConfig()->saveConfig('sales_email/shipment_comment/identity', $post_data['shipmentCommentsEmailVal'], 'default', $storeId);
3705
  }
3706
  else
3707
  {
3708
- Mage::getConfig()->saveConfig('sales_email/shipment_comment/identity', $post_data['shipmentCommentsEmailVal'], 'stores', $storeId);
3709
  }
3710
 
3711
- $salesEmailsAcion['successMessage'] = "Shipment Comment Email Sender updated On ".$storeName." Store.";
3712
  Mage::getConfig()->reinit();
3713
  Mage::app()->reinitStores();
3714
  }
3715
-
3716
-
3717
-
3718
-
3719
- //Shipment Comment Email Template
3720
  $newOrderShipmentCommentsEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/shipment_comment/template', $storeId);
3721
 
3722
  $newOrderShipmentCommentsEmailTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -3730,39 +3823,41 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3730
  {
3731
  if($value['value'] == $newOrderShipmentCommentsEmailTemplateSelectedValue)
3732
  {
3733
- $newOrderEmailTemArr['label'] = $value['label'];
3734
  $newOrderEmailTemArr['value'] = $value['value'];
3735
  $newOrderEmailTemArr['status'] = 1;
3736
  $salesEmailsAcion['newOrderShipmentCommentsEmailTempColl'][] = $newOrderEmailTemArr;
3737
  }
3738
  else
3739
  {
3740
- $newOrderEmailTemArr['label'] = $value['label'];
3741
  $newOrderEmailTemArr['value'] = $value['value'];
3742
  $newOrderEmailTemArr['status'] = 0;
3743
  $salesEmailsAcion['newOrderShipmentCommentsEmailTempColl'][] = $newOrderEmailTemArr;
3744
  }
3745
  }
3746
  //echo $post_data['emailTemplateVal']."***";
3747
- if(isset($post_data['newOrderShipmentCommentsEmailTemplateVal']))
 
 
 
 
 
3748
  {
3749
  if($storeId == 0)
3750
  {
3751
- Mage::getConfig()->saveConfig('sales_email/shipment_comment/template', $post_data['newOrderShipmentCommentsEmailTemplateVal'], 'default', $storeId);
3752
  }
3753
  else
3754
  {
3755
- Mage::getConfig()->saveConfig('sales_email/shipment_comment/template', $post_data['newOrderShipmentCommentsEmailTemplateVal'], 'stores', $storeId);
3756
  }
3757
 
3758
- $salesEmailsAcion['successMessage'] = "Shipment Comment Email Template updated On ".$storeName." Store.";
3759
  Mage::getConfig()->reinit();
3760
  Mage::app()->reinitStores();
3761
  }
3762
 
3763
-
3764
-
3765
- //Shipment Comment Email Template for Guest
3766
  $forGuestShipmentCommentsEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/shipment_comment/guest_template', $storeId);
3767
 
3768
  $newOrderShipmentCommentsEmailGuestTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -3777,40 +3872,25 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3777
  {
3778
  if($value['value'] == $forGuestShipmentCommentsEmailTemplateSelectedValue)
3779
  {
3780
- $forGuestOrderEmailTemArr['label'] = $value['label'];
3781
  $forGuestOrderEmailTemArr['value'] = $value['value'];
3782
  $forGuestOrderEmailTemArr['status'] = 1;
3783
  $salesEmailsAcion['newOrderShipmentCommentsForGuestColl'][] = $forGuestOrderEmailTemArr;
3784
  }
3785
  else
3786
  {
3787
- $forGuestOrderEmailTemArr['label'] = $value['label'];
3788
  $forGuestOrderEmailTemArr['value'] = $value['value'];
3789
  $forGuestOrderEmailTemArr['status'] = 0;
3790
  $salesEmailsAcion['newOrderShipmentCommentsForGuestColl'][] = $forGuestOrderEmailTemArr;
3791
  }
3792
  }
3793
  //echo $post_data['emailTemplateVal']."***";
3794
- if(isset($post_data['newOrderShipmentCommentsForGuestVal']))
3795
- {
3796
- if($storeId == 0)
3797
- {
3798
- Mage::getConfig()->saveConfig('sales_email/shipment_comment/guest_template', $post_data['newOrderShipmentCommentsForGuestVal'], 'default', $storeId);
3799
- }
3800
- else
3801
- {
3802
- Mage::getConfig()->saveConfig('sales_email/shipment_comment/guest_template', $post_data['newOrderShipmentCommentsForGuestVal'], 'stores', $storeId);
3803
- }
3804
-
3805
- $salesEmailsAcion['successMessage'] = "Shipment Comment Email Template for Guest updated On ".$storeName." Store.";
3806
- Mage::getConfig()->reinit();
3807
- Mage::app()->reinitStores();
3808
- }
3809
 
3810
 
3811
 
3812
  //Send Shipment Comment Email Copy To
3813
- $salesEmailsAcion['emailShipmentCommentsCopyToSelectedValue'] = Mage::getStoreConfig('sales_email/shipment_comment/copy_to', $storeId);
3814
  if(isset($post_data['emailShipmentCommentsCopyToVal']))
3815
  {
3816
  if($storeId == 0)
@@ -3826,10 +3906,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3826
  Mage::getConfig()->reinit();
3827
  Mage::app()->reinitStores();
3828
  }
 
 
3829
 
3830
 
3831
  //Send Shipment Comments Email Copy Method
3832
- $salesEmailsAcion['orderShipmentCommentsEmailCopySelectedValue'] = Mage::getStoreConfig('sales_email/shipment_comment/copy_method', $storeId);
3833
  if(isset($post_data['orderShipmentCommentsEmailCopyVal']))
3834
  {
3835
  if($storeId == 0)
@@ -3845,6 +3926,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3845
  Mage::getConfig()->reinit();
3846
  Mage::app()->reinitStores();
3847
  }
 
 
3848
 
3849
  // echo "<pre>"; print_r($salesEmailsAcion); die;
3850
  $jsonData = Mage::helper('core')->jsonEncode($salesEmailsAcion);
@@ -3887,7 +3970,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3887
  //Credit Memo
3888
 
3889
  //Enabled
3890
- $salesEmailsAcion['salesEmailCreditMemoEnableSelectedValue'] = Mage::getStoreConfig('sales_email/creditmemo/enabled', $storeId);
3891
  if(isset($post_data['salesEmailCreditMemoEnableVal']))
3892
  {
3893
  if($storeId == 0)
@@ -3903,9 +3985,27 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3903
  Mage::getConfig()->reinit();
3904
  Mage::app()->reinitStores();
3905
  }
 
 
3906
 
3907
 
3908
  //Credit Memo Email Sender
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3909
  $creditMemoEmailSelectedValue = Mage::getStoreConfig('sales_email/creditmemo/identity', $storeId);
3910
 
3911
  foreach ($this->emailSendersListArray() as $value)
@@ -3927,26 +4027,25 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3927
 
3928
  }
3929
 
3930
- if(isset($post_data['creditMemoEmailVal']))
 
 
 
3931
  {
3932
  if($storeId == 0)
3933
  {
3934
- Mage::getConfig()->saveConfig('sales_email/creditmemo/identity', $post_data['creditMemoEmailVal'], 'default', $storeId);
3935
  }
3936
  else
3937
  {
3938
- Mage::getConfig()->saveConfig('sales_email/creditmemo/identity', $post_data['creditMemoEmailVal'], 'stores', $storeId);
3939
  }
3940
 
3941
- $salesEmailsAcion['successMessage'] = "Credit Memo Email Sender updated On ".$storeName." Store.";
3942
  Mage::getConfig()->reinit();
3943
  Mage::app()->reinitStores();
3944
  }
3945
 
3946
-
3947
-
3948
-
3949
- //Credit Memo Email Template
3950
  $newOrderCreditMemoEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/creditmemo/template', $storeId);
3951
 
3952
  $newOrderCreditMemoEmailTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -3960,39 +4059,41 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
3960
  {
3961
  if($value['value'] == $newOrderCreditMemoEmailTemplateSelectedValue)
3962
  {
3963
- $newOrderEmailTemArr['label'] = $value['label'];
3964
  $newOrderEmailTemArr['value'] = $value['value'];
3965
  $newOrderEmailTemArr['status'] = 1;
3966
  $salesEmailsAcion['newOrderCreditMemoEmailTempColl'][] = $newOrderEmailTemArr;
3967
  }
3968
  else
3969
  {
3970
- $newOrderEmailTemArr['label'] = $value['label'];
3971
  $newOrderEmailTemArr['value'] = $value['value'];
3972
  $newOrderEmailTemArr['status'] = 0;
3973
  $salesEmailsAcion['newOrderCreditMemoEmailTempColl'][] = $newOrderEmailTemArr;
3974
  }
3975
  }
3976
  //echo $post_data['emailTemplateVal']."***";
3977
- if(isset($post_data['newOrderCreditMemoEmailTemplateVal']))
 
 
 
 
 
3978
  {
3979
  if($storeId == 0)
3980
  {
3981
- Mage::getConfig()->saveConfig('sales_email/creditmemo/template', $post_data['newOrderCreditMemoEmailTemplateVal'], 'default', $storeId);
3982
  }
3983
  else
3984
  {
3985
- Mage::getConfig()->saveConfig('sales_email/creditmemo/template', $post_data['newOrderCreditMemoEmailTemplateVal'], 'stores', $storeId);
3986
  }
3987
 
3988
- $salesEmailsAcion['successMessage'] = "Credit Memo Email Template updated On ".$storeName." Store.";
3989
  Mage::getConfig()->reinit();
3990
  Mage::app()->reinitStores();
3991
  }
3992
 
3993
-
3994
-
3995
- //Credit Memo Email Template for Guest
3996
  $forGuestCreditMemoEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/creditmemo/guest_template', $storeId);
3997
 
3998
  $newOrderCreditMemoEmailGuestTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -4007,40 +4108,25 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
4007
  {
4008
  if($value['value'] == $forGuestCreditMemoEmailTemplateSelectedValue)
4009
  {
4010
- $forGuestOrderEmailTemArr['label'] = $value['label'];
4011
  $forGuestOrderEmailTemArr['value'] = $value['value'];
4012
  $forGuestOrderEmailTemArr['status'] = 1;
4013
  $salesEmailsAcion['newOrderCreditMemoForGuestColl'][] = $forGuestOrderEmailTemArr;
4014
  }
4015
  else
4016
  {
4017
- $forGuestOrderEmailTemArr['label'] = $value['label'];
4018
  $forGuestOrderEmailTemArr['value'] = $value['value'];
4019
  $forGuestOrderEmailTemArr['status'] = 0;
4020
  $salesEmailsAcion['newOrderCreditMemoForGuestColl'][] = $forGuestOrderEmailTemArr;
4021
  }
4022
  }
4023
  //echo $post_data['emailTemplateVal']."***";
4024
- if(isset($post_data['newOrderCreditMemoForGuestVal']))
4025
- {
4026
- if($storeId == 0)
4027
- {
4028
- Mage::getConfig()->saveConfig('sales_email/creditmemo/guest_template', $post_data['newOrderCreditMemoForGuestVal'], 'default', $storeId);
4029
- }
4030
- else
4031
- {
4032
- Mage::getConfig()->saveConfig('sales_email/creditmemo/guest_template', $post_data['newOrderCreditMemoForGuestVal'], 'stores', $storeId);
4033
- }
4034
-
4035
- $salesEmailsAcion['successMessage'] = "Credit Memo Email Template for Guest updated On ".$storeName." Store.";
4036
- Mage::getConfig()->reinit();
4037
- Mage::app()->reinitStores();
4038
- }
4039
 
4040
 
4041
 
4042
  //Send Credit Memo Email Copy To
4043
- $salesEmailsAcion['emailCreditMemoCopyToSelectedValue'] = Mage::getStoreConfig('sales_email/creditmemo/copy_to', $storeId);
4044
  if(isset($post_data['emailCreditMemoCopyToVal']))
4045
  {
4046
  if($storeId == 0)
@@ -4056,10 +4142,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
4056
  Mage::getConfig()->reinit();
4057
  Mage::app()->reinitStores();
4058
  }
 
 
4059
 
4060
 
4061
  //Send Credit Memo Email Copy Method
4062
- $salesEmailsAcion['orderCreditMemoEmailCopySelectedValue'] = Mage::getStoreConfig('sales_email/creditmemo/copy_method', $storeId);
4063
  if(isset($post_data['orderCreditMemoEmailCopyVal']))
4064
  {
4065
  if($storeId == 0)
@@ -4075,6 +4162,8 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
4075
  Mage::getConfig()->reinit();
4076
  Mage::app()->reinitStores();
4077
  }
 
 
4078
 
4079
  // echo "<pre>"; print_r($salesEmailsAcion); die;
4080
  $jsonData = Mage::helper('core')->jsonEncode($salesEmailsAcion);
@@ -4117,7 +4206,6 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
4117
  //Credit Memo Comments
4118
 
4119
  //Enabled
4120
- $salesEmailsAcion['salesEmailCreditMemoCommentsEnableSelectedValue'] = Mage::getStoreConfig('sales_email/creditmemo_comment/enabled', $storeId);
4121
  if(isset($post_data['salesEmailCreditMemoCommentsEnableVal']))
4122
  {
4123
  if($storeId == 0)
@@ -4133,9 +4221,27 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
4133
  Mage::getConfig()->reinit();
4134
  Mage::app()->reinitStores();
4135
  }
 
 
4136
 
4137
 
4138
  //Credit Memo Comment Email Sender
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4139
  $creditMemoCommentEmailSelectedValue = Mage::getStoreConfig('sales_email/creditmemo_comment/identity', $storeId);
4140
 
4141
  foreach ($this->emailSendersListArray() as $value)
@@ -4157,26 +4263,26 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
4157
 
4158
  }
4159
 
4160
- if(isset($post_data['creditMemoCommentEmailVal']))
 
 
 
 
4161
  {
4162
  if($storeId == 0)
4163
  {
4164
- Mage::getConfig()->saveConfig('sales_email/creditmemo_comment/identity', $post_data['creditMemoCommentEmailVal'], 'default', $storeId);
4165
  }
4166
  else
4167
  {
4168
- Mage::getConfig()->saveConfig('sales_email/creditmemo_comment/identity', $post_data['creditMemoCommentEmailVal'], 'stores', $storeId);
4169
  }
4170
 
4171
- $salesEmailsAcion['successMessage'] = "Credit Memo Comment Email Sender updated On ".$storeName." Store.";
4172
  Mage::getConfig()->reinit();
4173
  Mage::app()->reinitStores();
4174
  }
4175
 
4176
-
4177
-
4178
-
4179
- //Credit Memo Comment Email Template
4180
  $newOrderCreditMemoCommentEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/creditmemo_comment/template', $storeId);
4181
 
4182
  $newOrderCreditMemoCommentEmailTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -4190,39 +4296,41 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
4190
  {
4191
  if($value['value'] == $newOrderCreditMemoCommentEmailTemplateSelectedValue)
4192
  {
4193
- $newOrderEmailTemArr['label'] = $value['label'];
4194
  $newOrderEmailTemArr['value'] = $value['value'];
4195
  $newOrderEmailTemArr['status'] = 1;
4196
  $salesEmailsAcion['newOrderCreditMemoCommentsEmailTempColl'][] = $newOrderEmailTemArr;
4197
  }
4198
  else
4199
  {
4200
- $newOrderEmailTemArr['label'] = $value['label'];
4201
  $newOrderEmailTemArr['value'] = $value['value'];
4202
  $newOrderEmailTemArr['status'] = 0;
4203
  $salesEmailsAcion['newOrderCreditMemoCommentsEmailTempColl'][] = $newOrderEmailTemArr;
4204
  }
4205
  }
4206
  //echo $post_data['emailTemplateVal']."***";
4207
- if(isset($post_data['newOrderCreditMemoCommentsEmailTemplateVal']))
 
 
 
 
 
4208
  {
4209
  if($storeId == 0)
4210
  {
4211
- Mage::getConfig()->saveConfig('sales_email/creditmemo_comment/template', $post_data['newOrderCreditMemoCommentsEmailTemplateVal'], 'default', $storeId);
4212
  }
4213
  else
4214
  {
4215
- Mage::getConfig()->saveConfig('sales_email/creditmemo_comment/template', $post_data['newOrderCreditMemoCommentsEmailTemplateVal'], 'stores', $storeId);
4216
  }
4217
 
4218
- $salesEmailsAcion['successMessage'] = "Credit Memo Comment Email Template updated On ".$storeName." Store.";
4219
  Mage::getConfig()->reinit();
4220
  Mage::app()->reinitStores();
4221
  }
4222
 
4223
-
4224
-
4225
- //Credit Memo Comment Email Template for Guest
4226
  $forGuestCreditMemoCommentsEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/creditmemo_comment/guest_template', $storeId);
4227
 
4228
  $newOrderCreditMemoCommentsEmailGuestTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
@@ -4237,40 +4345,25 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
4237
  {
4238
  if($value['value'] == $forGuestCreditMemoCommentsEmailTemplateSelectedValue)
4239
  {
4240
- $forGuestOrderEmailTemArr['label'] = $value['label'];
4241
  $forGuestOrderEmailTemArr['value'] = $value['value'];
4242
  $forGuestOrderEmailTemArr['status'] = 1;
4243
  $salesEmailsAcion['newOrderCreditMemoCommentsForGuestColl'][] = $forGuestOrderEmailTemArr;
4244
  }
4245
  else
4246
  {
4247
- $forGuestOrderEmailTemArr['label'] = $value['label'];
4248
  $forGuestOrderEmailTemArr['value'] = $value['value'];
4249
  $forGuestOrderEmailTemArr['status'] = 0;
4250
  $salesEmailsAcion['newOrderCreditMemoCommentsForGuestColl'][] = $forGuestOrderEmailTemArr;
4251
  }
4252
  }
4253
  //echo $post_data['emailTemplateVal']."***";
4254
- if(isset($post_data['newOrderCreditMemoCommentsForGuestVal']))
4255
- {
4256
- if($storeId == 0)
4257
- {
4258
- Mage::getConfig()->saveConfig('sales_email/creditmemo_comment/guest_template', $post_data['newOrderCreditMemoCommentsForGuestVal'], 'default', $storeId);
4259
- }
4260
- else
4261
- {
4262
- Mage::getConfig()->saveConfig('sales_email/creditmemo_comment/guest_template', $post_data['newOrderCreditMemoCommentsForGuestVal'], 'stores', $storeId);
4263
- }
4264
-
4265
- $salesEmailsAcion['successMessage'] = "Credit Memo Comment Email Template for Guest updated On ".$storeName." Store.";
4266
- Mage::getConfig()->reinit();
4267
- Mage::app()->reinitStores();
4268
- }
4269
 
4270
 
4271
 
4272
  //Send Credit Memo Comment Email Copy To
4273
- $salesEmailsAcion['emailCreditMemoCommentsCopyToSelectedValue'] = Mage::getStoreConfig('sales_email/creditmemo_comment/copy_to', $storeId);
4274
  if(isset($post_data['emailCreditMemoCommentsCopyToVal']))
4275
  {
4276
  if($storeId == 0)
@@ -4287,9 +4380,11 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
4287
  Mage::app()->reinitStores();
4288
  }
4289
 
 
 
 
4290
 
4291
  //Send Credit Memo Comments Email Copy Method
4292
- $salesEmailsAcion['orderCreditMemoCommentsEmailCopySelectedValue'] = Mage::getStoreConfig('sales_email/creditmemo_comment/copy_method', $storeId);
4293
  if(isset($post_data['orderCreditMemoCommentsEmailCopyVal']))
4294
  {
4295
  if($storeId == 0)
@@ -4306,6 +4401,9 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
4306
  Mage::app()->reinitStores();
4307
  }
4308
 
 
 
 
4309
  // echo "<pre>"; print_r($salesEmailsAcion); die;
4310
  $jsonData = Mage::helper('core')->jsonEncode($salesEmailsAcion);
4311
  return Mage::app()->getResponse()->setBody($jsonData);
@@ -4356,12 +4454,12 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
4356
  if(Mage::helper('mobileadmin')->isEnable()) // check extension if enabled or not
4357
  {
4358
  $post_data = Mage::app()->getRequest()->getParams();
4359
- // $sessionId = $post_data['session'];
4360
- // if (!Mage::getSingleton('api/session')->isLoggedIn($sessionId)) // check session if not, will return false
4361
- // {
4362
- // echo $this->__("The Login has expired. Please try log in again.");
4363
- // return false;
4364
- // }
4365
 
4366
  try
4367
  {
@@ -4371,8 +4469,20 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
4371
  //Tax Classes
4372
 
4373
  //Tax Class for Shipping
 
 
 
 
 
 
 
 
 
 
4374
  $taxArr = Mage::getModel('tax/class_source_product')->toOptionArray();
 
4375
  $taxClassForShippingSelectedValue = Mage::getStoreConfig('tax/classes/shipping_tax_class');
 
4376
  foreach ($taxArr as $value)
4377
  {
4378
  if($value['value'] == $taxClassForShippingSelectedValue)
@@ -4389,52 +4499,902 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
4389
  $taxNewArr['status'] = 0;
4390
  $saleTaxAcion['taxClassForShippingList'][] = $taxNewArr;
4391
  }
4392
- }
4393
-
4394
- if(isset($post_data['taxClassForShippingVal']))
4395
- {
4396
- Mage::getConfig()->saveConfig('tax/classes/shipping_tax_class', $post_data['taxClassForShippingVal'], 'default', 0);
4397
 
4398
- $saleTaxAcion['successMessage'] = "Tax Class for Shipping Saved On ".$storeName." Store.";
4399
- Mage::getConfig()->reinit();
4400
- Mage::app()->reinitStores();
4401
- }
4402
-
4403
 
4404
 
4405
  //Calculation Settings
4406
 
4407
  //Tax Calculation Method Based On
 
 
 
 
 
 
 
 
 
4408
  $taxCalculationMethodSelectedValue = Mage::getStoreConfig('tax/calculation/algorithm');
4409
- $taxCalculationMethod = new Mage_Tax_Model_System_Config_Source_Algorithm();
4410
  foreach ($taxCalculationMethod->toOptionArray() as $value)
4411
  {
4412
- if($value['value'] == $taxCalculationMethodSelectedValue)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4413
  {
4414
- $taxCalculationArr['value'] = $value['value'];
4415
- $taxCalculationArr['label'] = $value['label'];
4416
- $taxCalculationArr['status'] = 1;
4417
- $saleTaxAcion['status'] = 1;
4418
  }
4419
  else
4420
  {
4421
- $taxCalculationArr['value'] = $value['value'];
4422
- $taxCalculationArr['label'] = $value['label'];
4423
- $taxCalculationArr['status'] = 0;
 
4424
  }
4425
  }
4426
 
4427
- if(isset($post_data['taxCalculationMethodVal']))
 
 
4428
  {
4429
- Mage::getConfig()->saveConfig('tax/calculation/algorithm', $post_data['taxCalculationMethodVal'], 'default', 0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4430
 
4431
- $saleTaxAcion['successMessage'] = "Tax Calculation Method Based On Saved On ".$storeName." Store.";
4432
  Mage::getConfig()->reinit();
4433
  Mage::app()->reinitStores();
4434
  }
4435
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4436
 
4437
- echo "<pre>"; print_r($saleTaxAcion); die;
4438
  $jsonData = Mage::helper('core')->jsonEncode($saleTaxAcion);
4439
  return Mage::app()->getResponse()->setBody($jsonData);
4440
  }
@@ -4455,5 +5415,57 @@ class EmizenTech_MobileAdmin_ConfigurationController extends Mage_Core_Controlle
4455
 
4456
  /***** End Sales TAX section ******/
4457
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4458
  }
4459
  ?>
28
  // Default countries Process
29
  $countryAcion['countries'] = Mage::getModel('directory/country')->getResourceCollection()->load()->toOptionArray(false);
30
 
31
+ //$countryValue = $post_data['countryVal'];
32
+ if(isset($post_data['countryVal']))
 
 
 
 
 
 
33
  {
34
  if($storeId == 0)
35
  {
36
+ Mage::getConfig()->saveConfig('general/country/default', $post_data['countryVal']);
37
+ Mage::getConfig()->saveConfig('general/country/default', $post_data['countryVal'], 'stores', $storeId);
38
  }
39
  else
40
  {
47
  Mage::getConfig()->reinit();
48
  Mage::app()->reinitStores();
49
  }
50
+ $countryAcion['selectedCountryValue'] = Mage::getStoreConfig('general/country/default', $storeId);
51
+
52
+ //Mage::log($countryAcion['selectedCountryValue'],null,"cart_android.log");
53
+
54
+ $countryAcion['selectedCountryLabel'] = Mage::getModel("directory/country")->load($countryAcion['selectedCountryValue'])->getName();
55
+ //Mage::log($countryAcion['selectedCountryLabel'],null,"cart_android.log");
56
+
57
 
58
 
59
  // Allow Countries Process
60
+ //Mage::log($countryAcion['allowCountriesStatus'],null,"cart_android.log");
61
+ //$allowCountriesValue = $post_data['allowCountryVal'];
62
+ if(isset($post_data['allowCountryVal']))
63
+ {
64
+ $csv = implode(",", $post_data['allowCountryVal']);
65
+ // Mage::log($storeId,null,"cart_android.log");
66
+ // Mage::log($csv,null,"cart_android.log");
67
+ $config = Mage::getModel('core/config');
68
+ //Mage::getConfig()->saveConfig('general/country/allow', $csv, 'default', $storeId);
69
+ if($storeId == 0)
70
+ {
71
+ Mage::getConfig()->saveConfig('general/country/allow', $csv, 'default', $storeId);
72
+ }
73
+ else
74
+ {
75
+ Mage::getConfig()->saveConfig('general/country/allow', $csv, 'stores', $storeId);
76
+ }
77
+ $countryAcion['successMessage'] = "Allow Countries Has Been Saved On ".$storeName." Store.";
78
+ //Mage::log($countryAcion['successMessage'],null,"cart_android.log");
79
+ Mage::getConfig()->reinit();
80
+ Mage::app()->reinitStores();
81
+ }
82
  $allowCountriesSelectedValue = Mage::getStoreConfig('general/country/allow', $storeId);
83
  $explodedVal = explode(",", $allowCountriesSelectedValue);
84
  foreach ($explodedVal as $value)
105
  $countryAcion['allowCountriesStatus'][] = $counVal;
106
  }
107
  }
108
+
109
+
110
+
111
+ //Postal Code is Optional for the following countries Pocess
112
+ //$postalCountriesValue = $post_data['postalCountryVal'];
113
+ if(isset($post_data['postalCountryVal']))
114
  {
115
+ $csv = implode(",", $post_data['postalCountryVal']);
116
+ //Mage::log($csv,null,"cart_android.log");
 
117
  $config = Mage::getModel('core/config');
118
+ Mage::getConfig()->saveConfig('general/country/optional_zip_countries', $csv, 'default', 0);
119
+ $countryAcion['successMessage'] = "Postal Code Has Been Saved For The Following Countries On ".$storeName." Store.";
 
 
 
 
 
 
 
 
 
120
  Mage::getConfig()->reinit();
121
  Mage::app()->reinitStores();
122
  }
123
+ $postalCodeSelectedValue = Mage::getStoreConfig('general/country/optional_zip_countries');
 
 
 
 
124
  $postalExplodedVal = explode(",", $postalCodeSelectedValue);
125
  foreach ($postalExplodedVal as $value)
126
  {
145
  }
146
  }
147
 
148
+
149
+
150
+ //European Union Countries
151
+ //$unionCountriesValue = $post_data['unionCountryVal'];
152
+ if(isset($post_data['unionCountryVal']))
153
  {
154
+ $csv = implode(",", $post_data['unionCountryVal']);
155
  //Mage::log($csv,null,"cart_android.log");
156
+ //$config = Mage::getModel('core/config');
157
+ Mage::getConfig()->saveConfig('general/country/eu_countries', $csv, 'default', $storeId);
158
+ $countryAcion['successMessage'] = "European Union Countries Has Been Saved On ".$storeName." Store.";
159
  Mage::getConfig()->reinit();
160
  Mage::app()->reinitStores();
161
  }
 
 
 
 
162
  $unionCountriesValue = Mage::getStoreConfig('general/country/eu_countries', $storeId);
163
  $unionExplodedVal = explode(",", $unionCountriesValue);
164
  foreach ($unionExplodedVal as $value)
184
  }
185
  }
186
 
 
 
 
 
 
 
 
 
 
 
 
187
 
188
  //echo "<pre>"; print_r($countryAcion); die;
189
  $jsonData = Mage::helper('core')->jsonEncode($countryAcion);
226
  // State is required for
227
  $statesCountries = Mage::getModel('directory/country')->getResourceCollection()->load()->toOptionArray(false);
228
 
229
+ //$statesCountriesValue = $post_data['statesCountryVal'];
230
+
231
+ if(isset($post_data['statesCountryVal']))
232
+ {
233
+ $csv = implode(",", $post_data['statesCountryVal']);
234
+ //Mage::log($csv,null,"cart_android.log");
235
+ //Mage::getConfig()->saveConfig('general/region/state_required', $csv, 'default', $storeId);
236
+ Mage::getConfig()->saveConfig('general/region/state_required', $csv);
237
+ $statesAcion['successMessage'] = "State Has Been Saved For The Following Countries On ".$storeName." Store.";
238
+ Mage::getConfig()->reinit();
239
+ Mage::app()->reinitStores();
240
+ }
241
+
242
  $statesValue = Mage::getStoreConfig('general/region/state_required','default');
243
  $statesExplodedVal = explode(",", $statesValue);
244
 
268
  }
269
  }
270
 
 
 
 
 
 
 
 
 
 
 
 
 
271
 
272
  // Display not required State
 
 
 
 
273
  $statesReqValue = $post_data['statesReq'];
274
  if($statesReqValue == 0 || $statesReqValue == 1)
275
  {
280
  Mage::app()->reinitStores();
281
  }
282
 
283
+ $statesValueDisplay = Mage::getStoreConfig('general/region/display_all');
284
+
285
+ $statesAcion['statesDsiplayVal'] = $statesValueDisplay;
286
+
287
+
288
  //echo "<pre>"; print_r($statesExplodedVal); die;
289
  $jsonData = Mage::helper('core')->jsonEncode($statesAcion);
290
  return Mage::app()->getResponse()->setBody($jsonData);
327
  // Timezone
328
  $timezones = Mage::getModel('core/locale')->getOptionTimezones();
329
  //$localeAction['timezones'] = $timezones;
330
+
331
+ //$timezonesVal = $post_data['timezoneVal'];
332
+ if(isset($post_data['timezoneVal']))
333
+ {
334
+ Mage::getConfig()->saveConfig('general/locale/timezone', $post_data['timezoneVal'], 'default');
335
+ $localeAction['successMessage'] = "Timezone Saved On ".$storeName." Store.";
336
+ Mage::getConfig()->reinit();
337
+ Mage::app()->reinitStores();
338
+ }
339
+
340
  $timezoneValues = Mage::getStoreConfig('general/locale/timezone');
341
  //$localeAction['timezoneSelected'] = $timezoneValues;
342
  //echo "<pre>"; print_r($timezones); die;
359
  }
360
  $localeAction['timezoneListSelected'] = $timezoneAnotherArr;
361
  // /echo $timezoneValues; die;
362
+
 
 
 
 
 
 
 
 
 
363
 
364
 
365
 
391
 
392
 
393
  // First day of week
394
+ //$weekDayVal = $post_data['weekDays'];
395
+ if(isset($post_data['weekDays']))
396
+ {
397
+ if($storeId == 0)
398
+ {
399
+ Mage::getConfig()->saveConfig('general/locale/firstday', $post_data['weekDays'], 'default', $storeId);
400
+ }
401
+ else
402
+ {
403
+ Mage::getConfig()->saveConfig('general/locale/firstday', $post_data['weekDays'], 'stores', $storeId);
404
+ }
405
+ $localeAction['successMessage'] = "First Day Of Week Saved On ".$storeName." Store.";
406
+ Mage::getConfig()->reinit();
407
+ Mage::app()->reinitStores();
408
+ }
409
+
410
  $weekDaySelected = Mage::getStoreConfig('general/locale/firstday', $storeId);
411
  //$weekDaySelected['slel'][] = Mage::getStoreConfig('general/locale/firstday');
412
 
431
  }
432
  }
433
  $localeAction['weekDaysArr'] = $makeAnotherArr;
434
+
435
 
436
+
437
+ // Weekend Days
438
+ //$weekendDayVal = $post_data['weekendDays'];
439
+ if(isset($post_data['weekendDays']))
440
  {
441
+ $makeStr = implode(',', $weekendDayVal);
442
  if($storeId == 0)
443
  {
444
+ Mage::getConfig()->saveConfig('general/locale/weekend', $post_data['weekendDays'], 'default', $storeId);
445
  }
446
  else
447
  {
448
+ Mage::getConfig()->saveConfig('general/locale/weekend', $post_data['weekendDays'], 'stores', $storeId);
449
  }
450
+ $localeAction['successMessage'] = "Weekend Days Saved On ".$storeName." Store.";
451
  Mage::getConfig()->reinit();
452
  Mage::app()->reinitStores();
453
  }
 
 
 
 
454
  $weekendDaySelected = Mage::getStoreConfig('general/locale/weekend', $storeId);
455
  //echo $weekendDaySelected;
456
  $weekendExplode = explode(',', $weekendDaySelected);
480
  }
481
  $localeAction['weekendDaysMulti'] = $weekendAnotherArr;
482
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
483
 
484
  //echo "<pre>"; print_r($weekendAnotherArr); die;
485
  $jsonData = Mage::helper('core')->jsonEncode($localeAction);
532
  // die;
533
 
534
  // Add store code to URL's
 
 
535
  //$storeCodeValue = is;
536
  if(isset($post_data['selectedStoreVal']))
537
  {
540
  Mage::getConfig()->reinit();
541
  Mage::app()->reinitStores();
542
  }
543
+ $storeCodeUrlAction['selectedStoreCode'] = Mage::getStoreConfig('web/url/use_store');
544
 
545
 
546
 
547
  // Auto-redirect to Base URL
 
 
548
  // $autoRedirectValue = $post_data['selectedRedirect'];
549
  if(isset($post_data['selectedRedirect']))
550
  {
555
  Mage::getConfig()->reinit();
556
  Mage::app()->reinitStores();
557
  }
558
+ $storeCodeUrlAction['selectedAutoRedirect'] = Mage::getStoreConfig('web/url/redirect_to_base');
559
 
560
 
561
 
562
  // Search Engines Optimization
 
 
563
  //$webRewritesValue = $post_data['webRewriteVal'];
564
  if(isset($post_data['webRewriteVal']))
565
  {
578
  }
579
 
580
  $storeCodeUrlAction['successMessage'] = "Search Engine Optimization Saved On ".$storeName." Store.";
581
+ // Mage::getConfig()->reinit();
582
+ // Mage::app()->reinitStores();
583
  }
584
+ $storeCodeUrlAction['webServerRewriteSlectedValue'] = Mage::getStoreConfig('web/seo/use_rewrites', $storeId);
585
 
586
 
587
 
588
  //////// Unsecure
589
 
590
  //Base URL
 
 
591
  //$baseUrlValue = $post_data['baseUrlVal'];
592
  if(isset($post_data['baseUrlVal']))
593
  {
609
  Mage::getConfig()->reinit();
610
  Mage::app()->reinitStores();
611
  }
612
+ $storeCodeUrlAction['baseUrlSelectedValue'] = Mage::getStoreConfig('web/unsecure/base_url', $storeId);
613
+
614
+
615
 
616
 
617
  //Base Link URL
 
 
618
  // $baseLinkUrlValue = $post_data['baseLinkUrlVal'];
619
  if(isset($post_data['baseLinkUrlVal']))
620
  {
636
  Mage::getConfig()->reinit();
637
  Mage::app()->reinitStores();
638
  }
639
+ $storeCodeUrlAction['baseLinkUrlSelectedValue'] = Mage::getStoreConfig('web/unsecure/base_link_url', $storeId);
640
 
641
+
642
 
 
 
643
 
644
+ //Base Skin URL
645
  // $baseSkinUrlValue = $post_data['baseSkinUrlVal'];
646
  if(isset($post_data['baseSkinUrlVal']))
647
  {
663
  Mage::getConfig()->reinit();
664
  Mage::app()->reinitStores();
665
  }
666
+ $storeCodeUrlAction['baseSkinUrlSelectedValue'] = Mage::getStoreConfig('web/unsecure/base_skin_url', $storeId);
667
 
668
 
669
 
 
 
670
 
671
+ //Base Media URL
672
  //$baseMediaUrlValue = $post_data['baseMediaUrlVal'];
673
  if(isset($post_data['baseMediaUrlVal']))
674
  {
690
  Mage::getConfig()->reinit();
691
  Mage::app()->reinitStores();
692
  }
693
+ $storeCodeUrlAction['baseMediaUrlSelectedValue'] = Mage::getStoreConfig('web/unsecure/base_media_url', $storeId);
694
+
695
 
696
 
697
 
698
  //Base JavaScript URL
 
 
 
699
  if(isset($post_data['baseJavaUrlVal']))
700
  {
701
  //Mage::log($baseJavaUrlValue, null, "cart_android.log");
721
  Mage::getConfig()->reinit();
722
  Mage::app()->reinitStores();
723
  }
724
+ $storeCodeUrlAction['baseJavaUrlSelectedValue'] = Mage::getStoreConfig('web/unsecure/base_js_url', $storeId);
725
+ //Mage::log($storeCodeUrlAction['baseJavaUrlSelectedValue'], null, "cart_android.log");
726
+ //$baseJavaUrlValue = $post_data['baseJavaUrlVal'];
727
+
728
 
729
 
730
 
732
  //////// Secure
733
 
734
  //Base URL
 
 
735
  //$baseUrlSecureValue = $post_data['baseUrlSecureVal'];
736
  if(isset($post_data['baseUrlSecureVal']))
737
  {
753
  Mage::getConfig()->reinit();
754
  Mage::app()->reinitStores();
755
  }
756
+ $storeCodeUrlAction['baseUrlSecureSelectedValue'] = Mage::getStoreConfig('web/secure/base_url', $storeId);
757
 
758
+
759
 
 
 
760
 
761
+ //Base Link URL
762
  // $baseLinkUrlSecureValue = $post_data['baseLinkUrlSecureVal'];
763
  if(isset($post_data['baseLinkUrlSecureVal']))
764
  {
780
  Mage::getConfig()->reinit();
781
  Mage::app()->reinitStores();
782
  }
783
+ $storeCodeUrlAction['baseLinkUrlSecureSelectedValue'] = Mage::getStoreConfig('web/secure/base_link_url', $storeId);
784
 
785
+
786
 
 
 
787
 
788
+ //Base Skin URL
789
  //$baseSkinUrlSecureValue = $post_data['baseSkinUrlSecureVal'];
790
  if(isset($post_data['baseSkinUrlSecureVal']))
791
  {
807
  Mage::getConfig()->reinit();
808
  Mage::app()->reinitStores();
809
  }
810
+ $storeCodeUrlAction['baseSkinUrlSecureSelectedValue'] = Mage::getStoreConfig('web/secure/base_skin_url', $storeId);
811
 
812
+
813
 
814
 
 
 
815
 
816
+ //Base Media URL
817
  //$baseMediaUrlSecureValue = $post_data['baseMediaUrlSecureVal'];
818
  if(isset($post_data['baseMediaUrlSecureVal']))
819
  {
835
  Mage::getConfig()->reinit();
836
  Mage::app()->reinitStores();
837
  }
838
+ $storeCodeUrlAction['baseMediaUrlSecureSelectedValue'] = Mage::getStoreConfig('web/secure/base_media_url', $storeId);
839
+
840
+
841
 
842
 
843
 
844
  //Base JavaScript URL
 
 
845
  //$baseJavaUrlSecureValue = $post_data['baseJavaUrlSecureVal'];
846
  if(isset($post_data['baseJavaUrlSecureVal']))
847
  {
863
  Mage::getConfig()->reinit();
864
  Mage::app()->reinitStores();
865
  }
866
+ $storeCodeUrlAction['baseJavaUrlSecureSelectedValue'] = Mage::getStoreConfig('web/secure/base_js_url', $storeId);
867
+
868
+
869
 
870
 
871
 
872
  //Use Secure URLs in Frontend
 
873
  //$secureUrlFrontendValue = $post_data['secureUrlFrontendVal'];
874
  if(isset($post_data['secureUrlFrontendVal']))
875
  {
886
  Mage::getConfig()->reinit();
887
  Mage::app()->reinitStores();
888
  }
889
+ $storeCodeUrlAction['secureUrlFrontendSelectedValue'] = Mage::getStoreConfig('web/secure/use_in_frontend', $storeId);
890
+
891
 
892
 
893
 
894
  //Use Secure URLs in Admin
 
895
  //$secureUrlAdminValue = $post_data['secureUrlAdminVal'];
896
  if(isset($post_data['secureUrlAdminVal']))
897
  {
901
  Mage::getConfig()->reinit();
902
  Mage::app()->reinitStores();
903
  }
904
+ $storeCodeUrlAction['secureUrlAdminSelectedValue'] = Mage::getStoreConfig('web/secure/use_in_adminhtml');
905
+
906
 
907
 
908
 
909
  //Offloader header
 
910
  //$offloaderHeaderValue = $post_data['offloaderHeaderVal'];
911
  if(isset($post_data['offloaderHeaderVal']))
912
  {
916
  Mage::getConfig()->reinit();
917
  Mage::app()->reinitStores();
918
  }
919
+ $storeCodeUrlAction['offloaderHeaderSelectedValue'] = Mage::getStoreConfig('web/secure/offloader_header');
920
+
921
 
922
 
923
 
924
  //Default Pages
925
 
926
  //Default Web URL
 
927
  //$defaultWebUrlValue = $post_data['defaultWebUrlVal'];
928
  if(isset($post_data['defaultWebUrlVal']))
929
  {
940
  Mage::getConfig()->reinit();
941
  Mage::app()->reinitStores();
942
  }
943
+ $storeCodeUrlAction['defaultWebUrlSelectedValue'] = Mage::getStoreConfig('web/default/front', $storeId);
944
+
945
 
946
 
947
 
948
  //CMS Home Page
949
  $AllCmsPages = Mage::getModel('cms/page')->getCollection()->toOptionArray();
950
 
951
+ //$cmsHomeValue = $post_data['cmsHomeVal'];
952
+ if(isset($post_data['cmsHomeVal']))
953
+ {
954
+ if($storeId == 0)
955
+ {
956
+ Mage::getConfig()->saveConfig('web/default/cms_home_page', $post_data['cmsHomeVal'], 'default', $storeId);
957
+ }
958
+ else
959
+ {
960
+ Mage::getConfig()->saveConfig('web/default/cms_home_page', $post_data['cmsHomeVal'], 'stores', $storeId);
961
+ }
962
+
963
+ $storeCodeUrlAction['successMessage'] = "Default Home Page Saved On ".$storeName." Store.";
964
+ Mage::getConfig()->reinit();
965
+ Mage::app()->reinitStores();
966
+ }
967
+
968
  $selected = Mage::getStoreConfig('web/default/cms_home_page', $storeId);
969
 
970
  foreach ($AllCmsPages as $value)
985
  }
986
  }
987
 
988
+
989
+
990
+
991
+ //Default No-route URL
992
+ //$noRouteValue = $post_data['noRouteVal'];
993
+ if(isset($post_data['noRouteVal']))
994
  {
995
  if($storeId == 0)
996
  {
997
+ Mage::getConfig()->saveConfig('web/default/no_route', $post_data['noRouteVal'], 'default', $storeId);
998
  }
999
  else
1000
  {
1001
+ Mage::getConfig()->saveConfig('web/default/no_route', $post_data['noRouteVal'], 'stores', $storeId);
1002
  }
1003
 
1004
+ $storeCodeUrlAction['successMessage'] = "Default No Route URL Saved On ".$storeName." Store.";
1005
  Mage::getConfig()->reinit();
1006
  Mage::app()->reinitStores();
1007
  }
 
 
 
1008
  $storeCodeUrlAction['noRouteSelectedValue'] = Mage::getStoreConfig('web/default/no_route', 1);
1009
  //Mage::log($storeId, null, "cart_android.log");
1010
+
1011
+
1012
+
1013
+
1014
+ //CMS No Route Page
1015
+ //$CmsNoRouteValue = $post_data['CmsNoRouteVal'];
1016
+ if(isset($post_data['CmsNoRouteVal']))
1017
  {
1018
  if($storeId == 0)
1019
  {
1020
+ Mage::getConfig()->saveConfig('web/default/cms_no_route', $post_data['CmsNoRouteVal'], 'default', $storeId);
1021
  }
1022
  else
1023
  {
1024
+ Mage::getConfig()->saveConfig('web/default/cms_no_route', $post_data['CmsNoRouteVal'], 'stores', $storeId);
1025
  }
1026
 
1027
+ $storeCodeUrlAction['successMessage'] = "Cmd No-Route Page Saved On ".$storeName." Store.";
1028
  Mage::getConfig()->reinit();
1029
  Mage::app()->reinitStores();
1030
  }
 
 
 
 
1031
  $noRoutePageselected = Mage::getStoreConfig('web/default/cms_no_route', $storeId);
1032
 
1033
  foreach ($AllCmsPages as $value)
1048
  }
1049
  }
1050
 
1051
+
1052
+
1053
+
1054
+
1055
+
1056
+ //CMS No Cookies Page
1057
+ //$noCookiesValue = $post_data['noCookiesVal'];
1058
+ if(isset($post_data['noCookiesVal']))
1059
  {
1060
  if($storeId == 0)
1061
  {
1062
+ Mage::getConfig()->saveConfig('web/default/cms_no_cookies', $post_data['noCookiesVal'], 'default', $storeId);
1063
  }
1064
  else
1065
  {
1066
+ Mage::getConfig()->saveConfig('web/default/cms_no_cookies', $post_data['noCookiesVal'], 'stores', $storeId);
1067
  }
1068
 
1069
+ $storeCodeUrlAction['successMessage'] = "Cmd No-Cookies Value Page Saved On ".$storeName." Store.";
1070
  Mage::getConfig()->reinit();
1071
  Mage::app()->reinitStores();
1072
  }
 
 
 
 
 
1073
  $noCookiesPageselected = Mage::getStoreConfig('web/default/cms_no_cookies', $storeId);
1074
 
1075
  foreach ($AllCmsPages as $value)
1090
  }
1091
  }
1092
 
1093
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1094
 
1095
 
1096
 
1097
  //Show Breadcrumbs for CMS Pages
 
1098
  //$breadcrumbsValue = $post_data['breadCrumbsVal'];
1099
  if(isset($post_data['breadCrumbsVal']))
1100
  {
1111
  Mage::getConfig()->reinit();
1112
  Mage::app()->reinitStores();
1113
  }
1114
+ $storeCodeUrlAction['breadCrumbsValue'] = Mage::getStoreConfig('web/default/show_cms_breadcrumbs', $storeId);
1115
+
1116
 
1117
 
1118
 
1119
  //Polls
1120
 
1121
  //Disallow Voting in a Poll Multiple Times from Same IP-address
 
1122
  //$pollValue = $post_data['pollVal'];
1123
  if(isset($post_data['pollVal']))
1124
  {
1135
  Mage::getConfig()->reinit();
1136
  Mage::app()->reinitStores();
1137
  }
1138
+ $storeCodeUrlAction['pollsValue'] = Mage::getStoreConfig('web/polls/poll_check_by_ip', $storeId);
1139
+
1140
 
1141
 
1142
 
1143
  //Session Cookie Management
1144
 
1145
  //Cookie Lifetime
 
1146
  //$cookieLifetimeValue = $post_data['cookieLifetimeVal'];
1147
  if(isset($post_data['cookieLifetimeVal']))
1148
  {
1159
  Mage::getConfig()->reinit();
1160
  Mage::app()->reinitStores();
1161
  }
1162
+ $storeCodeUrlAction['cookieLifetimeValue'] = Mage::getStoreConfig('web/cookie/cookie_lifetime', $storeId);
1163
+
1164
 
1165
 
1166
  //Cookie Path
 
1167
  // $cookiePaathValue = $post_data['cookiePaathVal'];
1168
  if(isset($post_data['cookiePaathVal']))
1169
  {
1180
  Mage::getConfig()->reinit();
1181
  Mage::app()->reinitStores();
1182
  }
1183
+ $storeCodeUrlAction['cookiePaathValue'] = Mage::getStoreConfig('web/cookie/cookie_path', $storeId);
1184
+
1185
 
1186
 
1187
 
1188
  //Cookie Domain
 
1189
  //$cookieDomainValue = $post_data['cookieDomainVal'];
1190
  if(isset($post_data['cookieDomainVal']))
1191
  {
1202
  Mage::getConfig()->reinit();
1203
  Mage::app()->reinitStores();
1204
  }
1205
+ $storeCodeUrlAction['cookieDomainValue'] = Mage::getStoreConfig('web/cookie/cookie_domain', $storeId);
1206
+
1207
 
1208
 
1209
 
1210
  //Use HTTP Only
 
1211
  //$httpOnlyValue = $post_data['httpOnlyVal'];
1212
  if(isset($post_data['httpOnlyVal']))
1213
  {
1224
  Mage::getConfig()->reinit();
1225
  Mage::app()->reinitStores();
1226
  }
1227
+ $storeCodeUrlAction['httpOnlyValue'] = Mage::getStoreConfig('web/cookie/cookie_httponly', $storeId);
1228
+
1229
 
1230
 
1231
 
1232
  //Cookie Restriction Mode
 
1233
  //$cookieRestrictionModeValue = $post_data['cookieRestrictionModeVal'];
1234
  if(isset($post_data['cookieRestrictionModeVal']))
1235
  {
1239
  Mage::getConfig()->reinit();
1240
  Mage::app()->reinitStores();
1241
  }
1242
+ $storeCodeUrlAction['cookieRestrictionModeValue'] = Mage::getStoreConfig('web/cookie/cookie_restriction');
1243
+
1244
 
1245
 
1246
 
1248
  //Session Validation Settings
1249
 
1250
  //Validate REMOTE_ADDR
 
1251
  //$validateRemoteValue = $post_data['validateRemoteVal'];
1252
  if(isset($post_data['validateRemoteVal']))
1253
  {
1257
  Mage::getConfig()->reinit();
1258
  Mage::app()->reinitStores();
1259
  }
1260
+ $storeCodeUrlAction['validateRemoteValue'] = Mage::getStoreConfig('web/session/use_remote_addr');
1261
+
1262
 
1263
 
1264
 
1265
  //Validate HTTP_VIA
 
1266
  //$validateHttpValue = $post_data['validateHttpVal'];
1267
  if(isset($post_data['validateHttpVal']))
1268
  {
1272
  Mage::getConfig()->reinit();
1273
  Mage::app()->reinitStores();
1274
  }
1275
+ $storeCodeUrlAction['validateHttpValue'] = Mage::getStoreConfig('web/session/use_http_via');
1276
+
1277
 
1278
 
1279
 
1280
  //Validate HTTP_X_FORWARDED_FOR
 
1281
  //$validateHttpXXValue = $post_data['validateHttpXXVal'];
1282
  if(isset($post_data['validateHttpXXVal']))
1283
  {
1287
  Mage::getConfig()->reinit();
1288
  Mage::app()->reinitStores();
1289
  }
1290
+ $storeCodeUrlAction['validateHttpXXValue'] = Mage::getStoreConfig('web/session/use_http_x_forwarded_for');
1291
+
1292
 
1293
 
1294
 
1295
  //Validate HTTP_USER_AGENT
 
1296
  //$validateHttpUserValue = $post_data['validateHttpUserVal'];
1297
  if(isset($post_data['validateHttpUserVal']))
1298
  {
1302
  Mage::getConfig()->reinit();
1303
  Mage::app()->reinitStores();
1304
  }
1305
+ $storeCodeUrlAction['validateHttpUserValue'] = Mage::getStoreConfig('web/session/use_http_user_agent');
1306
+
1307
 
1308
 
1309
 
1310
  //Use SID on Frontend
 
1311
  //$useSIDValue = $post_data['useSIDVal'];
1312
  if(isset($post_data['useSIDVal']))
1313
  {
1318
  Mage::app()->reinitStores();
1319
  }
1320
 
1321
+ $storeCodeUrlAction['useSIDValue'] = Mage::getStoreConfig('web/session/use_frontend_sid');
1322
+
1323
+
1324
 
1325
 
1326
  //Browser Capabilities Detection
1327
 
1328
  //Redirect to CMS-page if Cookies are Disabled
 
1329
  //$redirectToCmsValue = $post_data['redirectToCmsVal'];
1330
  if(isset($post_data['redirectToCmsVal']))
1331
  {
1342
  Mage::getConfig()->reinit();
1343
  Mage::app()->reinitStores();
1344
  }
1345
+ $storeCodeUrlAction['redirectToCmsValue'] = Mage::getStoreConfig('web/browser_capabilities/cookies', $storeId);
1346
+
1347
 
1348
 
1349
 
1350
  //Show Notice if JavaScript is Disabled
 
1351
  //$showNoticeValue = $post_data['showNoticeVal'];
1352
  if(isset($post_data['showNoticeVal']))
1353
  {
1364
  Mage::getConfig()->reinit();
1365
  Mage::app()->reinitStores();
1366
  }
1367
+ $storeCodeUrlAction['showNoticeValue'] = Mage::getStoreConfig('web/browser_capabilities/javascript', $storeId);
1368
+
1369
 
1370
  // echo "<pre>"; print_r($storeCodeUrlAction); die;
1371
  $jsonData = Mage::helper('core')->jsonEncode($storeCodeUrlAction);
1419
 
1420
  //Base Currency
1421
  $currenciesList = Mage::app()->getLocale()->getOptionCurrencies();
1422
+
1423
+ //$baseCurrValue = $post_data['baseCurrVal'];
1424
+ if(isset($post_data['baseCurrVal']))
1425
+ {
1426
+ //Mage::log($post_data['baseCurrVal'], null, "cart_android.log");
1427
+ Mage::getConfig()->saveConfig('currency/options/base', $post_data['baseCurrVal'], 'default', 0);
1428
+
1429
+ $storeCodeUrlAction['successMessage'] = "Base Currency Value Saved On ".$storeName." Store.";
1430
+ Mage::getConfig()->reinit();
1431
+ Mage::app()->reinitStores();
1432
+ }
1433
+
1434
  $selectedCurrency = Mage::getStoreConfig('currency/options/base', 0);
1435
 
1436
  foreach ($currenciesList as $value)
1451
  }
1452
  }
1453
 
1454
+
1455
+
1456
+
1457
+
1458
+ //Default Display Currency
1459
+ //$defaultDisCurrValue = $post_data['defaultDisplayCurrVal'];
1460
+ if(isset($post_data['defaultDisplayCurrVal']))
1461
  {
1462
+ //Mage::log("nav", null, "cart_android.log");
1463
+ if($storeId == 0)
1464
+ {
1465
+ Mage::getConfig()->saveConfig('currency/options/default', $post_data['defaultDisplayCurrVal'], 'default', $storeId);
1466
+ }
1467
+ else
1468
+ {
1469
+ Mage::getConfig()->saveConfig('currency/options/default', $post_data['defaultDisplayCurrVal'], 'stores', $storeId);
1470
+ }
1471
 
1472
+ $currencySetupAction['successMessage'] = "Default Display Currency Value Saved On ".$storeName." Store.";
1473
  Mage::getConfig()->reinit();
1474
  Mage::app()->reinitStores();
1475
  }
 
 
 
 
1476
  $selectedDefaultCurrency = Mage::getStoreConfig('currency/options/default', $storeId);
1477
 
1478
  foreach ($currenciesList as $value)
1493
  }
1494
  }
1495
 
1496
+ //echo "<pre>"; print_r($currencySetupAction); die;
1497
+
1498
+
1499
+ //Allowed Currencies
1500
+ //$allowedCurrValue = $post_data['allowedCurrVal'];
1501
+ if(isset($post_data['allowedCurrVal']))
1502
  {
1503
+ //Mage::log($post_data['allowedCurrVal'], null, "cart_android.log");
1504
+ $implodeVal = implode(',', $post_data['allowedCurrVal']);
1505
  if($storeId == 0)
1506
  {
1507
+ Mage::getConfig()->saveConfig('currency/options/allow', $implodeVal, 'default', $storeId);
1508
  }
1509
  else
1510
  {
1511
+ Mage::getConfig()->saveConfig('currency/options/allow', $implodeVal, 'stores', $storeId);
1512
  }
1513
 
1514
+ $currencySetupAction['successMessage'] = "Allowed Currencies Value Saved On ".$storeName." Store.";
1515
  Mage::getConfig()->reinit();
1516
  Mage::app()->reinitStores();
1517
  }
 
 
 
 
1518
  $allowedCurrencies = Mage::getStoreConfig('currency/options/allow', $storeId);
1519
  $explodedCurr = explode(',', $allowedCurrencies);
1520
  foreach ($explodedCurr as $value)
1540
  }
1541
  }
1542
  //echo "<pre>"; print_r($currencySetupAction1); die;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1543
 
1544
 
1545
 
1547
  //Webservicex
1548
 
1549
  //Connection Timeout in Seconds
 
 
1550
  if(isset($post_data['connectionTimedOutVal']))
1551
  {
1552
  //Mage::log($post_data['baseCurrVal'], null, "cart_android.log");
1553
  Mage::getConfig()->saveConfig('currency/webservicex/timeout', $post_data['connectionTimedOutVal'], 'default', 0);
1554
 
1555
  $storeCodeUrlAction['successMessage'] = "Connection Timeout Value Saved in Seconds On ".$storeName." Store.";
1556
+ // Mage::getConfig()->reinit();
1557
+ // Mage::app()->reinitStores();
1558
  }
1559
+ $currencySetupAction['connectionTimedOutSelectedValue'] = Mage::getStoreConfig('currency/webservicex/timeout');
1560
+
1561
 
1562
  //echo "<pre>"; print_r($currencySetupAction); die;
1563
  $jsonData = Mage::helper('core')->jsonEncode($currencySetupAction);
1604
  //General Contact
1605
 
1606
  //Sender Name
 
 
1607
  if(isset($post_data['generalSenderNameVal']))
1608
  {
1609
  if($storeId == 0)
1619
  Mage::getConfig()->reinit();
1620
  Mage::app()->reinitStores();
1621
  }
1622
+ $storeEmailAddresses['generalSenderNameSelectedValue'] = Mage::getStoreConfig('trans_email/ident_general/name', $storeId);
1623
+
1624
+
1625
 
1626
  //Sender Email
 
 
1627
  if(isset($post_data['generalSenderEmailVal']))
1628
  {
1629
  if($storeId == 0)
1639
  Mage::getConfig()->reinit();
1640
  Mage::app()->reinitStores();
1641
  }
1642
+ $storeEmailAddresses['generalSenderEmailSelectedValue'] = Mage::getStoreConfig('trans_email/ident_general/email', $storeId);
1643
+
1644
 
1645
 
1646
 
1648
  //Sales Representative
1649
 
1650
  //Sender Name
 
 
1651
  if(isset($post_data['salesSenderNameVal']))
1652
  {
1653
  if($storeId == 0)
1663
  Mage::getConfig()->reinit();
1664
  Mage::app()->reinitStores();
1665
  }
1666
+ $storeEmailAddresses['salesSenderNameSelectedValue'] = Mage::getStoreConfig('trans_email/ident_sales/name', $storeId);
1667
+
1668
+
1669
 
1670
  //Sender Email
 
 
1671
  if(isset($post_data['salesSenderEmailVal']))
1672
  {
1673
  if($storeId == 0)
1683
  Mage::getConfig()->reinit();
1684
  Mage::app()->reinitStores();
1685
  }
1686
+ $storeEmailAddresses['salesSenderEmailSelectedValue'] = Mage::getStoreConfig('trans_email/ident_sales/email', $storeId);
1687
+
1688
 
1689
 
1690
 
1692
  //Customer Support
1693
 
1694
  //Sender Name
 
 
1695
  if(isset($post_data['customerSenderNameVal']))
1696
  {
1697
  if($storeId == 0)
1707
  Mage::getConfig()->reinit();
1708
  Mage::app()->reinitStores();
1709
  }
1710
+ $storeEmailAddresses['customerSenderNameSelectedValue'] = Mage::getStoreConfig('trans_email/ident_support/name', $storeId);
1711
+
1712
+
1713
 
1714
  //Sender Email
 
 
1715
  if(isset($post_data['customerSenderEmailVal']))
1716
  {
1717
  if($storeId == 0)
1727
  Mage::getConfig()->reinit();
1728
  Mage::app()->reinitStores();
1729
  }
1730
+ $storeEmailAddresses['customerSenderEmailSelectedValue'] = Mage::getStoreConfig('trans_email/ident_support/email', $storeId);
1731
+
1732
 
1733
 
1734
 
1736
  //Custom Email 1
1737
 
1738
  //Sender Name
 
 
1739
  if(isset($post_data['custom1SenderNameVal']))
1740
  {
1741
  if($storeId == 0)
1751
  Mage::getConfig()->reinit();
1752
  Mage::app()->reinitStores();
1753
  }
1754
+ $storeEmailAddresses['custom1NameSelectedValue'] = Mage::getStoreConfig('trans_email/ident_custom1/name', $storeId);
1755
+
1756
+
1757
 
1758
  //Sender Email
 
 
1759
  if(isset($post_data['custom1EmailVal']))
1760
  {
1761
  if($storeId == 0)
1771
  Mage::getConfig()->reinit();
1772
  Mage::app()->reinitStores();
1773
  }
1774
+ $storeEmailAddresses['custom1EmailSelectedValue'] = Mage::getStoreConfig('trans_email/ident_custom1/email', $storeId);
1775
+
1776
 
1777
 
1778
 
1780
  //Custom Email 2
1781
 
1782
  //Sender Name
 
 
1783
  if(isset($post_data['custom2SenderNameVal']))
1784
  {
1785
  if($storeId == 0)
1795
  Mage::getConfig()->reinit();
1796
  Mage::app()->reinitStores();
1797
  }
1798
+ $storeEmailAddresses['custom2NameSelectedValue'] = Mage::getStoreConfig('trans_email/ident_custom2/name', $storeId);
1799
+
1800
+
1801
 
1802
  //Sender Email
 
 
1803
  if(isset($post_data['custom2EmailVal']))
1804
  {
1805
  if($storeId == 0)
1815
  Mage::getConfig()->reinit();
1816
  Mage::app()->reinitStores();
1817
  }
1818
+ $storeEmailAddresses['custom2EmailSelectedValue'] = Mage::getStoreConfig('trans_email/ident_custom2/email', $storeId);
1819
+
1820
 
1821
  //echo "<pre>"; print_r($storeEmailAddresses); die;
1822
  $jsonData = Mage::helper('core')->jsonEncode($storeEmailAddresses);
1882
  //Contact Us
1883
 
1884
  //Enable Contact Us
 
 
1885
  if(isset($post_data['enableContactUsVal']))
1886
  {
1887
  if($storeId == 0)
1897
  Mage::getConfig()->reinit();
1898
  Mage::app()->reinitStores();
1899
  }
1900
+ $storeContacts['enableContactUsSelectedValue'] = Mage::getStoreConfig('contacts/contacts/enabled', $storeId);
1901
+
1902
 
1903
 
1904
 
1905
  //Email Options
1906
 
1907
  //Send Emails To
 
 
1908
  if(isset($post_data['sendEmailsToVal']))
1909
  {
1910
  if($storeId == 0)
1920
  Mage::getConfig()->reinit();
1921
  Mage::app()->reinitStores();
1922
  }
1923
+ $storeContacts['sendEmailsToSelectedValue'] = Mage::getStoreConfig('contacts/email/recipient_email', $storeId);
1924
+
1925
 
1926
 
1927
  //Email Sender
1928
+ if(isset($post_data['senderEmailVal']))
1929
+ {
1930
+ if($storeId == 0)
1931
+ {
1932
+ Mage::getConfig()->saveConfig('contacts/email/sender_email_identity', $post_data['senderEmailVal'], 'default', $storeId);
1933
+ }
1934
+ else
1935
+ {
1936
+ Mage::getConfig()->saveConfig('contacts/email/sender_email_identity', $post_data['senderEmailVal'], 'stores', $storeId);
1937
+ }
1938
+
1939
+ $storeContacts['successMessage'] = "Email Sender updated On ".$storeName." Store.";
1940
+ Mage::getConfig()->reinit();
1941
+ Mage::app()->reinitStores();
1942
+ }
1943
+
1944
  $emailSenderSelectedValue = Mage::getStoreConfig('contacts/email/sender_email_identity', $storeId);
1945
  foreach ($this->emailSendersListArray() as $value)
1946
  {
1960
  }
1961
  }
1962
 
1963
+
1964
+
1965
+
1966
+ //Email Template
1967
+ if(isset($post_data['emailTemplateVal']))
1968
+ {
1969
  if($storeId == 0)
1970
  {
1971
+ Mage::getConfig()->saveConfig('contacts/email/email_template', $post_data['emailTemplateVal'], 'default', $storeId);
1972
  }
1973
  else
1974
  {
1975
+ Mage::getConfig()->saveConfig('contacts/email/email_template', $post_data['emailTemplateVal'], 'stores', $storeId);
1976
  }
1977
 
1978
+ $storeContacts['successMessage'] = "Conatct Email Template updated On ".$storeName." Store.";
1979
  Mage::getConfig()->reinit();
1980
  Mage::app()->reinitStores();
1981
  }
 
 
 
 
1982
  $emailTemplateSelectedValue = Mage::getStoreConfig('contacts/email/email_template', $storeId);
1983
 
1984
  $emailTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
2007
  }
2008
  }
2009
  //echo $post_data['emailTemplateVal']."***";
2010
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2011
 
2012
  //echo "<pre>"; print_r($storeContacts); die;
2013
  $jsonData = Mage::helper('core')->jsonEncode($storeContacts);
2052
  //WYSIWYG Options
2053
 
2054
  //Enable WYSIWYG Editor
2055
+ if(isset($post_data['editorVal']))
2056
+ {
2057
+ if($storeId == 0)
2058
+ {
2059
+ Mage::getConfig()->saveConfig('cms/wysiwyg/enabled', $post_data['editorVal'], 'default', $storeId);
2060
+ }
2061
+ else
2062
+ {
2063
+ Mage::getConfig()->saveConfig('cms/wysiwyg/enabled', $post_data['editorVal'], 'stores', $storeId);
2064
+ }
2065
+
2066
+ $contentManagementAcion['successMessage'] = "WYSIWYG Editor Option updated On ".$storeName." Store.";
2067
+ Mage::getConfig()->reinit();
2068
+ Mage::app()->reinitStores();
2069
+ }
2070
+
2071
  $enableEditorSelectedValue = Mage::getStoreConfig('cms/wysiwyg/enabled', $storeId);
2072
 
2073
  $ediorObj = new Mage_Adminhtml_Model_System_Config_Source_Cms_Wysiwyg_Enabled();
2093
  }
2094
  }
2095
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2096
 
2097
 
2098
 
2099
  //Use Static URLs for Media Content in WYSIWYG for Catalog
 
2100
  if(isset($post_data['contentStaticUrlVal']))
2101
  {
2102
  Mage::getConfig()->saveConfig('cms/wysiwyg/use_static_urls_in_catalog', $post_data['contentStaticUrlVal'], 'default', 0);
2105
  Mage::getConfig()->reinit();
2106
  Mage::app()->reinitStores();
2107
  }
2108
+ $contentManagementAcion['contentStaticSelectedValue'] = Mage::getStoreConfig('cms/wysiwyg/use_static_urls_in_catalog');
2109
+
2110
 
2111
  //echo "<pre>"; print_r($contentManagementAcion); die;
2112
  $jsonData = Mage::helper('core')->jsonEncode($contentManagementAcion);
2152
  //General
2153
 
2154
  //Hide Customer IP
 
2155
  if(isset($post_data['hideCustomerIpVal']))
2156
  {
2157
  if($storeId == 0)
2167
  Mage::getConfig()->reinit();
2168
  Mage::app()->reinitStores();
2169
  }
2170
+ $salesAcion['hideCustomerIpSelectedValue'] = Mage::getStoreConfig('sales/general/hide_customer_ip', $storeId);
2171
+
2172
 
2173
 
2174
  //Checkout Totals Sort Order
2175
 
2176
  //Subtotal
 
2177
  if(isset($post_data['subtotalVal']))
2178
  {
2179
  Mage::getConfig()->saveConfig('sales/totals_sort/subtotal', $post_data['subtotalVal'], 'default', 0);
2182
  Mage::getConfig()->reinit();
2183
  Mage::app()->reinitStores();
2184
  }
2185
+ $salesAcion['subtotalSelectedValue'] = Mage::getStoreConfig('sales/totals_sort/subtotal');
2186
+
2187
 
2188
 
2189
  //Discount
 
2190
  if(isset($post_data['discountVal']))
2191
  {
2192
  Mage::getConfig()->saveConfig('sales/totals_sort/discount', $post_data['discountVal'], 'default', 0);
2195
  Mage::getConfig()->reinit();
2196
  Mage::app()->reinitStores();
2197
  }
2198
+ $salesAcion['discountSelectedValue'] = Mage::getStoreConfig('sales/totals_sort/discount');
2199
+
2200
 
2201
 
2202
  //Shipping
 
2203
  if(isset($post_data['shippingVal']))
2204
  {
2205
  Mage::getConfig()->saveConfig('sales/totals_sort/shipping', $post_data['shippingVal'], 'default', 0);
2208
  Mage::getConfig()->reinit();
2209
  Mage::app()->reinitStores();
2210
  }
2211
+ $salesAcion['shippingSelectedValue'] = Mage::getStoreConfig('sales/totals_sort/shipping');
2212
+
2213
 
2214
 
2215
  //Fixed Product Tax
 
2216
  if(isset($post_data['fixProductTaxVal']))
2217
  {
2218
  Mage::getConfig()->saveConfig('sales/totals_sort/weee', $post_data['fixProductTaxVal'], 'default', 0);
2221
  Mage::getConfig()->reinit();
2222
  Mage::app()->reinitStores();
2223
  }
2224
+ $salesAcion['fixProductTaxSelectedValue'] = Mage::getStoreConfig('sales/totals_sort/weee');
2225
+
2226
 
2227
 
2228
  //Tax
 
2229
  if(isset($post_data['taxVal']))
2230
  {
2231
  Mage::getConfig()->saveConfig('sales/totals_sort/tax', $post_data['taxVal'], 'default', 0);
2234
  Mage::getConfig()->reinit();
2235
  Mage::app()->reinitStores();
2236
  }
2237
+ $salesAcion['taxSelectedValue'] = Mage::getStoreConfig('sales/totals_sort/tax');
2238
+
2239
 
2240
 
2241
  //Grand Total
 
2242
  if(isset($post_data['grandTotalVal']))
2243
  {
2244
  Mage::getConfig()->saveConfig('sales/totals_sort/grand_total', $post_data['grandTotalVal'], 'default', 0);
2247
  Mage::getConfig()->reinit();
2248
  Mage::app()->reinitStores();
2249
  }
2250
+ $salesAcion['grandTotalSelectedValue'] = Mage::getStoreConfig('sales/totals_sort/grand_total');
2251
+
2252
 
2253
 
2254
 
2255
  //Reorder
2256
 
2257
  //Allow Reorder
 
2258
  if(isset($post_data['allowReorderVal']))
2259
  {
2260
  if($storeId == 0)
2270
  Mage::getConfig()->reinit();
2271
  Mage::app()->reinitStores();
2272
  }
2273
+ $salesAcion['allowReorderSelectedValue'] = Mage::getStoreConfig('sales/reorder/allow', $storeId);
2274
+
2275
 
2276
 
2277
 
2278
  //Minimum Order Amount
2279
 
2280
  //Enable
 
2281
  if(isset($post_data['minOrderEnableVal']))
2282
  {
2283
  Mage::getConfig()->saveConfig('sales/minimum_order/active', $post_data['minOrderEnableVal'], 'default', 0);
2286
  Mage::getConfig()->reinit();
2287
  Mage::app()->reinitStores();
2288
  }
2289
+ $salesAcion['minOrderEnableSelectedValue'] = Mage::getStoreConfig('sales/minimum_order/active');
2290
+
2291
 
2292
 
2293
 
2294
  //Minimum Amount
 
2295
  if(isset($post_data['minAmountVal']))
2296
  {
2297
  Mage::getConfig()->saveConfig('sales/minimum_order/amount', $post_data['minAmountVal'], 'default', 0);
2300
  Mage::getConfig()->reinit();
2301
  Mage::app()->reinitStores();
2302
  }
2303
+ $salesAcion['minAmountSelectedValue'] = Mage::getStoreConfig('sales/minimum_order/amount');
2304
+
2305
 
2306
 
2307
  //Description Message
 
2308
  if(isset($post_data['descriptionMessVal']))
2309
  {
2310
  if($storeId == 0)
2320
  Mage::getConfig()->reinit();
2321
  Mage::app()->reinitStores();
2322
  }
2323
+ $salesAcion['descriptionMessSelectedValue'] = Mage::getStoreConfig('sales/minimum_order/description', $storeId);
2324
+
2325
 
2326
 
2327
  //Error to Show in Shopping Cart
 
2328
  if(isset($post_data['errorMessVal']))
2329
  {
2330
  if($storeId == 0)
2340
  Mage::getConfig()->reinit();
2341
  Mage::app()->reinitStores();
2342
  }
2343
+ $salesAcion['errorMessSelectedValue'] = Mage::getStoreConfig('sales/minimum_order/error_message', $storeId);
2344
+
2345
 
2346
 
2347
  //Validate Each Address Separately in Multi-address Checkout
 
2348
  if(isset($post_data['validateAddressVal']))
2349
  {
2350
  Mage::getConfig()->saveConfig('sales/minimum_order/multi_address', $post_data['validateAddressVal'], 'default', 0);
2353
  Mage::getConfig()->reinit();
2354
  Mage::app()->reinitStores();
2355
  }
2356
+ $salesAcion['validateAddressSelectedValue'] = Mage::getStoreConfig('sales/minimum_order/multi_address');
2357
+
2358
 
2359
 
2360
  //Multi-address Description Message
 
2361
  if(isset($post_data['multiAddressVal']))
2362
  {
2363
  if($storeId == 0)
2373
  Mage::getConfig()->reinit();
2374
  Mage::app()->reinitStores();
2375
  }
2376
+ $salesAcion['multiAddressSelectedValue'] = Mage::getStoreConfig('sales/minimum_order/multi_address_description', $storeId);
2377
+
2378
 
2379
 
2380
  //Multi-address Error to Show in Shopping Cart
 
2381
  if(isset($post_data['multiAddressErrorVal']))
2382
  {
2383
  if($storeId == 0)
2393
  Mage::getConfig()->reinit();
2394
  Mage::app()->reinitStores();
2395
  }
2396
+ $salesAcion['multiAddressErrorSelectedValue'] = Mage::getStoreConfig('sales/minimum_order/multi_address_error_message', $storeId);
2397
+
2398
 
2399
 
2400
 
2402
  //Dashboard
2403
 
2404
  //Use Aggregated Data (beta)
 
2405
  if(isset($post_data['useAggregatedVal']))
2406
  {
2407
  Mage::getConfig()->saveConfig('sales/dashboard/use_aggregated_data', $post_data['useAggregatedVal'], 'default', 0);
2410
  Mage::getConfig()->reinit();
2411
  Mage::app()->reinitStores();
2412
  }
2413
+ $salesAcion['useAggregatedSelectedValue'] = Mage::getStoreConfig('sales/dashboard/use_aggregated_data');
2414
+
2415
 
2416
 
2417
 
2419
  //Gift Options
2420
 
2421
  //Allow Gift Messages on Order Level
 
2422
  if(isset($post_data['allowGiftVal']))
2423
  {
2424
  Mage::getConfig()->saveConfig('sales/gift_options/allow_order', $post_data['allowGiftVal'], 'default', 0);
2427
  Mage::getConfig()->reinit();
2428
  Mage::app()->reinitStores();
2429
  }
2430
+ $salesAcion['allowGiftSelectedValue'] = Mage::getStoreConfig('sales/gift_options/allow_order');
2431
+
2432
 
2433
 
2434
  //Allow Gift Messages for Order Items
 
2435
  if(isset($post_data['allowGiftOrderVal']))
2436
  {
2437
  Mage::getConfig()->saveConfig('sales/gift_options/allow_items', $post_data['allowGiftOrderVal'], 'default', 0);
2440
  Mage::getConfig()->reinit();
2441
  Mage::app()->reinitStores();
2442
  }
2443
+ $salesAcion['allowGiftOrderSelectedValue'] = Mage::getStoreConfig('sales/gift_options/allow_items');
2444
+
2445
 
2446
 
2447
 
2449
  //Minimum Advertised Price
2450
 
2451
  //Enable MAP
 
2452
  if(isset($post_data['enableMapVal']))
2453
  {
2454
  Mage::getConfig()->saveConfig('sales/msrp/enabled', $post_data['enableMapVal'], 'default', 0);
2457
  Mage::getConfig()->reinit();
2458
  Mage::app()->reinitStores();
2459
  }
2460
+ $salesAcion['enableMapSelectedValue'] = Mage::getStoreConfig('sales/msrp/enabled');
2461
+
2462
 
2463
 
2464
  //Apply MAP (Default Value)
 
2465
  if(isset($post_data['applyMapVal']))
2466
  {
2467
  Mage::getConfig()->saveConfig('sales/msrp/apply_for_all', $post_data['applyMapVal'], 'default', 0);
2470
  Mage::getConfig()->reinit();
2471
  Mage::app()->reinitStores();
2472
  }
2473
+ $salesAcion['applyMapSelectedValue'] = Mage::getStoreConfig('sales/msrp/apply_for_all');
2474
+
2475
 
2476
 
2477
  //Display Actual Price
 
2478
  if(isset($post_data['displayActualVal']))
2479
  {
2480
  Mage::getConfig()->saveConfig('sales/msrp/display_price_type', $post_data['displayActualVal'], 'default', 0);
2483
  Mage::getConfig()->reinit();
2484
  Mage::app()->reinitStores();
2485
  }
2486
+ $salesAcion['displayActualSelectedValue'] = Mage::getStoreConfig('sales/msrp/display_price_type');
2487
+
2488
 
2489
 
2490
  //Default Popup Text Message
 
2491
  if(isset($post_data['defaultPopUpVal']))
2492
  {
2493
  if($storeId == 0)
2503
  Mage::getConfig()->reinit();
2504
  Mage::app()->reinitStores();
2505
  }
2506
+ $salesAcion['defaultPopUpSelectedValue'] = Mage::getStoreConfig('sales/msrp/explanation_message', $storeId);
2507
+
2508
 
2509
 
2510
  //Default "What's This" Text Message
 
2511
  if(isset($post_data['defaultWhatsTextVal']))
2512
  {
2513
  if($storeId == 0)
2523
  Mage::getConfig()->reinit();
2524
  Mage::app()->reinitStores();
2525
  }
2526
+ $salesAcion['defaultWhatsTextSelectedValue'] = Mage::getStoreConfig('sales/msrp/explanation_message_whats_this', $storeId);
2527
+
2528
 
2529
  //echo "<pre>"; print_r($salesAcion); die;
2530
  $jsonData = Mage::helper('core')->jsonEncode($salesAcion);
2571
  //Order
2572
 
2573
  //Enabled
 
2574
  if(isset($post_data['salesEmailEnableVal']))
2575
  {
2576
  if($storeId == 0)
2586
  Mage::getConfig()->reinit();
2587
  Mage::app()->reinitStores();
2588
  }
2589
+ $salesEmailsAcion['salesEmailEnableSelectedValue'] = Mage::getStoreConfig('sales_email/order/enabled', $storeId);
2590
+
2591
 
2592
 
2593
  //New Order Confirmation Email Sender
2594
+ if(isset($post_data['newOrderConfirmationVal']))
2595
+ {
2596
+ if($storeId == 0)
2597
+ {
2598
+ Mage::getConfig()->saveConfig('sales_email/order/identity', $post_data['newOrderConfirmationVal'], 'default', $storeId);
2599
+ }
2600
+ else
2601
+ {
2602
+ Mage::getConfig()->saveConfig('sales_email/order/identity', $post_data['newOrderConfirmationVal'], 'stores', $storeId);
2603
+ }
2604
+
2605
+ $salesEmailsAcion['successMessage'] = "New Order Confirmation Email Sender updated On ".$storeName." Store.";
2606
+ Mage::getConfig()->reinit();
2607
+ Mage::app()->reinitStores();
2608
+ }
2609
+
2610
  $newOrderConfirmationSelectedValue = Mage::getStoreConfig('sales_email/order/identity', $storeId);
2611
 
2612
  foreach ($this->emailSendersListArray() as $value)
2628
 
2629
  }
2630
 
2631
+
2632
+ //New Order Confirmation Template
2633
+ if(isset($post_data['newOrderEmailTemplateVal']))
2634
  {
2635
  if($storeId == 0)
2636
  {
2637
+ Mage::getConfig()->saveConfig('sales_email/order/template', $post_data['newOrderEmailTemplateVal'], 'default', $storeId);
2638
  }
2639
  else
2640
  {
2641
+ Mage::getConfig()->saveConfig('sales_email/order/template', $post_data['newOrderEmailTemplateVal'], 'stores', $storeId);
2642
  }
2643
 
2644
+ $salesEmailsAcion['successMessage'] = "New Order Confirmation Template updated On ".$storeName." Store.";
2645
  Mage::getConfig()->reinit();
2646
  Mage::app()->reinitStores();
2647
  }
2648
 
 
 
 
 
2649
  $newOrderEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/order/template', $storeId);
2650
 
2651
  $newOrderEmailTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
2659
  {
2660
  if($value['value'] == $newOrderEmailTemplateSelectedValue)
2661
  {
2662
+ $newOrderEmailTemArr['label'] = "New Order (".$value['label'].")";
2663
  $newOrderEmailTemArr['value'] = $value['value'];
2664
  $newOrderEmailTemArr['status'] = 1;
2665
  $salesEmailsAcion['newOrderEmailTempColl'][] = $newOrderEmailTemArr;
2666
  }
2667
  else
2668
  {
2669
+ $newOrderEmailTemArr['label'] = "New Order (".$value['label'].")";
2670
  $newOrderEmailTemArr['value'] = $value['value'];
2671
  $newOrderEmailTemArr['status'] = 0;
2672
  $salesEmailsAcion['newOrderEmailTempColl'][] = $newOrderEmailTemArr;
2673
  }
2674
  }
2675
  //echo $post_data['emailTemplateVal']."***";
2676
+
2677
+
2678
+ //New Order Confirmation Template for Guest
2679
+ if(isset($post_data['newOrderForGuestVal']))
2680
  {
2681
  if($storeId == 0)
2682
  {
2683
+ Mage::getConfig()->saveConfig('sales_email/order/guest_template', $post_data['newOrderForGuestVal'], 'default', $storeId);
2684
  }
2685
  else
2686
  {
2687
+ Mage::getConfig()->saveConfig('sales_email/order/guest_template', $post_data['newOrderForGuestVal'], 'stores', $storeId);
2688
  }
2689
 
2690
+ $salesEmailsAcion['successMessage'] = "New Order Confirmation Template for Guest updated On ".$storeName." Store.";
2691
  Mage::getConfig()->reinit();
2692
  Mage::app()->reinitStores();
2693
  }
2694
 
 
 
 
2695
  $forGuestEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/order/guest_template', $storeId);
2696
 
2697
  $newOrderEmailGuestTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
2706
  {
2707
  if($value['value'] == $forGuestEmailTemplateSelectedValue)
2708
  {
2709
+ $forGuestOrderEmailTemArr['label'] = "New Order for Guest (".$value['label'].")";
2710
  $forGuestOrderEmailTemArr['value'] = $value['value'];
2711
  $forGuestOrderEmailTemArr['status'] = 1;
2712
  $salesEmailsAcion['newOrderForGuestColl'][] = $forGuestOrderEmailTemArr;
2713
  }
2714
  else
2715
  {
2716
+ $forGuestOrderEmailTemArr['label'] = "New Order for Guest (".$value['label'].")";
2717
  $forGuestOrderEmailTemArr['value'] = $value['value'];
2718
  $forGuestOrderEmailTemArr['status'] = 0;
2719
  $salesEmailsAcion['newOrderForGuestColl'][] = $forGuestOrderEmailTemArr;
2720
  }
2721
  }
2722
  //echo $post_data['emailTemplateVal']."***";
2723
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2724
 
2725
  //Send Order Email Copy To
 
2726
  if(isset($post_data['emailCopyToVal']))
2727
  {
2728
  if($storeId == 0)
2738
  Mage::getConfig()->reinit();
2739
  Mage::app()->reinitStores();
2740
  }
2741
+ $salesEmailsAcion['emailCopyToSelectedValue'] = Mage::getStoreConfig('sales_email/order/copy_to', $storeId);
2742
+
2743
 
2744
 
2745
  //Send Order Email Copy Method
 
2746
  if(isset($post_data['orderEmailCopyVal']))
2747
  {
2748
  if($storeId == 0)
2758
  Mage::getConfig()->reinit();
2759
  Mage::app()->reinitStores();
2760
  }
2761
+ $salesEmailsAcion['orderEmailCopySelectedValue'] = Mage::getStoreConfig('sales_email/order/copy_method', $storeId);
2762
+
2763
 
2764
  // echo "<pre>"; print_r($salesEmailsAcion); die;
2765
  $jsonData = Mage::helper('core')->jsonEncode($salesEmailsAcion);
2802
  //Order Comments
2803
 
2804
  //Enabled
 
2805
  if(isset($post_data['salesEmailCommentEnableVal']))
2806
  {
2807
  if($storeId == 0)
2817
  Mage::getConfig()->reinit();
2818
  Mage::app()->reinitStores();
2819
  }
2820
+ $salesEmailsAcion['salesEmailCommentEnableSelectedValue'] = Mage::getStoreConfig('sales_email/order_comment/enabled', $storeId);
2821
+
2822
 
2823
 
2824
  //Order Comment Email Sender
2825
+ if(isset($post_data['newOrderConfirmationCommentVal']))
2826
+ {
2827
+ if($storeId == 0)
2828
+ {
2829
+ Mage::getConfig()->saveConfig('sales_email/order_comment/identity', $post_data['newOrderConfirmationCommentVal'], 'default', $storeId);
2830
+ }
2831
+ else
2832
+ {
2833
+ Mage::getConfig()->saveConfig('sales_email/order_comment/identity', $post_data['newOrderConfirmationCommentVal'], 'stores', $storeId);
2834
+ }
2835
+
2836
+ $salesEmailsAcion['successMessage'] = "Order Comment Email Sender updated On ".$storeName." Store.";
2837
+ Mage::getConfig()->reinit();
2838
+ Mage::app()->reinitStores();
2839
+ }
2840
  $newOrderConfirmationSelectedValue = Mage::getStoreConfig('sales_email/order_comment/identity', $storeId);
2841
 
2842
  foreach ($this->emailSendersListArray() as $value)
2858
 
2859
  }
2860
 
2861
+
2862
+
2863
+ //Order Comment Email Template
2864
+ if(isset($post_data['newOrderEmailCommentTemplateVal']))
2865
  {
2866
  if($storeId == 0)
2867
  {
2868
+ Mage::getConfig()->saveConfig('sales_email/order_comment/template', $post_data['newOrderEmailCommentTemplateVal'], 'default', $storeId);
2869
  }
2870
  else
2871
  {
2872
+ Mage::getConfig()->saveConfig('sales_email/order_comment/template', $post_data['newOrderEmailCommentTemplateVal'], 'stores', $storeId);
2873
  }
2874
 
2875
+ $salesEmailsAcion['successMessage'] = "Order Comment Email Template updated On ".$storeName." Store.";
2876
  Mage::getConfig()->reinit();
2877
  Mage::app()->reinitStores();
2878
  }
2879
 
 
 
 
 
2880
  $newOrderEmailTemplateCommentSelectedValue = Mage::getStoreConfig('sales_email/order_comment/template', $storeId);
2881
 
2882
  $newOrderEmailCommentTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
2890
  {
2891
  if($value['value'] == $newOrderEmailTemplateCommentSelectedValue)
2892
  {
2893
+ $newOrderEmailTemArr['label'] = "Order Update (".$value['label'].")";
2894
  $newOrderEmailTemArr['value'] = $value['value'];
2895
  $newOrderEmailTemArr['status'] = 1;
2896
  $salesEmailsAcion['newOrderEmailTempCommentColl'][] = $newOrderEmailTemArr;
2897
  }
2898
  else
2899
  {
2900
+ $newOrderEmailTemArr['label'] = "Order Update (".$value['label'].")";
2901
  $newOrderEmailTemArr['value'] = $value['value'];
2902
  $newOrderEmailTemArr['status'] = 0;
2903
  $salesEmailsAcion['newOrderEmailTempCommentColl'][] = $newOrderEmailTemArr;
2904
  }
2905
  }
2906
  //echo $post_data['emailTemplateVal']."***";
2907
+
2908
+
2909
+
2910
+ //Order Comment Email Template for Guest
2911
+ if(isset($post_data['newOrderForGuestCommentVal']))
2912
  {
2913
  if($storeId == 0)
2914
  {
2915
+ Mage::getConfig()->saveConfig('sales_email/order_comment/guest_template', $post_data['newOrderForGuestCommentVal'], 'default', $storeId);
2916
  }
2917
  else
2918
  {
2919
+ Mage::getConfig()->saveConfig('sales_email/order_comment/guest_template', $post_data['newOrderForGuestCommentVal'], 'stores', $storeId);
2920
  }
2921
 
2922
+ $salesEmailsAcion['successMessage'] = "Order Comment Email Template for Guest updated On ".$storeName." Store.";
2923
  Mage::getConfig()->reinit();
2924
  Mage::app()->reinitStores();
2925
  }
 
 
 
 
2926
  $forGuestEmailTemplateCommentSelectedValue = Mage::getStoreConfig('sales_email/order_comment/guest_template', $storeId);
2927
 
2928
  $newOrderEmailGuestCommentTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
2937
  {
2938
  if($value['value'] == $forGuestEmailTemplateCommentSelectedValue)
2939
  {
2940
+ $forGuestOrderEmailTemArr['label'] = "Order Update for Guest (".$value['label'].")";
2941
  $forGuestOrderEmailTemArr['value'] = $value['value'];
2942
  $forGuestOrderEmailTemArr['status'] = 1;
2943
  $salesEmailsAcion['newOrderForGuestCommentColl'][] = $forGuestOrderEmailTemArr;
2944
  }
2945
  else
2946
  {
2947
+ $forGuestOrderEmailTemArr['label'] = "Order Update for Guest (".$value['label'].")";
2948
  $forGuestOrderEmailTemArr['value'] = $value['value'];
2949
  $forGuestOrderEmailTemArr['status'] = 0;
2950
  $salesEmailsAcion['newOrderForGuestCommentColl'][] = $forGuestOrderEmailTemArr;
2951
  }
2952
  }
2953
  //echo $post_data['emailTemplateVal']."***";
2954
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2955
 
2956
 
2957
 
2958
  //Send Order Comment Email Copy To
 
2959
  if(isset($post_data['emailCopyToCommentVal']))
2960
  {
2961
  if($storeId == 0)
2971
  Mage::getConfig()->reinit();
2972
  Mage::app()->reinitStores();
2973
  }
2974
+ $salesEmailsAcion['emailCopyCommentToSelectedValue'] = Mage::getStoreConfig('sales_email/order_comment/copy_to', $storeId);
2975
+
2976
 
2977
 
2978
  //Send Order Comments Email Copy Method
 
2979
  if(isset($post_data['orderEmailCopyCommentVal']))
2980
  {
2981
  if($storeId == 0)
2991
  Mage::getConfig()->reinit();
2992
  Mage::app()->reinitStores();
2993
  }
2994
+ $salesEmailsAcion['orderEmailCopyCommentSelectedValue'] = Mage::getStoreConfig('sales_email/order_comment/copy_method', $storeId);
2995
+
2996
 
2997
  //echo "<pre>"; print_r($salesEmailsAcion); die;
2998
  $jsonData = Mage::helper('core')->jsonEncode($salesEmailsAcion);
3035
  //Invoice
3036
 
3037
  //Enabled
 
3038
  if(isset($post_data['salesEmailInvoiceEnableVal']))
3039
  {
3040
  if($storeId == 0)
3050
  Mage::getConfig()->reinit();
3051
  Mage::app()->reinitStores();
3052
  }
3053
+ $salesEmailsAcion['salesEmailInvoiceEnableSelectedValue'] = Mage::getStoreConfig('sales_email/invoice/enabled', $storeId);
3054
+
3055
 
3056
 
3057
  //Invoice Email Sender
3058
+ if(isset($post_data['invoiceEmailVal']))
3059
+ {
3060
+ if($storeId == 0)
3061
+ {
3062
+ Mage::getConfig()->saveConfig('sales_email/invoice/identity', $post_data['invoiceEmailVal'], 'default', $storeId);
3063
+ }
3064
+ else
3065
+ {
3066
+ Mage::getConfig()->saveConfig('sales_email/invoice/identity', $post_data['invoiceEmailVal'], 'stores', $storeId);
3067
+ }
3068
+
3069
+ $salesEmailsAcion['successMessage'] = "Invoice Email updated On ".$storeName." Store.";
3070
+ Mage::getConfig()->reinit();
3071
+ Mage::app()->reinitStores();
3072
+ }
3073
  $invoiceEmailSelectedValue = Mage::getStoreConfig('sales_email/invoice/identity', $storeId);
3074
 
3075
  foreach ($this->emailSendersListArray() as $value)
3091
 
3092
  }
3093
 
3094
+
3095
+
3096
+
3097
+ //Invoice Email Template
3098
+ if(isset($post_data['newOrderInvoiceEmailTemplateVal']))
3099
  {
3100
  if($storeId == 0)
3101
  {
3102
+ Mage::getConfig()->saveConfig('sales_email/invoice/template', $post_data['newOrderInvoiceEmailTemplateVal'], 'default', $storeId);
3103
  }
3104
  else
3105
  {
3106
+ Mage::getConfig()->saveConfig('sales_email/invoice/template', $post_data['newOrderInvoiceEmailTemplateVal'], 'stores', $storeId);
3107
  }
3108
 
3109
+ $salesEmailsAcion['successMessage'] = "Invoice Email Template updated On ".$storeName." Store.";
3110
  Mage::getConfig()->reinit();
3111
  Mage::app()->reinitStores();
3112
  }
 
 
 
 
 
3113
  $newOrderInvoiceEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/invoice/template', $storeId);
3114
 
3115
  $newOrderInvoiceEmailTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
3123
  {
3124
  if($value['value'] == $newOrderInvoiceEmailTemplateSelectedValue)
3125
  {
3126
+ $newOrderEmailTemArr['label'] = "New Invoice (".$value['label'].")";
3127
  $newOrderEmailTemArr['value'] = $value['value'];
3128
  $newOrderEmailTemArr['status'] = 1;
3129
  $salesEmailsAcion['newOrderInvoiceEmailTempColl'][] = $newOrderEmailTemArr;
3130
  }
3131
  else
3132
  {
3133
+ $newOrderEmailTemArr['label'] = "New Invoice (".$value['label'].")";
3134
  $newOrderEmailTemArr['value'] = $value['value'];
3135
  $newOrderEmailTemArr['status'] = 0;
3136
  $salesEmailsAcion['newOrderInvoiceEmailTempColl'][] = $newOrderEmailTemArr;
3137
  }
3138
  }
3139
  //echo $post_data['emailTemplateVal']."***";
3140
+
3141
+
3142
+
3143
+
3144
+ //Invoice Email Template for Guest
3145
+ if(isset($post_data['newOrderInvoiceForGuestVal']))
3146
  {
3147
  if($storeId == 0)
3148
  {
3149
+ Mage::getConfig()->saveConfig('sales_email/invoice/guest_template', $post_data['newOrderInvoiceForGuestVal'], 'default', $storeId);
3150
  }
3151
  else
3152
  {
3153
+ Mage::getConfig()->saveConfig('sales_email/invoice/guest_template', $post_data['newOrderInvoiceForGuestVal'], 'stores', $storeId);
3154
  }
3155
 
3156
+ $salesEmailsAcion['successMessage'] = "Invoice Email Template for Guest updated On ".$storeName." Store.";
3157
  Mage::getConfig()->reinit();
3158
  Mage::app()->reinitStores();
3159
  }
 
 
 
 
3160
  $forGuestInvoiceEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/invoice/guest_template', $storeId);
3161
 
3162
  $newOrderInvoiceEmailGuestTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
3171
  {
3172
  if($value['value'] == $forGuestInvoiceEmailTemplateSelectedValue)
3173
  {
3174
+ $forGuestOrderEmailTemArr['label'] = "New Invoice for Guest (".$value['label'].")";
3175
  $forGuestOrderEmailTemArr['value'] = $value['value'];
3176
  $forGuestOrderEmailTemArr['status'] = 1;
3177
  $salesEmailsAcion['newOrderInvoiceForGuestColl'][] = $forGuestOrderEmailTemArr;
3178
  }
3179
  else
3180
  {
3181
+ $forGuestOrderEmailTemArr['label'] = "New Invoice for Guest (".$value['label'].")";
3182
  $forGuestOrderEmailTemArr['value'] = $value['value'];
3183
  $forGuestOrderEmailTemArr['status'] = 0;
3184
  $salesEmailsAcion['newOrderInvoiceForGuestColl'][] = $forGuestOrderEmailTemArr;
3185
  }
3186
  }
3187
  //echo $post_data['emailTemplateVal']."***";
3188
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3189
 
3190
 
3191
 
3192
  //Send Invoice Email Copy To
 
3193
  if(isset($post_data['emailInvoiceCopyToVal']))
3194
  {
3195
  if($storeId == 0)
3205
  Mage::getConfig()->reinit();
3206
  Mage::app()->reinitStores();
3207
  }
3208
+ $salesEmailsAcion['emailInvoiceCopyToSelectedValue'] = Mage::getStoreConfig('sales_email/invoice/copy_to', $storeId);
3209
+
3210
 
3211
 
3212
  //Send Invoice Email Copy Method
 
3213
  if(isset($post_data['orderInvoiceEmailCopyVal']))
3214
  {
3215
  if($storeId == 0)
3225
  Mage::getConfig()->reinit();
3226
  Mage::app()->reinitStores();
3227
  }
3228
+ $salesEmailsAcion['orderInvoiceEmailCopySelectedValue'] = Mage::getStoreConfig('sales_email/invoice/copy_method', $storeId);
3229
+
3230
 
3231
  // echo "<pre>"; print_r($salesEmailsAcion); die;
3232
  $jsonData = Mage::helper('core')->jsonEncode($salesEmailsAcion);
3269
  //Invoice Comments
3270
 
3271
  //Enabled
 
3272
  if(isset($post_data['salesEmailInvoiceCommentEnableVal']))
3273
  {
3274
  if($storeId == 0)
3284
  Mage::getConfig()->reinit();
3285
  Mage::app()->reinitStores();
3286
  }
3287
+ $salesEmailsAcion['salesEmailInvoiceCommentEnableSelectedValue'] = Mage::getStoreConfig('sales_email/invoice_comment/enabled', $storeId);
3288
+
3289
 
3290
 
3291
  //Invoice Comment Email Sender
3292
+ if(isset($post_data['invoiceCommentEmailVal']))
3293
+ {
3294
+ if($storeId == 0)
3295
+ {
3296
+ Mage::getConfig()->saveConfig('sales_email/invoice_comment/identity', $post_data['invoiceCommentEmailVal'], 'default', $storeId);
3297
+ }
3298
+ else
3299
+ {
3300
+ Mage::getConfig()->saveConfig('sales_email/invoice_comment/identity', $post_data['invoiceCommentEmailVal'], 'stores', $storeId);
3301
+ }
3302
+
3303
+ $salesEmailsAcion['successMessage'] = "Invoice Comment Email Sender updated On ".$storeName." Store.";
3304
+ Mage::getConfig()->reinit();
3305
+ Mage::app()->reinitStores();
3306
+ }
3307
  $invoiceCommentEmailSelectedValue = Mage::getStoreConfig('sales_email/invoice_comment/identity', $storeId);
3308
 
3309
  foreach ($this->emailSendersListArray() as $value)
3325
 
3326
  }
3327
 
3328
+
3329
+
3330
+ //Invoice Comment Email Template
3331
+ if(isset($post_data['newOrderInvoiceCommentEmailTemplateVal']))
3332
  {
3333
  if($storeId == 0)
3334
  {
3335
+ Mage::getConfig()->saveConfig('sales_email/invoice_comment/template', $post_data['newOrderInvoiceCommentEmailTemplateVal'], 'default', $storeId);
3336
  }
3337
  else
3338
  {
3339
+ Mage::getConfig()->saveConfig('sales_email/invoice_comment/template', $post_data['newOrderInvoiceCommentEmailTemplateVal'], 'stores', $storeId);
3340
  }
3341
 
3342
+ $salesEmailsAcion['successMessage'] = "Invoice Comment Email Template updated On ".$storeName." Store.";
3343
  Mage::getConfig()->reinit();
3344
  Mage::app()->reinitStores();
3345
  }
 
 
 
 
 
3346
  $newOrderInvoiceCommentEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/invoice_comment/template', $storeId);
3347
 
3348
  $newOrderInvoiceCommentEmailTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
3356
  {
3357
  if($value['value'] == $newOrderInvoiceCommentEmailTemplateSelectedValue)
3358
  {
3359
+ $newOrderEmailTemArr['label'] = "Invoice Update (".$value['label'].")";
3360
  $newOrderEmailTemArr['value'] = $value['value'];
3361
  $newOrderEmailTemArr['status'] = 1;
3362
  $salesEmailsAcion['newOrderInvoiceCommentEmailTempColl'][] = $newOrderEmailTemArr;
3363
  }
3364
  else
3365
  {
3366
+ $newOrderEmailTemArr['label'] = "Invoice Update (".$value['label'].")";
3367
  $newOrderEmailTemArr['value'] = $value['value'];
3368
  $newOrderEmailTemArr['status'] = 0;
3369
  $salesEmailsAcion['newOrderInvoiceCommentEmailTempColl'][] = $newOrderEmailTemArr;
3370
  }
3371
  }
3372
  //echo $post_data['emailTemplateVal']."***";
3373
+
3374
+
3375
+
3376
+
3377
+ //Invoice Comment Email Template for Guest
3378
+ if(isset($post_data['newOrderInvoiceCommentsForGuestVal']))
3379
  {
3380
  if($storeId == 0)
3381
  {
3382
+ Mage::getConfig()->saveConfig('sales_email/invoice_comment/guest_template', $post_data['newOrderInvoiceCommentsForGuestVal'], 'default', $storeId);
3383
  }
3384
  else
3385
  {
3386
+ Mage::getConfig()->saveConfig('sales_email/invoice_comment/guest_template', $post_data['newOrderInvoiceCommentsForGuestVal'], 'stores', $storeId);
3387
  }
3388
 
3389
+ $salesEmailsAcion['successMessage'] = "Invoice Comment Email Template for Guest updated On ".$storeName." Store.";
3390
  Mage::getConfig()->reinit();
3391
  Mage::app()->reinitStores();
3392
  }
 
 
 
 
3393
  $forGuestInvoiceCommentsEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/invoice_comment/guest_template', $storeId);
3394
 
3395
  $newOrderInvoiceCommentEmailGuestTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
3404
  {
3405
  if($value['value'] == $forGuestInvoiceCommentsEmailTemplateSelectedValue)
3406
  {
3407
+ $forGuestOrderEmailTemArr['label'] = "Invoice Update for Guest (".$value['label'].")";
3408
  $forGuestOrderEmailTemArr['value'] = $value['value'];
3409
  $forGuestOrderEmailTemArr['status'] = 1;
3410
  $salesEmailsAcion['newOrderInvoiceCommentsForGuestColl'][] = $forGuestOrderEmailTemArr;
3411
  }
3412
  else
3413
  {
3414
+ $forGuestOrderEmailTemArr['label'] = "Invoice Update for Guest (".$value['label'].")";
3415
  $forGuestOrderEmailTemArr['value'] = $value['value'];
3416
  $forGuestOrderEmailTemArr['status'] = 0;
3417
  $salesEmailsAcion['newOrderInvoiceCommentsForGuestColl'][] = $forGuestOrderEmailTemArr;
3418
  }
3419
  }
3420
  //echo $post_data['emailTemplateVal']."***";
3421
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3422
 
3423
 
3424
 
3425
  //Send Invoice Comment Email Copy To
 
3426
  if(isset($post_data['emailInvoiceCommentCopyToVal']))
3427
  {
3428
  if($storeId == 0)
3438
  Mage::getConfig()->reinit();
3439
  Mage::app()->reinitStores();
3440
  }
3441
+ $salesEmailsAcion['emailInvoiceCommentsCopyToSelectedValue'] = Mage::getStoreConfig('sales_email/invoice_comment/copy_to', $storeId);
3442
+
3443
 
3444
 
3445
  //Send Invoice Comments Email Copy Method
 
3446
  if(isset($post_data['orderInvoiceCommentEmailCopyVal']))
3447
  {
3448
  if($storeId == 0)
3458
  Mage::getConfig()->reinit();
3459
  Mage::app()->reinitStores();
3460
  }
3461
+ $salesEmailsAcion['orderInvoiceCommentEmailCopySelectedValue'] = Mage::getStoreConfig('sales_email/invoice_comment/copy_method', $storeId);
3462
+
3463
 
3464
  // echo "<pre>"; print_r($salesEmailsAcion); die;
3465
  $jsonData = Mage::helper('core')->jsonEncode($salesEmailsAcion);
3502
  //Shipment
3503
 
3504
  //Enabled
 
3505
  if(isset($post_data['salesEmailShipmentEnableVal']))
3506
  {
3507
  if($storeId == 0)
3517
  Mage::getConfig()->reinit();
3518
  Mage::app()->reinitStores();
3519
  }
3520
+ $salesEmailsAcion['salesEmailShipmentEnableSelectedValue'] = Mage::getStoreConfig('sales_email/shipment/enabled', $storeId);
3521
+
3522
 
3523
 
3524
  //Shipment Email Sender
3525
+ if(isset($post_data['shipmentEmailVal']))
3526
+ {
3527
+ if($storeId == 0)
3528
+ {
3529
+ Mage::getConfig()->saveConfig('sales_email/shipment/identity', $post_data['shipmentEmailVal'], 'default', $storeId);
3530
+ }
3531
+ else
3532
+ {
3533
+ Mage::getConfig()->saveConfig('sales_email/shipment/identity', $post_data['shipmentEmailVal'], 'stores', $storeId);
3534
+ }
3535
+
3536
+ $salesEmailsAcion['successMessage'] = "Shipment Email Sender updated On ".$storeName." Store.";
3537
+ Mage::getConfig()->reinit();
3538
+ Mage::app()->reinitStores();
3539
+ }
3540
  $shipmentEmailSelectedValue = Mage::getStoreConfig('sales_email/shipment/identity', $storeId);
3541
 
3542
  foreach ($this->emailSendersListArray() as $value)
3558
 
3559
  }
3560
 
3561
+
3562
+
3563
+
3564
+ //Shipment Email Template
3565
+ if(isset($post_data['newOrderShipmentEmailTemplateVal']))
3566
  {
3567
  if($storeId == 0)
3568
  {
3569
+ Mage::getConfig()->saveConfig('sales_email/shipment/template', $post_data['newOrderShipmentEmailTemplateVal'], 'default', $storeId);
3570
  }
3571
  else
3572
  {
3573
+ Mage::getConfig()->saveConfig('sales_email/shipment/template', $post_data['newOrderShipmentEmailTemplateVal'], 'stores', $storeId);
3574
  }
3575
 
3576
+ $salesEmailsAcion['successMessage'] = "Shipment Email Template updated On ".$storeName." Store.";
3577
  Mage::getConfig()->reinit();
3578
  Mage::app()->reinitStores();
3579
  }
 
 
 
 
 
3580
  $newOrderShipmentEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/shipment/template', $storeId);
3581
 
3582
  $newOrderShipmentEmailTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
3590
  {
3591
  if($value['value'] == $newOrderShipmentEmailTemplateSelectedValue)
3592
  {
3593
+ $newOrderEmailTemArr['label'] = "New Shipment (".$value['label'].")";
3594
  $newOrderEmailTemArr['value'] = $value['value'];
3595
  $newOrderEmailTemArr['status'] = 1;
3596
  $salesEmailsAcion['newOrderShipmentEmailTempColl'][] = $newOrderEmailTemArr;
3597
  }
3598
  else
3599
  {
3600
+ $newOrderEmailTemArr['label'] = "New Shipment (".$value['label'].")";
3601
  $newOrderEmailTemArr['value'] = $value['value'];
3602
  $newOrderEmailTemArr['status'] = 0;
3603
  $salesEmailsAcion['newOrderShipmentEmailTempColl'][] = $newOrderEmailTemArr;
3604
  }
3605
  }
3606
  //echo $post_data['emailTemplateVal']."***";
3607
+
3608
+
3609
+
3610
+
3611
+ //Shipment Email Template for Guest
3612
+ if(isset($post_data['newOrderShipmentForGuestVal']))
3613
  {
3614
  if($storeId == 0)
3615
  {
3616
+ Mage::getConfig()->saveConfig('sales_email/shipment/guest_template', $post_data['newOrderShipmentForGuestVal'], 'default', $storeId);
3617
  }
3618
  else
3619
  {
3620
+ Mage::getConfig()->saveConfig('sales_email/shipment/guest_template', $post_data['newOrderShipmentForGuestVal'], 'stores', $storeId);
3621
  }
3622
 
3623
+ $salesEmailsAcion['successMessage'] = "Shipment Email Template for Guest updated On ".$storeName." Store.";
3624
  Mage::getConfig()->reinit();
3625
  Mage::app()->reinitStores();
3626
  }
 
 
 
 
3627
  $forGuestShipmentEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/shipment/guest_template', $storeId);
3628
 
3629
  $newOrderShipmentEmailGuestTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
3638
  {
3639
  if($value['value'] == $forGuestShipmentEmailTemplateSelectedValue)
3640
  {
3641
+ $forGuestOrderEmailTemArr['label'] = "New Shipment for Guest (".$value['label'].")";
3642
  $forGuestOrderEmailTemArr['value'] = $value['value'];
3643
  $forGuestOrderEmailTemArr['status'] = 1;
3644
  $salesEmailsAcion['newOrderShipmentForGuestColl'][] = $forGuestOrderEmailTemArr;
3645
  }
3646
  else
3647
  {
3648
+ $forGuestOrderEmailTemArr['label'] = "New Shipment for Guest (".$value['label'].")";
3649
  $forGuestOrderEmailTemArr['value'] = $value['value'];
3650
  $forGuestOrderEmailTemArr['status'] = 0;
3651
  $salesEmailsAcion['newOrderShipmentForGuestColl'][] = $forGuestOrderEmailTemArr;
3652
  }
3653
  }
3654
  //echo $post_data['emailTemplateVal']."***";
3655
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3656
 
3657
 
3658
 
3659
  //Send Shipment Email Copy To
 
3660
  if(isset($post_data['emailShipmentCopyToVal']))
3661
  {
3662
  if($storeId == 0)
3672
  Mage::getConfig()->reinit();
3673
  Mage::app()->reinitStores();
3674
  }
3675
+ $salesEmailsAcion['emailShipmentCopyToSelectedValue'] = Mage::getStoreConfig('sales_email/shipment/copy_to', $storeId);
3676
+
3677
 
3678
 
3679
  //Send Shipment Email Copy Method
 
3680
  if(isset($post_data['orderShipmentEmailCopyVal']))
3681
  {
3682
  if($storeId == 0)
3692
  Mage::getConfig()->reinit();
3693
  Mage::app()->reinitStores();
3694
  }
3695
+ $salesEmailsAcion['orderShipmentEmailCopySelectedValue'] = Mage::getStoreConfig('sales_email/shipment/copy_method', $storeId);
3696
+
3697
 
3698
  // echo "<pre>"; print_r($salesEmailsAcion); die;
3699
  $jsonData = Mage::helper('core')->jsonEncode($salesEmailsAcion);
3736
  //Shipment Comments
3737
 
3738
  //Enabled
 
3739
  if(isset($post_data['salesEmailShipmentCommentsEnableVal']))
3740
  {
3741
  if($storeId == 0)
3751
  Mage::getConfig()->reinit();
3752
  Mage::app()->reinitStores();
3753
  }
3754
+ $salesEmailsAcion['salesEmailShipmentCommentsEnableSelectedValue'] = Mage::getStoreConfig('sales_email/shipment_comment/enabled', $storeId);
3755
+
3756
 
3757
 
3758
  //Shipment Comment Email Sender
3759
+ if(isset($post_data['shipmentCommentsEmailVal']))
 
 
3760
  {
3761
+ if($storeId == 0)
3762
  {
3763
+ Mage::getConfig()->saveConfig('sales_email/shipment_comment/identity', $post_data['shipmentCommentsEmailVal'], 'default', $storeId);
3764
+ }
3765
+ else
3766
+ {
3767
+ Mage::getConfig()->saveConfig('sales_email/shipment_comment/identity', $post_data['shipmentCommentsEmailVal'], 'stores', $storeId);
3768
+ }
3769
+
3770
+ $salesEmailsAcion['successMessage'] = "Shipment Comment Email Sender updated On ".$storeName." Store.";
3771
+ Mage::getConfig()->reinit();
3772
+ Mage::app()->reinitStores();
3773
+ }
3774
+ $shipmentCommentsEmailSelectedValue = Mage::getStoreConfig('sales_email/shipment_comment/identity', $storeId);
3775
+
3776
+ foreach ($this->emailSendersListArray() as $value)
3777
+ {
3778
+ if($value['value'] == $shipmentCommentsEmailSelectedValue)
3779
+ {
3780
+ $emailComArr['label'] = $value['label'];
3781
+ $emailComArr['value'] = $value['value'];
3782
+ $emailComArr['status'] = 1;
3783
+ $salesEmailsAcion['shipmentCommentsEmailList'][] = $emailComArr;
3784
  }
3785
  else
3786
  {
3792
 
3793
  }
3794
 
3795
+
3796
+
3797
+ //Shipment Comment Email Template
3798
+ if(isset($post_data['newOrderShipmentCommentsEmailTemplateVal']))
3799
  {
3800
  if($storeId == 0)
3801
  {
3802
+ Mage::getConfig()->saveConfig('sales_email/shipment_comment/template', $post_data['newOrderShipmentCommentsEmailTemplateVal'], 'default', $storeId);
3803
  }
3804
  else
3805
  {
3806
+ Mage::getConfig()->saveConfig('sales_email/shipment_comment/template', $post_data['newOrderShipmentCommentsEmailTemplateVal'], 'stores', $storeId);
3807
  }
3808
 
3809
+ $salesEmailsAcion['successMessage'] = "Shipment Comment Email Template updated On ".$storeName." Store.";
3810
  Mage::getConfig()->reinit();
3811
  Mage::app()->reinitStores();
3812
  }
 
 
 
 
 
3813
  $newOrderShipmentCommentsEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/shipment_comment/template', $storeId);
3814
 
3815
  $newOrderShipmentCommentsEmailTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
3823
  {
3824
  if($value['value'] == $newOrderShipmentCommentsEmailTemplateSelectedValue)
3825
  {
3826
+ $newOrderEmailTemArr['label'] = "Shipment Update (".$value['label'].")";
3827
  $newOrderEmailTemArr['value'] = $value['value'];
3828
  $newOrderEmailTemArr['status'] = 1;
3829
  $salesEmailsAcion['newOrderShipmentCommentsEmailTempColl'][] = $newOrderEmailTemArr;
3830
  }
3831
  else
3832
  {
3833
+ $newOrderEmailTemArr['label'] = "Shipment Update (".$value['label'].")";
3834
  $newOrderEmailTemArr['value'] = $value['value'];
3835
  $newOrderEmailTemArr['status'] = 0;
3836
  $salesEmailsAcion['newOrderShipmentCommentsEmailTempColl'][] = $newOrderEmailTemArr;
3837
  }
3838
  }
3839
  //echo $post_data['emailTemplateVal']."***";
3840
+
3841
+
3842
+
3843
+
3844
+ //Shipment Comment Email Template for Guest
3845
+ if(isset($post_data['newOrderShipmentCommentsForGuestVal']))
3846
  {
3847
  if($storeId == 0)
3848
  {
3849
+ Mage::getConfig()->saveConfig('sales_email/shipment_comment/guest_template', $post_data['newOrderShipmentCommentsForGuestVal'], 'default', $storeId);
3850
  }
3851
  else
3852
  {
3853
+ Mage::getConfig()->saveConfig('sales_email/shipment_comment/guest_template', $post_data['newOrderShipmentCommentsForGuestVal'], 'stores', $storeId);
3854
  }
3855
 
3856
+ $salesEmailsAcion['successMessage'] = "Shipment Comment Email Template for Guest updated On ".$storeName." Store.";
3857
  Mage::getConfig()->reinit();
3858
  Mage::app()->reinitStores();
3859
  }
3860
 
 
 
 
3861
  $forGuestShipmentCommentsEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/shipment_comment/guest_template', $storeId);
3862
 
3863
  $newOrderShipmentCommentsEmailGuestTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
3872
  {
3873
  if($value['value'] == $forGuestShipmentCommentsEmailTemplateSelectedValue)
3874
  {
3875
+ $forGuestOrderEmailTemArr['label'] = "Shipment Update for Guest (".$value['label'].")";
3876
  $forGuestOrderEmailTemArr['value'] = $value['value'];
3877
  $forGuestOrderEmailTemArr['status'] = 1;
3878
  $salesEmailsAcion['newOrderShipmentCommentsForGuestColl'][] = $forGuestOrderEmailTemArr;
3879
  }
3880
  else
3881
  {
3882
+ $forGuestOrderEmailTemArr['label'] = "Shipment Update for Guest (".$value['label'].")";
3883
  $forGuestOrderEmailTemArr['value'] = $value['value'];
3884
  $forGuestOrderEmailTemArr['status'] = 0;
3885
  $salesEmailsAcion['newOrderShipmentCommentsForGuestColl'][] = $forGuestOrderEmailTemArr;
3886
  }
3887
  }
3888
  //echo $post_data['emailTemplateVal']."***";
3889
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3890
 
3891
 
3892
 
3893
  //Send Shipment Comment Email Copy To
 
3894
  if(isset($post_data['emailShipmentCommentsCopyToVal']))
3895
  {
3896
  if($storeId == 0)
3906
  Mage::getConfig()->reinit();
3907
  Mage::app()->reinitStores();
3908
  }
3909
+ $salesEmailsAcion['emailShipmentCommentsCopyToSelectedValue'] = Mage::getStoreConfig('sales_email/shipment_comment/copy_to', $storeId);
3910
+
3911
 
3912
 
3913
  //Send Shipment Comments Email Copy Method
 
3914
  if(isset($post_data['orderShipmentCommentsEmailCopyVal']))
3915
  {
3916
  if($storeId == 0)
3926
  Mage::getConfig()->reinit();
3927
  Mage::app()->reinitStores();
3928
  }
3929
+ $salesEmailsAcion['orderShipmentCommentsEmailCopySelectedValue'] = Mage::getStoreConfig('sales_email/shipment_comment/copy_method', $storeId);
3930
+
3931
 
3932
  // echo "<pre>"; print_r($salesEmailsAcion); die;
3933
  $jsonData = Mage::helper('core')->jsonEncode($salesEmailsAcion);
3970
  //Credit Memo
3971
 
3972
  //Enabled
 
3973
  if(isset($post_data['salesEmailCreditMemoEnableVal']))
3974
  {
3975
  if($storeId == 0)
3985
  Mage::getConfig()->reinit();
3986
  Mage::app()->reinitStores();
3987
  }
3988
+ $salesEmailsAcion['salesEmailCreditMemoEnableSelectedValue'] = Mage::getStoreConfig('sales_email/creditmemo/enabled', $storeId);
3989
+
3990
 
3991
 
3992
  //Credit Memo Email Sender
3993
+ if(isset($post_data['creditMemoEmailVal']))
3994
+ {
3995
+ if($storeId == 0)
3996
+ {
3997
+ Mage::getConfig()->saveConfig('sales_email/creditmemo/identity', $post_data['creditMemoEmailVal'], 'default', $storeId);
3998
+ }
3999
+ else
4000
+ {
4001
+ Mage::getConfig()->saveConfig('sales_email/creditmemo/identity', $post_data['creditMemoEmailVal'], 'stores', $storeId);
4002
+ }
4003
+
4004
+ $salesEmailsAcion['successMessage'] = "Credit Memo Email Sender updated On ".$storeName." Store.";
4005
+ Mage::getConfig()->reinit();
4006
+ Mage::app()->reinitStores();
4007
+ }
4008
+
4009
  $creditMemoEmailSelectedValue = Mage::getStoreConfig('sales_email/creditmemo/identity', $storeId);
4010
 
4011
  foreach ($this->emailSendersListArray() as $value)
4027
 
4028
  }
4029
 
4030
+
4031
+
4032
+ //Credit Memo Email Template
4033
+ if(isset($post_data['newOrderCreditMemoEmailTemplateVal']))
4034
  {
4035
  if($storeId == 0)
4036
  {
4037
+ Mage::getConfig()->saveConfig('sales_email/creditmemo/template', $post_data['newOrderCreditMemoEmailTemplateVal'], 'default', $storeId);
4038
  }
4039
  else
4040
  {
4041
+ Mage::getConfig()->saveConfig('sales_email/creditmemo/template', $post_data['newOrderCreditMemoEmailTemplateVal'], 'stores', $storeId);
4042
  }
4043
 
4044
+ $salesEmailsAcion['successMessage'] = "Credit Memo Email Template updated On ".$storeName." Store.";
4045
  Mage::getConfig()->reinit();
4046
  Mage::app()->reinitStores();
4047
  }
4048
 
 
 
 
 
4049
  $newOrderCreditMemoEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/creditmemo/template', $storeId);
4050
 
4051
  $newOrderCreditMemoEmailTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
4059
  {
4060
  if($value['value'] == $newOrderCreditMemoEmailTemplateSelectedValue)
4061
  {
4062
+ $newOrderEmailTemArr['label'] = "New Credit Memo (".$value['label'].")";
4063
  $newOrderEmailTemArr['value'] = $value['value'];
4064
  $newOrderEmailTemArr['status'] = 1;
4065
  $salesEmailsAcion['newOrderCreditMemoEmailTempColl'][] = $newOrderEmailTemArr;
4066
  }
4067
  else
4068
  {
4069
+ $newOrderEmailTemArr['label'] = "New Credit Memo (".$value['label'].")";
4070
  $newOrderEmailTemArr['value'] = $value['value'];
4071
  $newOrderEmailTemArr['status'] = 0;
4072
  $salesEmailsAcion['newOrderCreditMemoEmailTempColl'][] = $newOrderEmailTemArr;
4073
  }
4074
  }
4075
  //echo $post_data['emailTemplateVal']."***";
4076
+
4077
+
4078
+
4079
+
4080
+ //Credit Memo Email Template for Guest
4081
+ if(isset($post_data['newOrderCreditMemoForGuestVal']))
4082
  {
4083
  if($storeId == 0)
4084
  {
4085
+ Mage::getConfig()->saveConfig('sales_email/creditmemo/guest_template', $post_data['newOrderCreditMemoForGuestVal'], 'default', $storeId);
4086
  }
4087
  else
4088
  {
4089
+ Mage::getConfig()->saveConfig('sales_email/creditmemo/guest_template', $post_data['newOrderCreditMemoForGuestVal'], 'stores', $storeId);
4090
  }
4091
 
4092
+ $salesEmailsAcion['successMessage'] = "Credit Memo Email Template for Guest updated On ".$storeName." Store.";
4093
  Mage::getConfig()->reinit();
4094
  Mage::app()->reinitStores();
4095
  }
4096
 
 
 
 
4097
  $forGuestCreditMemoEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/creditmemo/guest_template', $storeId);
4098
 
4099
  $newOrderCreditMemoEmailGuestTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
4108
  {
4109
  if($value['value'] == $forGuestCreditMemoEmailTemplateSelectedValue)
4110
  {
4111
+ $forGuestOrderEmailTemArr['label'] = "New Credit Memo for Guest (".$value['label'].")";
4112
  $forGuestOrderEmailTemArr['value'] = $value['value'];
4113
  $forGuestOrderEmailTemArr['status'] = 1;
4114
  $salesEmailsAcion['newOrderCreditMemoForGuestColl'][] = $forGuestOrderEmailTemArr;
4115
  }
4116
  else
4117
  {
4118
+ $forGuestOrderEmailTemArr['label'] = "New Credit Memo for Guest (".$value['label'].")";
4119
  $forGuestOrderEmailTemArr['value'] = $value['value'];
4120
  $forGuestOrderEmailTemArr['status'] = 0;
4121
  $salesEmailsAcion['newOrderCreditMemoForGuestColl'][] = $forGuestOrderEmailTemArr;
4122
  }
4123
  }
4124
  //echo $post_data['emailTemplateVal']."***";
4125
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4126
 
4127
 
4128
 
4129
  //Send Credit Memo Email Copy To
 
4130
  if(isset($post_data['emailCreditMemoCopyToVal']))
4131
  {
4132
  if($storeId == 0)
4142
  Mage::getConfig()->reinit();
4143
  Mage::app()->reinitStores();
4144
  }
4145
+ $salesEmailsAcion['emailCreditMemoCopyToSelectedValue'] = Mage::getStoreConfig('sales_email/creditmemo/copy_to', $storeId);
4146
+
4147
 
4148
 
4149
  //Send Credit Memo Email Copy Method
 
4150
  if(isset($post_data['orderCreditMemoEmailCopyVal']))
4151
  {
4152
  if($storeId == 0)
4162
  Mage::getConfig()->reinit();
4163
  Mage::app()->reinitStores();
4164
  }
4165
+ $salesEmailsAcion['orderCreditMemoEmailCopySelectedValue'] = Mage::getStoreConfig('sales_email/creditmemo/copy_method', $storeId);
4166
+
4167
 
4168
  // echo "<pre>"; print_r($salesEmailsAcion); die;
4169
  $jsonData = Mage::helper('core')->jsonEncode($salesEmailsAcion);
4206
  //Credit Memo Comments
4207
 
4208
  //Enabled
 
4209
  if(isset($post_data['salesEmailCreditMemoCommentsEnableVal']))
4210
  {
4211
  if($storeId == 0)
4221
  Mage::getConfig()->reinit();
4222
  Mage::app()->reinitStores();
4223
  }
4224
+ $salesEmailsAcion['salesEmailCreditMemoCommentsEnableSelectedValue'] = Mage::getStoreConfig('sales_email/creditmemo_comment/enabled', $storeId);
4225
+
4226
 
4227
 
4228
  //Credit Memo Comment Email Sender
4229
+ if(isset($post_data['creditMemoCommentEmailVal']))
4230
+ {
4231
+ if($storeId == 0)
4232
+ {
4233
+ Mage::getConfig()->saveConfig('sales_email/creditmemo_comment/identity', $post_data['creditMemoCommentEmailVal'], 'default', $storeId);
4234
+ }
4235
+ else
4236
+ {
4237
+ Mage::getConfig()->saveConfig('sales_email/creditmemo_comment/identity', $post_data['creditMemoCommentEmailVal'], 'stores', $storeId);
4238
+ }
4239
+
4240
+ $salesEmailsAcion['successMessage'] = "Credit Memo Comment Email Sender updated On ".$storeName." Store.";
4241
+ Mage::getConfig()->reinit();
4242
+ Mage::app()->reinitStores();
4243
+ }
4244
+
4245
  $creditMemoCommentEmailSelectedValue = Mage::getStoreConfig('sales_email/creditmemo_comment/identity', $storeId);
4246
 
4247
  foreach ($this->emailSendersListArray() as $value)
4263
 
4264
  }
4265
 
4266
+
4267
+
4268
+
4269
+ //Credit Memo Comment Email Template
4270
+ if(isset($post_data['newOrderCreditMemoCommentsEmailTemplateVal']))
4271
  {
4272
  if($storeId == 0)
4273
  {
4274
+ Mage::getConfig()->saveConfig('sales_email/creditmemo_comment/template', $post_data['newOrderCreditMemoCommentsEmailTemplateVal'], 'default', $storeId);
4275
  }
4276
  else
4277
  {
4278
+ Mage::getConfig()->saveConfig('sales_email/creditmemo_comment/template', $post_data['newOrderCreditMemoCommentsEmailTemplateVal'], 'stores', $storeId);
4279
  }
4280
 
4281
+ $salesEmailsAcion['successMessage'] = "Credit Memo Comment Email Template updated On ".$storeName." Store.";
4282
  Mage::getConfig()->reinit();
4283
  Mage::app()->reinitStores();
4284
  }
4285
 
 
 
 
 
4286
  $newOrderCreditMemoCommentEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/creditmemo_comment/template', $storeId);
4287
 
4288
  $newOrderCreditMemoCommentEmailTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
4296
  {
4297
  if($value['value'] == $newOrderCreditMemoCommentEmailTemplateSelectedValue)
4298
  {
4299
+ $newOrderEmailTemArr['label'] = "Credit Memo Update (".$value['label'].")";
4300
  $newOrderEmailTemArr['value'] = $value['value'];
4301
  $newOrderEmailTemArr['status'] = 1;
4302
  $salesEmailsAcion['newOrderCreditMemoCommentsEmailTempColl'][] = $newOrderEmailTemArr;
4303
  }
4304
  else
4305
  {
4306
+ $newOrderEmailTemArr['label'] = "Credit Memo Update (".$value['label'].")";
4307
  $newOrderEmailTemArr['value'] = $value['value'];
4308
  $newOrderEmailTemArr['status'] = 0;
4309
  $salesEmailsAcion['newOrderCreditMemoCommentsEmailTempColl'][] = $newOrderEmailTemArr;
4310
  }
4311
  }
4312
  //echo $post_data['emailTemplateVal']."***";
4313
+
4314
+
4315
+
4316
+
4317
+ //Credit Memo Comment Email Template for Guest
4318
+ if(isset($post_data['newOrderCreditMemoCommentsForGuestVal']))
4319
  {
4320
  if($storeId == 0)
4321
  {
4322
+ Mage::getConfig()->saveConfig('sales_email/creditmemo_comment/guest_template', $post_data['newOrderCreditMemoCommentsForGuestVal'], 'default', $storeId);
4323
  }
4324
  else
4325
  {
4326
+ Mage::getConfig()->saveConfig('sales_email/creditmemo_comment/guest_template', $post_data['newOrderCreditMemoCommentsForGuestVal'], 'stores', $storeId);
4327
  }
4328
 
4329
+ $salesEmailsAcion['successMessage'] = "Credit Memo Comment Email Template for Guest updated On ".$storeName." Store.";
4330
  Mage::getConfig()->reinit();
4331
  Mage::app()->reinitStores();
4332
  }
4333
 
 
 
 
4334
  $forGuestCreditMemoCommentsEmailTemplateSelectedValue = Mage::getStoreConfig('sales_email/creditmemo_comment/guest_template', $storeId);
4335
 
4336
  $newOrderCreditMemoCommentsEmailGuestTemObj = new Mage_Adminhtml_Model_System_Config_Source_Email_Template();
4345
  {
4346
  if($value['value'] == $forGuestCreditMemoCommentsEmailTemplateSelectedValue)
4347
  {
4348
+ $forGuestOrderEmailTemArr['label'] = "Credit Memo Update for Guest (".$value['label'].")";
4349
  $forGuestOrderEmailTemArr['value'] = $value['value'];
4350
  $forGuestOrderEmailTemArr['status'] = 1;
4351
  $salesEmailsAcion['newOrderCreditMemoCommentsForGuestColl'][] = $forGuestOrderEmailTemArr;
4352
  }
4353
  else
4354
  {
4355
+ $forGuestOrderEmailTemArr['label'] = "Credit Memo Update for Guest (".$value['label'].")";
4356
  $forGuestOrderEmailTemArr['value'] = $value['value'];
4357
  $forGuestOrderEmailTemArr['status'] = 0;
4358
  $salesEmailsAcion['newOrderCreditMemoCommentsForGuestColl'][] = $forGuestOrderEmailTemArr;
4359
  }
4360
  }
4361
  //echo $post_data['emailTemplateVal']."***";
4362
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4363
 
4364
 
4365
 
4366
  //Send Credit Memo Comment Email Copy To
 
4367
  if(isset($post_data['emailCreditMemoCommentsCopyToVal']))
4368
  {
4369
  if($storeId == 0)
4380
  Mage::app()->reinitStores();
4381
  }
4382
 
4383
+ $salesEmailsAcion['emailCreditMemoCommentsCopyToSelectedValue'] = Mage::getStoreConfig('sales_email/creditmemo_comment/copy_to', $storeId);
4384
+
4385
+
4386
 
4387
  //Send Credit Memo Comments Email Copy Method
 
4388
  if(isset($post_data['orderCreditMemoCommentsEmailCopyVal']))
4389
  {
4390
  if($storeId == 0)
4401
  Mage::app()->reinitStores();
4402
  }
4403
 
4404
+ $salesEmailsAcion['orderCreditMemoCommentsEmailCopySelectedValue'] = Mage::getStoreConfig('sales_email/creditmemo_comment/copy_method', $storeId);
4405
+
4406
+
4407
  // echo "<pre>"; print_r($salesEmailsAcion); die;
4408
  $jsonData = Mage::helper('core')->jsonEncode($salesEmailsAcion);
4409
  return Mage::app()->getResponse()->setBody($jsonData);
4454
  if(Mage::helper('mobileadmin')->isEnable()) // check extension if enabled or not
4455
  {
4456
  $post_data = Mage::app()->getRequest()->getParams();
4457
+ $sessionId = $post_data['session'];
4458
+ if (!Mage::getSingleton('api/session')->isLoggedIn($sessionId)) // check session if not, will return false
4459
+ {
4460
+ echo $this->__("The Login has expired. Please try log in again.");
4461
+ return false;
4462
+ }
4463
 
4464
  try
4465
  {
4469
  //Tax Classes
4470
 
4471
  //Tax Class for Shipping
4472
+
4473
+ if(isset($post_data['taxClassForShippingVal']))
4474
+ {
4475
+ Mage::getConfig()->saveConfig('tax/classes/shipping_tax_class', $post_data['taxClassForShippingVal'], 'default', 0);
4476
+
4477
+ $saleTaxAcion['successMessage'] = "Tax Class for Shipping Saved On ".$storeName." Store.";
4478
+ Mage::getConfig()->reinit();
4479
+ Mage::app()->reinitStores();
4480
+ }
4481
+
4482
  $taxArr = Mage::getModel('tax/class_source_product')->toOptionArray();
4483
+
4484
  $taxClassForShippingSelectedValue = Mage::getStoreConfig('tax/classes/shipping_tax_class');
4485
+
4486
  foreach ($taxArr as $value)
4487
  {
4488
  if($value['value'] == $taxClassForShippingSelectedValue)
4499
  $taxNewArr['status'] = 0;
4500
  $saleTaxAcion['taxClassForShippingList'][] = $taxNewArr;
4501
  }
4502
+ }
 
 
 
 
4503
 
 
 
 
 
 
4504
 
4505
 
4506
  //Calculation Settings
4507
 
4508
  //Tax Calculation Method Based On
4509
+ if(isset($post_data['taxCalculationMethodVal']))
4510
+ {
4511
+ Mage::getConfig()->saveConfig('tax/calculation/algorithm', $post_data['taxCalculationMethodVal'], 'default', 0);
4512
+
4513
+ $saleTaxAcion['successMessage'] = "Tax Calculation Method Based On Saved On ".$storeName." Store.";
4514
+ Mage::getConfig()->reinit();
4515
+ Mage::app()->reinitStores();
4516
+ }
4517
+
4518
  $taxCalculationMethodSelectedValue = Mage::getStoreConfig('tax/calculation/algorithm');
4519
+ $taxCalculationMethod = new Mage_Tax_Model_System_Config_Source_Algorithm(); //echo "<pre>"; print_r($taxCalculationMethod->toOptionArray()); die;
4520
  foreach ($taxCalculationMethod->toOptionArray() as $value)
4521
  {
4522
+ if($value['value'] == $taxCalculationMethodSelectedValue)
4523
+ {
4524
+ $taxCalculationBasedOnArr['value'] = $value['value'];
4525
+ $taxCalculationBasedOnArr['label'] = $value['label'];
4526
+ $taxCalculationBasedOnArr['status'] = 1;
4527
+ $saleTaxAcion['taxCalculationMethodList'][] = $taxCalculationBasedOnArr;
4528
+ }
4529
+ else
4530
+ {
4531
+ $taxCalculationBasedOnArr['value'] = $value['value'];
4532
+ $taxCalculationBasedOnArr['label'] = $value['label'];
4533
+ $taxCalculationBasedOnArr['status'] = 0;
4534
+ $saleTaxAcion['taxCalculationMethodList'][] = $taxCalculationBasedOnArr;
4535
+ }
4536
+ }
4537
+
4538
+
4539
+
4540
+ //Tax Calculation Based On
4541
+ if(isset($post_data['taxCalculationBasedVal']))
4542
+ {
4543
+ Mage::getConfig()->saveConfig('tax/calculation/based_on', $post_data['taxCalculationBasedVal'], 'default', 0);
4544
+
4545
+ $saleTaxAcion['successMessage'] = "Tax Calculation Based On Saved On ".$storeName." Store.";
4546
+ Mage::getConfig()->reinit();
4547
+ Mage::app()->reinitStores();
4548
+ }
4549
+
4550
+ $taxCalculationBasedSelectedValue = Mage::getStoreConfig('tax/calculation/based_on');
4551
+ $taxCalculationBased = new Mage_Adminhtml_Model_System_Config_Source_Tax_Basedon();
4552
+ //echo "<pre>"; print_r($taxCalculationBased->toOptionArray());
4553
+ foreach ($taxCalculationBased->toOptionArray() as $value)
4554
+ {
4555
+ //echo $value['value']."*****".$taxCalculationBasedSelectedValue; die;
4556
+ if($value['value'] == $taxCalculationBasedSelectedValue)
4557
+ {
4558
+ $taxCalculationBasedArr['value'] = $value['value'];
4559
+ $taxCalculationBasedArr['label'] = $value['label'];
4560
+ $taxCalculationBasedArr['status'] = 1;
4561
+ $saleTaxAcion['taxCalculationBasedList'][] = $taxCalculationBasedArr;
4562
+ }
4563
+ else
4564
+ {
4565
+ $taxCalculationBasedArr['value'] = $value['value'];
4566
+ $taxCalculationBasedArr['label'] = $value['label'];
4567
+ $taxCalculationBasedArr['status'] = 0;
4568
+ $saleTaxAcion['taxCalculationBasedList'][] = $taxCalculationBasedArr;
4569
+ }
4570
+ }
4571
+
4572
+
4573
+
4574
+ //Catalog Prices
4575
+ if(isset($post_data['catalogPricesVal']))
4576
+ {
4577
+ Mage::getConfig()->saveConfig('tax/calculation/price_includes_tax', $post_data['catalogPricesVal'], 'default', 0);
4578
+
4579
+ $saleTaxAcion['successMessage'] = "Catalog Prices Saved On ".$storeName." Store.";
4580
+
4581
+ Mage::getConfig()->reinit();
4582
+ Mage::app()->reinitStores();
4583
+ }
4584
+ $saleTaxAcion['catalogPricesSelectedValue'] = Mage::getStoreConfig('tax/calculation/price_includes_tax');
4585
+
4586
+
4587
+
4588
+ //Shipping Prices
4589
+ if(isset($post_data['shippingPricesVal']))
4590
+ {
4591
+ Mage::getConfig()->saveConfig('tax/calculation/shipping_includes_tax', $post_data['shippingPricesVal'], 'default', 0);
4592
+
4593
+ $saleTaxAcion['successMessage'] = "Shipping Prices Saved On ".$storeName." Store.";
4594
+
4595
+ Mage::getConfig()->reinit();
4596
+ Mage::app()->reinitStores();
4597
+ }
4598
+ $saleTaxAcion['shippingPricesSelectedValue'] = Mage::getStoreConfig('tax/calculation/shipping_includes_tax');
4599
+
4600
+
4601
+
4602
+ //Apply Customer Tax
4603
+ if(isset($post_data['appluCustomerTaxVal']))
4604
+ {
4605
+ Mage::getConfig()->saveConfig('tax/calculation/apply_after_discount', $post_data['appluCustomerTaxVal'], 'default', 0);
4606
+
4607
+ $saleTaxAcion['successMessage'] = "Apply Customer Tax Value Saved On ".$storeName." Store.";
4608
+
4609
+ Mage::getConfig()->reinit();
4610
+ Mage::app()->reinitStores();
4611
+ }
4612
+ $saleTaxAcion['appluCustomerTaxSelectedValue'] = Mage::getStoreConfig('tax/calculation/apply_after_discount');
4613
+
4614
+
4615
+
4616
+ //Apply Discount On Prices
4617
+ if(isset($post_data['applyDisOnPriceVal']))
4618
+ {
4619
+ Mage::getConfig()->saveConfig('tax/calculation/discount_tax', $post_data['applyDisOnPriceVal'], 'default', 0);
4620
+
4621
+ $saleTaxAcion['successMessage'] = "Apply Discount On Prices Value Saved On ".$storeName." Store.";
4622
+
4623
+ Mage::getConfig()->reinit();
4624
+ Mage::app()->reinitStores();
4625
+ }
4626
+ $saleTaxAcion['applyDisOnPriceSelectedValue'] = Mage::getStoreConfig('tax/calculation/discount_tax');
4627
+
4628
+
4629
+
4630
+ //Apply Tax On
4631
+ if(isset($post_data['applyTaxOnVal']))
4632
+ {
4633
+ Mage::getConfig()->saveConfig('tax/calculation/apply_tax_on', $post_data['applyTaxOnVal'], 'default', 0);
4634
+
4635
+ $saleTaxAcion['successMessage'] = "Apply Tax On Value Saved On ".$storeName." Store.";
4636
+
4637
+ Mage::getConfig()->reinit();
4638
+ Mage::app()->reinitStores();
4639
+ }
4640
+ $saleTaxAcion['applyTaxOnSelectedValue'] = Mage::getStoreConfig('tax/calculation/apply_tax_on');
4641
+
4642
+
4643
+
4644
+ //Enable Cross Border Trade
4645
+ if(isset($post_data['crossBorderTradeVal']))
4646
+ {
4647
+ Mage::getConfig()->saveConfig('tax/calculation/cross_border_trade_enabled', $post_data['crossBorderTradeVal'], 'default', 0);
4648
+
4649
+ $saleTaxAcion['successMessage'] = "Enable Cross Border Trade Value Saved On ".$storeName." Store.";
4650
+
4651
+ Mage::getConfig()->reinit();
4652
+ Mage::app()->reinitStores();
4653
+ }
4654
+ $saleTaxAcion['crossBorderTradeSelectedValue'] = Mage::getStoreConfig('tax/calculation/cross_border_trade_enabled');
4655
+
4656
+
4657
+
4658
+
4659
+ //Default Tax Destination Calculation
4660
+
4661
+ //Default Country
4662
+ if(isset($post_data['taxDefaultCountryVal']))
4663
+ {
4664
+ if($storeId == 0)
4665
+ {
4666
+ Mage::getConfig()->saveConfig('tax/defaults/country', $post_data['taxDefaultCountryVal'], 'default', $storeId);
4667
+ }
4668
+ else
4669
+ {
4670
+ Mage::getConfig()->saveConfig('tax/defaults/country', $post_data['taxDefaultCountryVal'], 'stores', $storeId);
4671
+ }
4672
+
4673
+ $saleTaxAcion['successMessage'] = "Default Country For Tax Value Saved On ".$storeName." Store.";
4674
+
4675
+ Mage::getConfig()->reinit();
4676
+ Mage::app()->reinitStores();
4677
+ }
4678
+
4679
+ $defauCountrySelectedValue = Mage::getStoreConfig('tax/defaults/country', $storeId);
4680
+
4681
+ $defaultCountriesList = Mage::getModel('directory/country')->getResourceCollection()->load()->toOptionArray(false);
4682
+
4683
+ foreach($defaultCountriesList as $value)
4684
+ {
4685
+ if($value['value'] == $defauCountrySelectedValue)
4686
+ {
4687
+ $defaultCurArr['value'] = $value['value'];
4688
+ $defaultCurArr['label'] = $value['label'];
4689
+ $defaultCurArr['status'] = 1;
4690
+ $saleTaxAcion['TaxDefaultCountryList'][] = $defaultCurArr;
4691
+ }
4692
+ else
4693
+ {
4694
+ $defaultCurArr['value'] = $value['value'];
4695
+ $defaultCurArr['label'] = $value['label'];
4696
+ $defaultCurArr['status'] = 0;
4697
+ $saleTaxAcion['TaxDefaultCountryList'][] = $defaultCurArr;
4698
+ }
4699
+ }
4700
+
4701
+
4702
+
4703
+ //Default Post Code
4704
+ if(isset($post_data['taxDefaultPostCodeVal']))
4705
+ {
4706
+ if($storeId == 0)
4707
+ {
4708
+ Mage::getConfig()->saveConfig('tax/defaults/postcode', $post_data['taxDefaultPostCodeVal'], 'default', $storeId);
4709
+ }
4710
+ else
4711
+ {
4712
+ Mage::getConfig()->saveConfig('tax/defaults/postcode', $post_data['taxDefaultPostCodeVal'], 'stores', $storeId);
4713
+ }
4714
+
4715
+ $saleTaxAcion['successMessage'] = "Default Country For Tax Value Saved On ".$storeName." Store.";
4716
+
4717
+ Mage::getConfig()->reinit();
4718
+ Mage::app()->reinitStores();
4719
+ }
4720
+
4721
+ $saleTaxAcion['taxDefaultPostCodeSelectedValue'] = Mage::getStoreConfig('tax/defaults/postcode', $storeId);
4722
+
4723
+
4724
+
4725
+
4726
+ //Price Display Settings
4727
+
4728
+ //Display Product Prices In Catalog
4729
+ if(isset($post_data['displayProductPricesVal']))
4730
+ {
4731
+ if($storeId == 0)
4732
+ {
4733
+ Mage::getConfig()->saveConfig('tax/display/type', $post_data['displayProductPricesVal'], 'default', $storeId);
4734
+ }
4735
+ else
4736
+ {
4737
+ Mage::getConfig()->saveConfig('tax/display/type', $post_data['displayProductPricesVal'], 'stores', $storeId);
4738
+ }
4739
+
4740
+ $saleTaxAcion['successMessage'] = "Display Product Prices In Catalog Value Saved On ".$storeName." Store.";
4741
+
4742
+ Mage::getConfig()->reinit();
4743
+ Mage::app()->reinitStores();
4744
+ }
4745
+
4746
+ $displayProductPricesSelectedValue = Mage::getStoreConfig('tax/display/type', $storeId);
4747
+
4748
+ $displayProductPricesArr = new Mage_Tax_Model_System_Config_Source_Tax_Display_Type();
4749
+ foreach ($displayProductPricesArr->toOptionArray() as $value)
4750
+ {
4751
+ if($value['value'] == $displayProductPricesSelectedValue)
4752
+ {
4753
+ $displayProductArr['value'] = $value['value'];
4754
+ $displayProductArr['label'] = $value['label'];
4755
+ $displayProductArr['status'] = 1;
4756
+ $saleTaxAcion['displayProductPricesInCatalogList'][] = $displayProductArr;
4757
+ }
4758
+ else
4759
+ {
4760
+ $displayProductArr['value'] = $value['value'];
4761
+ $displayProductArr['label'] = $value['label'];
4762
+ $displayProductArr['status'] = 0;
4763
+ $saleTaxAcion['displayProductPricesInCatalogList'][] = $displayProductArr;
4764
+ }
4765
+ }
4766
+
4767
+
4768
+ //Display Shipping Prices
4769
+ if(isset($post_data['displayShippingPricesVal']))
4770
+ {
4771
+ if($storeId == 0)
4772
+ {
4773
+ Mage::getConfig()->saveConfig('tax/display/shipping', $post_data['displayShippingPricesVal'], 'default', $storeId);
4774
+ }
4775
+ else
4776
+ {
4777
+ Mage::getConfig()->saveConfig('tax/display/shipping', $post_data['displayShippingPricesVal'], 'stores', $storeId);
4778
+ }
4779
+
4780
+ $saleTaxAcion['successMessage'] = "Display Shipping Prices Value Saved On ".$storeName." Store.";
4781
+
4782
+ Mage::getConfig()->reinit();
4783
+ Mage::app()->reinitStores();
4784
+ }
4785
+
4786
+ $displayShippingPricesSelectedValue = Mage::getStoreConfig('tax/display/shipping', $storeId);
4787
+
4788
+ //$displayProductPricesArr = new Mage_Tax_Model_System_Config_Source_Tax_Display_Type();
4789
+ foreach ($displayProductPricesArr->toOptionArray() as $value)
4790
+ {
4791
+ if($value['value'] == $displayShippingPricesSelectedValue)
4792
+ {
4793
+ $displayProductArr['value'] = $value['value'];
4794
+ $displayProductArr['label'] = $value['label'];
4795
+ $displayProductArr['status'] = 1;
4796
+ $saleTaxAcion['displayShippingPricesList'][] = $displayProductArr;
4797
+ }
4798
+ else
4799
+ {
4800
+ $displayProductArr['value'] = $value['value'];
4801
+ $displayProductArr['label'] = $value['label'];
4802
+ $displayProductArr['status'] = 0;
4803
+ $saleTaxAcion['displayShippingPricesList'][] = $displayProductArr;
4804
+ }
4805
+ }
4806
+
4807
+
4808
+
4809
+ //Shopping Cart Display Settings
4810
+
4811
+ //Display Prices
4812
+ if(isset($post_data['displayPricesVal']))
4813
+ {
4814
+ if($storeId == 0)
4815
+ {
4816
+ Mage::getConfig()->saveConfig('tax/cart_display/price', $post_data['displayPricesVal'], 'default', $storeId);
4817
+ }
4818
+ else
4819
+ {
4820
+ Mage::getConfig()->saveConfig('tax/cart_display/price', $post_data['displayPricesVal'], 'stores', $storeId);
4821
+ }
4822
+
4823
+ $saleTaxAcion['successMessage'] = "Display Prices Value Saved On ".$storeName." Store.";
4824
+
4825
+ Mage::getConfig()->reinit();
4826
+ Mage::app()->reinitStores();
4827
+ }
4828
+
4829
+ $displayPricesSelectedValue = Mage::getStoreConfig('tax/cart_display/price', $storeId);
4830
+
4831
+ //$displayProductPricesArr = new Mage_Tax_Model_System_Config_Source_Tax_Display_Type();
4832
+ foreach ($displayProductPricesArr->toOptionArray() as $value)
4833
+ {
4834
+ if($value['value'] == $displayPricesSelectedValue)
4835
+ {
4836
+ $displayProductArr['value'] = $value['value'];
4837
+ $displayProductArr['label'] = $value['label'];
4838
+ $displayProductArr['status'] = 1;
4839
+ $saleTaxAcion['displayPricesList'][] = $displayProductArr;
4840
+ }
4841
+ else
4842
+ {
4843
+ $displayProductArr['value'] = $value['value'];
4844
+ $displayProductArr['label'] = $value['label'];
4845
+ $displayProductArr['status'] = 0;
4846
+ $saleTaxAcion['displayPricesList'][] = $displayProductArr;
4847
+ }
4848
+ }
4849
+
4850
+
4851
+ //Display Subtotal
4852
+ if(isset($post_data['displaySubtotalVal']))
4853
+ {
4854
+ if($storeId == 0)
4855
+ {
4856
+ Mage::getConfig()->saveConfig('tax/cart_display/subtotal', $post_data['displaySubtotalVal'], 'default', $storeId);
4857
+ }
4858
+ else
4859
+ {
4860
+ Mage::getConfig()->saveConfig('tax/cart_display/subtotal', $post_data['displaySubtotalVal'], 'stores', $storeId);
4861
+ }
4862
+
4863
+ $saleTaxAcion['successMessage'] = "Display Subtotal Value Saved On ".$storeName." Store.";
4864
+
4865
+ Mage::getConfig()->reinit();
4866
+ Mage::app()->reinitStores();
4867
+ }
4868
+
4869
+ $displaySubtotalSelectedValue = Mage::getStoreConfig('tax/cart_display/subtotal', $storeId);
4870
+
4871
+ //$displayProductPricesArr = new Mage_Tax_Model_System_Config_Source_Tax_Display_Type();
4872
+ foreach ($displayProductPricesArr->toOptionArray() as $value)
4873
+ {
4874
+ if($value['value'] == $displaySubtotalSelectedValue)
4875
+ {
4876
+ $displayProductArr['value'] = $value['value'];
4877
+ $displayProductArr['label'] = $value['label'];
4878
+ $displayProductArr['status'] = 1;
4879
+ $saleTaxAcion['displaySubtotalList'][] = $displayProductArr;
4880
+ }
4881
+ else
4882
+ {
4883
+ $displayProductArr['value'] = $value['value'];
4884
+ $displayProductArr['label'] = $value['label'];
4885
+ $displayProductArr['status'] = 0;
4886
+ $saleTaxAcion['displaySubtotalList'][] = $displayProductArr;
4887
+ }
4888
+ }
4889
+
4890
+
4891
+ //Display Shipping Amount
4892
+ if(isset($post_data['displayShippingAmountVal']))
4893
+ {
4894
+ if($storeId == 0)
4895
+ {
4896
+ Mage::getConfig()->saveConfig('tax/cart_display/shipping', $post_data['displayShippingAmountVal'], 'default', $storeId);
4897
+ }
4898
+ else
4899
+ {
4900
+ Mage::getConfig()->saveConfig('tax/cart_display/shipping', $post_data['displayShippingAmountVal'], 'stores', $storeId);
4901
+ }
4902
+
4903
+ $saleTaxAcion['successMessage'] = "Display Shipping Amount Value Saved On ".$storeName." Store.";
4904
+
4905
+ Mage::getConfig()->reinit();
4906
+ Mage::app()->reinitStores();
4907
+ }
4908
+
4909
+ $displayShippingAmountSelectedValue = Mage::getStoreConfig('tax/cart_display/shipping', $storeId);
4910
+
4911
+ //$displayProductPricesArr = new Mage_Tax_Model_System_Config_Source_Tax_Display_Type();
4912
+ foreach ($displayProductPricesArr->toOptionArray() as $value)
4913
+ {
4914
+ if($value['value'] == $displayShippingAmountSelectedValue)
4915
+ {
4916
+ $displayProductArr['value'] = $value['value'];
4917
+ $displayProductArr['label'] = $value['label'];
4918
+ $displayProductArr['status'] = 1;
4919
+ $saleTaxAcion['displayShippingAmountList'][] = $displayProductArr;
4920
+ }
4921
+ else
4922
+ {
4923
+ $displayProductArr['value'] = $value['value'];
4924
+ $displayProductArr['label'] = $value['label'];
4925
+ $displayProductArr['status'] = 0;
4926
+ $saleTaxAcion['displayShippingAmountList'][] = $displayProductArr;
4927
+ }
4928
+ }
4929
+
4930
+
4931
+
4932
+ //Include Tax In Grand Total
4933
+ if(isset($post_data['includeTaxInVal']))
4934
+ {
4935
+ if($storeId == 0)
4936
+ {
4937
+ Mage::getConfig()->saveConfig('tax/cart_display/grandtotal', $post_data['includeTaxInVal'], 'default', $storeId);
4938
+ }
4939
+ else
4940
+ {
4941
+ Mage::getConfig()->saveConfig('tax/cart_display/grandtotal', $post_data['includeTaxInVal'], 'stores', $storeId);
4942
+ }
4943
+
4944
+ $saleTaxAcion['successMessage'] = "Include Tax In Grand Total Value Saved On ".$storeName." Store.";
4945
+
4946
+ Mage::getConfig()->reinit();
4947
+ Mage::app()->reinitStores();
4948
+ }
4949
+
4950
+ $saleTaxAcion['includeTaxInGrandTotalSelectedValue'] = Mage::getStoreConfig('tax/cart_display/grandtotal', $storeId);
4951
+
4952
+
4953
+ //Display Full Tax Summary
4954
+ if(isset($post_data['displayFullTaxVal']))
4955
+ {
4956
+ if($storeId == 0)
4957
+ {
4958
+ Mage::getConfig()->saveConfig('tax/cart_display/full_summary', $post_data['displayFullTaxVal'], 'default', $storeId);
4959
+ }
4960
+ else
4961
+ {
4962
+ Mage::getConfig()->saveConfig('tax/cart_display/full_summary', $post_data['displayFullTaxVal'], 'stores', $storeId);
4963
+ }
4964
+
4965
+ $saleTaxAcion['successMessage'] = "Display Full Tax Summary Value Saved On ".$storeName." Store.";
4966
+
4967
+ Mage::getConfig()->reinit();
4968
+ Mage::app()->reinitStores();
4969
+ }
4970
+
4971
+ $saleTaxAcion['displayFullTaxSummarySelectedValue'] = Mage::getStoreConfig('tax/cart_display/full_summary', $storeId);
4972
+
4973
+
4974
+ //Display Zero Tax Subtotal
4975
+ if(isset($post_data['displayZeroTaxVal']))
4976
+ {
4977
+ if($storeId == 0)
4978
+ {
4979
+ Mage::getConfig()->saveConfig('tax/cart_display/zero_tax', $post_data['displayZeroTaxVal'], 'default', $storeId);
4980
+ }
4981
+ else
4982
+ {
4983
+ Mage::getConfig()->saveConfig('tax/cart_display/zero_tax', $post_data['displayZeroTaxVal'], 'stores', $storeId);
4984
+ }
4985
+
4986
+ $saleTaxAcion['successMessage'] = "Display Zero Tax Subtotal Value Saved On ".$storeName." Store.";
4987
+
4988
+ Mage::getConfig()->reinit();
4989
+ Mage::app()->reinitStores();
4990
+ }
4991
+
4992
+ $saleTaxAcion['displayZeroTaxSelectedValue'] = Mage::getStoreConfig('tax/cart_display/zero_tax', $storeId);
4993
+
4994
+
4995
+
4996
+ //Orders, Invoices, Credit Memos Display Settings
4997
+
4998
+ //Display Prices
4999
+ if(isset($post_data['displayPricesAllVal']))
5000
+ {
5001
+ if($storeId == 0)
5002
+ {
5003
+ Mage::getConfig()->saveConfig('tax/sales_display/price', $post_data['displayPricesAllVal'], 'default', $storeId);
5004
+ }
5005
+ else
5006
+ {
5007
+ Mage::getConfig()->saveConfig('tax/sales_display/price', $post_data['displayPricesAllVal'], 'stores', $storeId);
5008
+ }
5009
+
5010
+ $saleTaxAcion['successMessage'] = "Display Prices Value Saved On ".$storeName." Store.";
5011
+
5012
+ Mage::getConfig()->reinit();
5013
+ Mage::app()->reinitStores();
5014
+ }
5015
+
5016
+ $displayPricesAllSelectedValue = Mage::getStoreConfig('tax/sales_display/price', $storeId);
5017
+
5018
+ //$displayProductPricesArr = new Mage_Tax_Model_System_Config_Source_Tax_Display_Type();
5019
+ foreach ($displayProductPricesArr->toOptionArray() as $value)
5020
+ {
5021
+ if($value['value'] == $displayPricesAllSelectedValue)
5022
  {
5023
+ $displayProductArr['value'] = $value['value'];
5024
+ $displayProductArr['label'] = $value['label'];
5025
+ $displayProductArr['status'] = 1;
5026
+ $saleTaxAcion['displayPricesAllList'][] = $displayProductArr;
5027
  }
5028
  else
5029
  {
5030
+ $displayProductArr['value'] = $value['value'];
5031
+ $displayProductArr['label'] = $value['label'];
5032
+ $displayProductArr['status'] = 0;
5033
+ $saleTaxAcion['displayPricesAllList'][] = $displayProductArr;
5034
  }
5035
  }
5036
 
5037
+
5038
+ //Display Subtotal
5039
+ if(isset($post_data['displaySubtotalAllVal']))
5040
  {
5041
+ if($storeId == 0)
5042
+ {
5043
+ Mage::getConfig()->saveConfig('tax/sales_display/subtotal', $post_data['displaySubtotalAllVal'], 'default', $storeId);
5044
+ }
5045
+ else
5046
+ {
5047
+ Mage::getConfig()->saveConfig('tax/sales_display/subtotal', $post_data['displaySubtotalAllVal'], 'stores', $storeId);
5048
+ }
5049
+
5050
+ $saleTaxAcion['successMessage'] = "Display Subtotal Value Saved On ".$storeName." Store.";
5051
+
5052
+ Mage::getConfig()->reinit();
5053
+ Mage::app()->reinitStores();
5054
+ }
5055
+
5056
+ $displaySubtotalAllSelectedValue = Mage::getStoreConfig('tax/sales_display/subtotal', $storeId);
5057
+
5058
+ //$displayProductPricesArr = new Mage_Tax_Model_System_Config_Source_Tax_Display_Type();
5059
+ foreach ($displayProductPricesArr->toOptionArray() as $value)
5060
+ {
5061
+ if($value['value'] == $displaySubtotalAllSelectedValue)
5062
+ {
5063
+ $displayProductArr['value'] = $value['value'];
5064
+ $displayProductArr['label'] = $value['label'];
5065
+ $displayProductArr['status'] = 1;
5066
+ $saleTaxAcion['displaySubtotalAllList'][] = $displayProductArr;
5067
+ }
5068
+ else
5069
+ {
5070
+ $displayProductArr['value'] = $value['value'];
5071
+ $displayProductArr['label'] = $value['label'];
5072
+ $displayProductArr['status'] = 0;
5073
+ $saleTaxAcion['displaySubtotalAllList'][] = $displayProductArr;
5074
+ }
5075
+ }
5076
+
5077
+
5078
+ //Display Shipping Amount
5079
+ if(isset($post_data['displayShippingAmountAllVal']))
5080
+ {
5081
+ if($storeId == 0)
5082
+ {
5083
+ Mage::getConfig()->saveConfig('tax/sales_display/shipping', $post_data['displayShippingAmountAllVal'], 'default', $storeId);
5084
+ }
5085
+ else
5086
+ {
5087
+ Mage::getConfig()->saveConfig('tax/sales_display/shipping', $post_data['displayShippingAmountAllVal'], 'stores', $storeId);
5088
+ }
5089
+
5090
+ $saleTaxAcion['successMessage'] = "Display Shipping Amount Value Saved On ".$storeName." Store.";
5091
+
5092
+ Mage::getConfig()->reinit();
5093
+ Mage::app()->reinitStores();
5094
+ }
5095
+
5096
+ $displayShippingAmountAllSelectedValue = Mage::getStoreConfig('tax/sales_display/shipping', $storeId);
5097
+
5098
+ //$displayProductPricesArr = new Mage_Tax_Model_System_Config_Source_Tax_Display_Type();
5099
+ foreach ($displayProductPricesArr->toOptionArray() as $value)
5100
+ {
5101
+ if($value['value'] == $displayShippingAmountAllSelectedValue)
5102
+ {
5103
+ $displayProductArr['value'] = $value['value'];
5104
+ $displayProductArr['label'] = $value['label'];
5105
+ $displayProductArr['status'] = 1;
5106
+ $saleTaxAcion['displayShippingAmountAllList'][] = $displayProductArr;
5107
+ }
5108
+ else
5109
+ {
5110
+ $displayProductArr['value'] = $value['value'];
5111
+ $displayProductArr['label'] = $value['label'];
5112
+ $displayProductArr['status'] = 0;
5113
+ $saleTaxAcion['displayShippingAmountAllList'][] = $displayProductArr;
5114
+ }
5115
+ }
5116
+
5117
+
5118
+
5119
+ //Include Tax In Grand Total
5120
+ if(isset($post_data['includeTaxInAllVal']))
5121
+ {
5122
+ if($storeId == 0)
5123
+ {
5124
+ Mage::getConfig()->saveConfig('tax/sales_display/grandtotal', $post_data['includeTaxInAllVal'], 'default', $storeId);
5125
+ }
5126
+ else
5127
+ {
5128
+ Mage::getConfig()->saveConfig('tax/sales_display/grandtotal', $post_data['includeTaxInAllVal'], 'stores', $storeId);
5129
+ }
5130
+
5131
+ $saleTaxAcion['successMessage'] = "Include Tax In Grand Total Value Saved On ".$storeName." Store.";
5132
+
5133
+ Mage::getConfig()->reinit();
5134
+ Mage::app()->reinitStores();
5135
+ }
5136
+
5137
+ $saleTaxAcion['includeTaxInGrandTotalAllSelectedValue'] = Mage::getStoreConfig('tax/sales_display/grandtotal', $storeId);
5138
+
5139
+
5140
+ //Display Full Tax Summary
5141
+ if(isset($post_data['displayFullTaxAllVal']))
5142
+ {
5143
+ if($storeId == 0)
5144
+ {
5145
+ Mage::getConfig()->saveConfig('tax/sales_display/full_summary', $post_data['displayFullTaxAllVal'], 'default', $storeId);
5146
+ }
5147
+ else
5148
+ {
5149
+ Mage::getConfig()->saveConfig('tax/sales_display/full_summary', $post_data['displayFullTaxAllVal'], 'stores', $storeId);
5150
+ }
5151
+
5152
+ $saleTaxAcion['successMessage'] = "Display Full Tax Summary Value Saved On ".$storeName." Store.";
5153
+
5154
+ Mage::getConfig()->reinit();
5155
+ Mage::app()->reinitStores();
5156
+ }
5157
+
5158
+ $saleTaxAcion['displayFullTaxSummaryAllSelectedValue'] = Mage::getStoreConfig('tax/sales_display/full_summary', $storeId);
5159
+
5160
+
5161
+ //Display Zero Tax Subtotal
5162
+ if(isset($post_data['displayZeroTaxAllVal']))
5163
+ {
5164
+ if($storeId == 0)
5165
+ {
5166
+ Mage::getConfig()->saveConfig('tax/sales_display/zero_tax', $post_data['displayZeroTaxAllVal'], 'default', $storeId);
5167
+ }
5168
+ else
5169
+ {
5170
+ Mage::getConfig()->saveConfig('tax/sales_display/zero_tax', $post_data['displayZeroTaxAllVal'], 'stores', $storeId);
5171
+ }
5172
+
5173
+ $saleTaxAcion['successMessage'] = "Display Zero Tax Subtotal Value Saved On ".$storeName." Store.";
5174
+
5175
+ Mage::getConfig()->reinit();
5176
+ Mage::app()->reinitStores();
5177
+ }
5178
+
5179
+ $saleTaxAcion['displayZeroTaxAllSelectedValue'] = Mage::getStoreConfig('tax/sales_display/zero_tax', $storeId);
5180
+
5181
+
5182
+
5183
+
5184
+ //Fixed Product Taxes
5185
+
5186
+ $fptModelList = new Mage_Weee_Model_Config_Source_Display();
5187
+
5188
+ //Enable FPT
5189
+ if(isset($post_data['enableFptVal']))
5190
+ {
5191
+ Mage::getConfig()->saveConfig('tax/weee/enable', $post_data['enableFptVal'], 'default', 0);
5192
+
5193
+ $saleTaxAcion['successMessage'] = "Enable FPT Value Saved On ".$storeName." Store.";
5194
+
5195
+ Mage::getConfig()->reinit();
5196
+ Mage::app()->reinitStores();
5197
+ }
5198
+ $saleTaxAcion['enableFptSelectedValue'] = Mage::getStoreConfig('tax/weee/enable');
5199
+
5200
+
5201
+
5202
+ //Display Prices In Product Lists
5203
+ if(isset($post_data['displayPriceInProductVal']))
5204
+ {
5205
+ Mage::getConfig()->saveConfig('tax/weee/display_list', $post_data['displayPriceInProductVal'], 'default', 0);
5206
+
5207
+ $saleTaxAcion['successMessage'] = "Display Prices In Product Lists Value Saved On ".$storeName." Store.";
5208
+
5209
+ Mage::getConfig()->reinit();
5210
+ Mage::app()->reinitStores();
5211
+ }
5212
+
5213
+ $displayPriceInProductSelectedValue = Mage::getStoreConfig('tax/weee/display_list');
5214
+
5215
+ //$displayProductPricesArr = new Mage_Tax_Model_System_Config_Source_Tax_Display_Type();
5216
+ foreach ($fptModelList->toOptionArray() as $value)
5217
+ {
5218
+ if($value['value'] == $displayPriceInProductSelectedValue)
5219
+ {
5220
+ $displayProductArr['value'] = $value['value'];
5221
+ $displayProductArr['label'] = $value['label'];
5222
+ $displayProductArr['status'] = 1;
5223
+ $saleTaxAcion['displayPricesInProductList'][] = $displayProductArr;
5224
+ }
5225
+ else
5226
+ {
5227
+ $displayProductArr['value'] = $value['value'];
5228
+ $displayProductArr['label'] = $value['label'];
5229
+ $displayProductArr['status'] = 0;
5230
+ $saleTaxAcion['displayPricesInProductList'][] = $displayProductArr;
5231
+ }
5232
+ }
5233
+
5234
+
5235
+
5236
+ //Display Prices On Product View Page
5237
+ if(isset($post_data['displayPriceInProductViewVal']))
5238
+ {
5239
+ Mage::getConfig()->saveConfig('tax/weee/display', $post_data['displayPriceInProductViewVal'], 'default', 0);
5240
+
5241
+ $saleTaxAcion['successMessage'] = "Display Prices On Product View Page Value Saved On ".$storeName." Store.";
5242
+
5243
+ Mage::getConfig()->reinit();
5244
+ Mage::app()->reinitStores();
5245
+ }
5246
+
5247
+ $displayPriceInProductViewSelectedValue = Mage::getStoreConfig('tax/weee/display');
5248
+
5249
+ //$displayProductPricesArr = new Mage_Tax_Model_System_Config_Source_Tax_Display_Type();
5250
+ foreach ($fptModelList->toOptionArray() as $value)
5251
+ {
5252
+ if($value['value'] == $displayPriceInProductViewSelectedValue)
5253
+ {
5254
+ $displayProductArr['value'] = $value['value'];
5255
+ $displayProductArr['label'] = $value['label'];
5256
+ $displayProductArr['status'] = 1;
5257
+ $saleTaxAcion['displayPricesInProductViewList'][] = $displayProductArr;
5258
+ }
5259
+ else
5260
+ {
5261
+ $displayProductArr['value'] = $value['value'];
5262
+ $displayProductArr['label'] = $value['label'];
5263
+ $displayProductArr['status'] = 0;
5264
+ $saleTaxAcion['displayPricesInProductViewList'][] = $displayProductArr;
5265
+ }
5266
+ }
5267
+
5268
+
5269
+
5270
+ //Display Prices In Sales Modules
5271
+ if(isset($post_data['displayPriceInSalesViewVal']))
5272
+ {
5273
+ Mage::getConfig()->saveConfig('tax/weee/display_sales', $post_data['displayPriceInSalesViewVal'], 'default', 0);
5274
+
5275
+ $saleTaxAcion['successMessage'] = "Display Prices In Sales Modules Value Saved On ".$storeName." Store.";
5276
+
5277
+ Mage::getConfig()->reinit();
5278
+ Mage::app()->reinitStores();
5279
+ }
5280
+
5281
+ $displayPriceInProductSalesSelectedValue = Mage::getStoreConfig('tax/weee/display_sales');
5282
+
5283
+ //$displayProductPricesArr = new Mage_Tax_Model_System_Config_Source_Tax_Display_Type();
5284
+ foreach ($fptModelList->toOptionArray() as $value)
5285
+ {
5286
+ if($value['value'] == $displayPriceInProductSalesSelectedValue)
5287
+ {
5288
+ $displayProductArr['value'] = $value['value'];
5289
+ $displayProductArr['label'] = $value['label'];
5290
+ $displayProductArr['status'] = 1;
5291
+ $saleTaxAcion['displayPricesInProductSalesModuleList'][] = $displayProductArr;
5292
+ }
5293
+ else
5294
+ {
5295
+ $displayProductArr['value'] = $value['value'];
5296
+ $displayProductArr['label'] = $value['label'];
5297
+ $displayProductArr['status'] = 0;
5298
+ $saleTaxAcion['displayPricesInProductSalesModuleList'][] = $displayProductArr;
5299
+ }
5300
+ }
5301
+
5302
+
5303
+
5304
+ //Display Prices In Emails
5305
+ if(isset($post_data['displayPriceInSalesEmailVal']))
5306
+ {
5307
+ Mage::getConfig()->saveConfig('tax/weee/display_email', $post_data['displayPriceInSalesEmailVal'], 'default', 0);
5308
+
5309
+ $saleTaxAcion['successMessage'] = "Display Prices In Emails Value Saved On ".$storeName." Store.";
5310
+
5311
+ Mage::getConfig()->reinit();
5312
+ Mage::app()->reinitStores();
5313
+ }
5314
+
5315
+ $displayPriceInProductSalesEmailSelectedValue = Mage::getStoreConfig('tax/weee/display_email');
5316
+
5317
+ //$displayProductPricesArr = new Mage_Tax_Model_System_Config_Source_Tax_Display_Type();
5318
+ foreach ($fptModelList->toOptionArray() as $value)
5319
+ {
5320
+ if($value['value'] == $displayPriceInProductSalesEmailSelectedValue)
5321
+ {
5322
+ $displayProductArr['value'] = $value['value'];
5323
+ $displayProductArr['label'] = $value['label'];
5324
+ $displayProductArr['status'] = 1;
5325
+ $saleTaxAcion['displayPricesInProductSalesEmailList'][] = $displayProductArr;
5326
+ }
5327
+ else
5328
+ {
5329
+ $displayProductArr['value'] = $value['value'];
5330
+ $displayProductArr['label'] = $value['label'];
5331
+ $displayProductArr['status'] = 0;
5332
+ $saleTaxAcion['displayPricesInProductSalesEmailList'][] = $displayProductArr;
5333
+ }
5334
+ }
5335
+
5336
+
5337
+ //Apply Discounts To FPT
5338
+ if(isset($post_data['applyDisocuntVal']))
5339
+ {
5340
+ Mage::getConfig()->saveConfig('tax/weee/discount', $post_data['applyDisocuntVal'], 'default', 0);
5341
+
5342
+ $saleTaxAcion['successMessage'] = "Apply Discounts To FPT Value Saved On ".$storeName." Store.";
5343
+
5344
+ Mage::getConfig()->reinit();
5345
+ Mage::app()->reinitStores();
5346
+ }
5347
+ $saleTaxAcion['applyDiscountSelectedValue'] = Mage::getStoreConfig('tax/weee/discount');
5348
+
5349
+
5350
+
5351
+ //FPT Tax Configuration
5352
+ if(isset($post_data['taxConfigVal']))
5353
+ {
5354
+ Mage::getConfig()->saveConfig('tax/weee/apply_vat', $post_data['taxConfigVal'], 'default', 0);
5355
+
5356
+ $saleTaxAcion['successMessage'] = "FPT Tax Configuration Saved On ".$storeName." Store.";
5357
 
 
5358
  Mage::getConfig()->reinit();
5359
  Mage::app()->reinitStores();
5360
  }
5361
 
5362
+ $taxConfigurationSelectedValue = Mage::getStoreConfig('tax/weee/apply_vat');
5363
+
5364
+ $taxConfigArr = new Mage_Weee_Model_Config_Source_Fpt_Tax();
5365
+ foreach ($taxConfigArr->toOptionArray() as $value)
5366
+ {
5367
+ if($value['value'] == $taxConfigurationSelectedValue)
5368
+ {
5369
+ $displayProductArr['value'] = $value['value'];
5370
+ $displayProductArr['label'] = $value['label'];
5371
+ $displayProductArr['status'] = 1;
5372
+ $saleTaxAcion['fptTaxConfigurationList'][] = $displayProductArr;
5373
+ }
5374
+ else
5375
+ {
5376
+ $displayProductArr['value'] = $value['value'];
5377
+ $displayProductArr['label'] = $value['label'];
5378
+ $displayProductArr['status'] = 0;
5379
+ $saleTaxAcion['fptTaxConfigurationList'][] = $displayProductArr;
5380
+ }
5381
+ }
5382
+
5383
+
5384
+
5385
+ //Include FPT In Subtotal
5386
+ if(isset($post_data['includeFptSubtotalVal']))
5387
+ {
5388
+ Mage::getConfig()->saveConfig('tax/weee/include_in_subtotal', $post_data['includeFptSubtotalVal'], 'default', 0);
5389
+
5390
+ $saleTaxAcion['successMessage'] = "Include FPT In Subtotal Value Saved On ".$storeName." Store.";
5391
+
5392
+ Mage::getConfig()->reinit();
5393
+ Mage::app()->reinitStores();
5394
+ }
5395
+ $saleTaxAcion['includeFptInSubtotalSelectedValue'] = Mage::getStoreConfig('tax/weee/include_in_subtotal');
5396
 
5397
+ // echo "<pre>"; print_r($saleTaxAcion); die;
5398
  $jsonData = Mage::helper('core')->jsonEncode($saleTaxAcion);
5399
  return Mage::app()->getResponse()->setBody($jsonData);
5400
  }
5415
 
5416
  /***** End Sales TAX section ******/
5417
 
5418
+
5419
+
5420
+
5421
+
5422
+
5423
+
5424
+
5425
+ //////////////////////////////////////////////// Working Progress on this part
5426
+
5427
+ /***** Start Shipping Methods section ******/
5428
+
5429
+ public function shippingMethodsAction()
5430
+ {
5431
+ if(Mage::helper('mobileadmin')->isEnable()) // check extension if enabled or not
5432
+ {
5433
+ $post_data = Mage::app()->getRequest()->getParams();
5434
+ // $sessionId = $post_data['session'];
5435
+ // if (!Mage::getSingleton('api/session')->isLoggedIn($sessionId)) // check session if not, will return false
5436
+ // {
5437
+ // echo $this->__("The Login has expired. Please try log in again.");
5438
+ // return false;
5439
+ // }
5440
+
5441
+ try
5442
+ {
5443
+ $storeId = $post_data['store'];
5444
+ $storeName = Mage::getModel('core/store')->load($storeId)->getName();
5445
+
5446
+
5447
+
5448
+
5449
+ //echo "<pre>"; print_r($shippMethodsAcion); die;
5450
+ $jsonData = Mage::helper('core')->jsonEncode($shippMethodsAcion);
5451
+ return Mage::app()->getResponse()->setBody($jsonData);
5452
+ }
5453
+ catch(Exception $e)
5454
+ {
5455
+ $errorResult['error'] = $e->getMessage();
5456
+
5457
+ $jsonData = Mage::helper('core')->jsonEncode($errorResult);
5458
+ return Mage::app()->getResponse()->setBody($jsonData);
5459
+ }
5460
+ }
5461
+ else
5462
+ {
5463
+ $isEnable = Mage::helper('core')->jsonEncode(array('enable' => false));
5464
+ return Mage::app()->getResponse()->setBody($isEnable); // set body with json format
5465
+ }
5466
+ }
5467
+
5468
+ /***** End Shipping Methods section ******/
5469
+
5470
  }
5471
  ?>
app/code/local/EmizenTech/MobileAdmin/controllers/IndexController.php CHANGED
@@ -8,16 +8,22 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
8
  {
9
  //Mage::log('test', null, "cart_android.log");
10
  $modules = Mage::getConfig()->getNode('modules')->children();
11
- $modulesArray = (array)$modules;
12
  $check_arr = (array)$modulesArray['EmizenTech_MobileAdmin'];
13
 
14
- if(!isset($modulesArray['EmizenTech_MobileAdmin']) && $check_arr['active'])
 
 
 
 
15
  {
16
- $error = array('error' => 'Please install and activate EmizenTech_MobileAdminn extension on your store');
 
 
17
  $jsonData = Mage::helper('core')->jsonEncode($error);
18
  return Mage::app()->getResponse()->setBody($jsonData);
19
  }
20
-
21
 
22
  if(Mage::getStoreConfig('emizen_mob/emizen_general/enabled')) // check if extension is enabled on your magento store.
23
  {
@@ -101,7 +107,7 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
101
  }
102
  else
103
  {
104
- $result['error'] = $this->__('Please activate the Mobile Emizentech Extension on the Magento Store.');
105
  }
106
  $jsonData = Mage::helper('core')->jsonEncode($result);
107
  return Mage::app()->getResponse()->setBody($jsonData);
@@ -117,12 +123,12 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
117
  $url_info = parse_url($url); // parse url using this function
118
 
119
  $modules = Mage::getConfig()->getNode('modules')->children();
120
- $modulesArray = (array)$modules;
121
  $check_arr = (array)$modulesArray['EmizenTech_MobileAdmin'];
122
 
123
- if(!isset($modulesArray['EmizenTech_MobileAdmin']) && $check_arr['active'])
124
  {
125
- $error = array('error' => 'Please install and activate EmizenTech_MobileAdminn extension in your store');
126
  $jsonData = Mage::helper('core')->jsonEncode($error);
127
  return Mage::app()->getResponse()->setBody($jsonData);
128
  }
@@ -171,7 +177,7 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
171
  }
172
  else
173
  {
174
- $result['error'] = $this->__('Please activate the Mobile Emizentech Extension on the Magento Store.');
175
  }
176
  $jsonData = Mage::helper('core')->jsonEncode($result); // convert data array to json
177
  return Mage::app()->getResponse()->setBody($jsonData);
8
  {
9
  //Mage::log('test', null, "cart_android.log");
10
  $modules = Mage::getConfig()->getNode('modules')->children();
11
+ $modulesArray = (array)$modules['EmizenTech_MobileAdmin'];
12
  $check_arr = (array)$modulesArray['EmizenTech_MobileAdmin'];
13
 
14
+ // Mage::log($modulesArray['active'], null, "cart_android.log");
15
+ // Mage::log("HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHello", null, "cart_android.log");
16
+ // Mage::log($check_arr['active'], null, "cart_android.log");
17
+
18
+ if(!isset($modulesArray['EmizenTech_MobileAdmin']['active']) && $check_arr['active'])
19
  {
20
+
21
+ $error = array('error' => 'Please Enable EmizenTech_MobileAdminn. Go to System > Emizen Mobile Admin');
22
+ //Mage::log($error, null, "cart_android.log");
23
  $jsonData = Mage::helper('core')->jsonEncode($error);
24
  return Mage::app()->getResponse()->setBody($jsonData);
25
  }
26
+ //Mage::log('fffff', null, "cart_android.log");
27
 
28
  if(Mage::getStoreConfig('emizen_mob/emizen_general/enabled')) // check if extension is enabled on your magento store.
29
  {
107
  }
108
  else
109
  {
110
+ $result['error'] = $this->__('Please Enable EmizenTech_MobileAdminn. Go to System > Emizen Mobile Admin');
111
  }
112
  $jsonData = Mage::helper('core')->jsonEncode($result);
113
  return Mage::app()->getResponse()->setBody($jsonData);
123
  $url_info = parse_url($url); // parse url using this function
124
 
125
  $modules = Mage::getConfig()->getNode('modules')->children();
126
+ $modulesArray = (array)$modules['EmizenTech_MobileAdmin'];
127
  $check_arr = (array)$modulesArray['EmizenTech_MobileAdmin'];
128
 
129
+ if(!isset($modulesArray['EmizenTech_MobileAdmin']['active']) && $check_arr['active'])
130
  {
131
+ $error = array('error' => 'Please Enable EmizenTech_MobileAdminn. Go to System > Emizen Mobile Admin');
132
  $jsonData = Mage::helper('core')->jsonEncode($error);
133
  return Mage::app()->getResponse()->setBody($jsonData);
134
  }
177
  }
178
  else
179
  {
180
+ $result['error'] = $this->__('Please Enable EmizenTech_MobileAdminn. Go to System > Emizen Mobile Admin.');
181
  }
182
  $jsonData = Mage::helper('core')->jsonEncode($result); // convert data array to json
183
  return Mage::app()->getResponse()->setBody($jsonData);
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>emizenmobileadmin</name>
4
- <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -28,9 +28,9 @@ Features :&#xD;
28
  * Store view Selection For Dashboard,&#xD;
29
  * Multistore Support</notes>
30
  <authors><author><name>Emizen Tech Private Limited</name><user>emizen</user><email>info@emizentech.com</email></author></authors>
31
- <date>2015-04-08</date>
32
- <time>07:11:12</time>
33
- <contents><target name="mageetc"><dir name="modules"><file name="EmizenTech_MobileAdmin.xml" hash="3d9904aebe449343c74004cd160e0b89"/></dir></target><target name="magelocal"><dir name="EmizenTech"><dir name="MobileAdmin"><dir><dir name="Block"><file name="Index.php" hash="76f331d88fb83bbe3135c494d084e4b7"/></dir><dir name="Helper"><file name="Data.php" hash="717d18ec9e49c69e4ba19eaffb88397e"/></dir><dir name="Model"><file name="Api.php" hash="1139274252b522c02ad26655ca1fc641"/><file name="Emizenmob.php" hash="0b2018dfc93072b5712d20ed676c8a30"/><dir name="Mysql4"><dir name="Emizenmob"><file name="Collection.php" hash="6b958aa1ddc5d96955dbdf4bdd7f6976"/></dir><file name="Emizenmob.php" hash="1285e93887bc67933f0bac32bed8b762"/></dir><file name="Observer.php" hash="c819a71c2130d56d760f06a674b8c7b9"/></dir><dir name="controllers"><file name="ConfigurationController.php" hash="37ef30eff0cfcb3cc3927820a3b2aee9"/><file name="IndexController.php" hash="8589e71fc8e9d365c507a96492829470"/><file name="ReportController.php" hash="f42a6f20ee66fbeb5f07c4e4170675d4"/><file name=".ConfigurationController.php.swp" hash="d82018d3f6f213b76d62489a9e149345"/></dir><dir name="etc"><file name="adminhtml.xml" hash="53c7b1eb3b23e2cf8b899309517a1c14"/><file name="api.xml" hash="c81e576c36f189af6dffefca1a746622"/><file name="config.xml" hash="fc55154f0afa4f68e7c501cdf6145b27"/><file name="system.xml" hash="6f7e1b090d771a29e5d2d4777d7e4304"/></dir><dir name="sql"><dir name="mobileadmin_setup"><file name="mysql4-install-0.1.0.php" hash="3faa6e0c9146571ac842f5aeeedf961c"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="mobileadmin"><file name="index.phtml" hash="395b5512423d31a9526f94e3d7dcc13a"/></dir></dir><dir name="layout"><file name="mobileadmin.xml" hash="bf0ff6a1d30dfeb5b159c72eff4311ae"/></dir></dir></dir></dir></target><target name="mage"><dir name="lib"><dir name="EmizenMobileAdmin"><file name="PushNotificationAppCertificateKey.pem" hash="546f3a014aab15d6765f80a1133cbedd"/></dir></dir></target></contents>
34
  <compatible/>
35
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
36
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>emizenmobileadmin</name>
4
+ <version>1.0.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
28
  * Store view Selection For Dashboard,&#xD;
29
  * Multistore Support</notes>
30
  <authors><author><name>Emizen Tech Private Limited</name><user>emizen</user><email>info@emizentech.com</email></author></authors>
31
+ <date>2015-04-14</date>
32
+ <time>12:18:59</time>
33
+ <contents><target name="mageetc"><dir name="modules"><file name="EmizenTech_MobileAdmin.xml" hash="3d9904aebe449343c74004cd160e0b89"/></dir></target><target name="magelocal"><dir name="EmizenTech"><dir name="MobileAdmin"><dir><dir name="Block"><file name="Index.php" hash="76f331d88fb83bbe3135c494d084e4b7"/></dir><dir name="Helper"><file name="Data.php" hash="717d18ec9e49c69e4ba19eaffb88397e"/></dir><dir name="Model"><file name="Api.php" hash="1139274252b522c02ad26655ca1fc641"/><file name="Emizenmob.php" hash="0b2018dfc93072b5712d20ed676c8a30"/><dir name="Mysql4"><dir name="Emizenmob"><file name="Collection.php" hash="6b958aa1ddc5d96955dbdf4bdd7f6976"/></dir><file name="Emizenmob.php" hash="1285e93887bc67933f0bac32bed8b762"/></dir><file name="Observer.php" hash="c819a71c2130d56d760f06a674b8c7b9"/></dir><dir name="controllers"><file name="ConfigurationController.php" hash="733600ecac25a8ce7a35183212aae417"/><file name="IndexController.php" hash="b46a458e5727429e24795273cd80a3c1"/><file name="ReportController.php" hash="f42a6f20ee66fbeb5f07c4e4170675d4"/><file name=".ConfigurationController.php.swp" hash="d82018d3f6f213b76d62489a9e149345"/></dir><dir name="etc"><file name="adminhtml.xml" hash="53c7b1eb3b23e2cf8b899309517a1c14"/><file name="api.xml" hash="c81e576c36f189af6dffefca1a746622"/><file name="config.xml" hash="fc55154f0afa4f68e7c501cdf6145b27"/><file name="system.xml" hash="6f7e1b090d771a29e5d2d4777d7e4304"/></dir><dir name="sql"><dir name="mobileadmin_setup"><file name="mysql4-install-0.1.0.php" hash="3faa6e0c9146571ac842f5aeeedf961c"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="mobileadmin"><file name="index.phtml" hash="395b5512423d31a9526f94e3d7dcc13a"/></dir></dir><dir name="layout"><file name="mobileadmin.xml" hash="bf0ff6a1d30dfeb5b159c72eff4311ae"/></dir></dir></dir></dir></target><target name="mage"><dir name="lib"><dir name="EmizenMobileAdmin"><file name="PushNotificationAppCertificateKey.pem" hash="546f3a014aab15d6765f80a1133cbedd"/></dir></dir></target></contents>
34
  <compatible/>
35
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
36
  </package>