Proxymit_StoreShipper - Version 1.0.1

Version Notes

This is an initial submission.
Please feel free to contact us in case of troubleshooting.

Download this release

Release Info

Developer Proxym Group
Extension Proxymit_StoreShipper
Version 1.0.1
Comparing to
See all releases


Version 1.0.1

Files changed (75) hide show
  1. app/code/community/Proxymit/Pickup/Block/Pickup.php +22 -0
  2. app/code/community/Proxymit/Pickup/Helper/Data.php +6 -0
  3. app/code/community/Proxymit/Pickup/Model/Carrier/Pickup.php +45 -0
  4. app/code/community/Proxymit/Pickup/Model/Mysql4/Pickup.php +10 -0
  5. app/code/community/Proxymit/Pickup/Model/Mysql4/Pickup/Collection.php +10 -0
  6. app/code/community/Proxymit/Pickup/Model/Observer.php +73 -0
  7. app/code/community/Proxymit/Pickup/Model/Pickup.php +10 -0
  8. app/code/community/Proxymit/Pickup/Model/Sales/Order.php +50 -0
  9. app/code/community/Proxymit/Pickup/etc/config.xml +131 -0
  10. app/code/community/Proxymit/Pickup/etc/system.xml +133 -0
  11. app/code/community/Proxymit/Pickup/sql/pickup_setup/mysql4-install-0.1.0.php +17 -0
  12. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Sales/Order/View.php +36 -0
  13. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores.php +23 -0
  14. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit.php +39 -0
  15. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Button.php +16 -0
  16. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Country.php +14 -0
  17. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Form.php +35 -0
  18. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Html.php +14 -0
  19. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Images.php +39 -0
  20. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Map.php +59 -0
  21. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/StoreViewColumn.php +15 -0
  22. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Tab/Contact.php +94 -0
  23. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Tab/Form.php +113 -0
  24. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Tab/Geo.php +46 -0
  25. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Tab/Grid.php +78 -0
  26. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Tab/Orders.php +39 -0
  27. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Tab/Schedule.php +151 -0
  28. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Tabs.php +53 -0
  29. app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Grid.php +103 -0
  30. app/code/community/Proxymit/StoreShipper/Block/OurStores.php +50 -0
  31. app/code/community/Proxymit/StoreShipper/Block/Sales/Order/Details.php +62 -0
  32. app/code/community/Proxymit/StoreShipper/Block/Sales/Order/Info.php +131 -0
  33. app/code/community/Proxymit/StoreShipper/Helper/Data.php +99 -0
  34. app/code/community/Proxymit/StoreShipper/Model/Mysql4/Grid.php +12 -0
  35. app/code/community/Proxymit/StoreShipper/Model/Mysql4/Grid/Collection.php +10 -0
  36. app/code/community/Proxymit/StoreShipper/Model/Mysql4/Orders.php +9 -0
  37. app/code/community/Proxymit/StoreShipper/Model/Mysql4/Orders/Collection.php +10 -0
  38. app/code/community/Proxymit/StoreShipper/Model/Mysql4/Pickup/Collection.php +10 -0
  39. app/code/community/Proxymit/StoreShipper/Model/Mysql4/Schedule.php +9 -0
  40. app/code/community/Proxymit/StoreShipper/Model/Mysql4/Schedule/Collection.php +10 -0
  41. app/code/community/Proxymit/StoreShipper/Model/Mysql4/Stores.php +9 -0
  42. app/code/community/Proxymit/StoreShipper/Model/Mysql4/Stores/Collection.php +10 -0
  43. app/code/community/Proxymit/StoreShipper/Model/Orders.php +11 -0
  44. app/code/community/Proxymit/StoreShipper/Model/Schedule.php +11 -0
  45. app/code/community/Proxymit/StoreShipper/Model/Stores.php +11 -0
  46. app/code/community/Proxymit/StoreShipper/controllers/Adminhtml/IndexController.php +522 -0
  47. app/code/community/Proxymit/StoreShipper/controllers/IndexController.php +102 -0
  48. app/code/community/Proxymit/StoreShipper/etc/adminhtml.xml +35 -0
  49. app/code/community/Proxymit/StoreShipper/etc/config.xml +132 -0
  50. app/code/community/Proxymit/StoreShipper/sql/storeshipper_setup/mysql4-install-0.0.1.php +58 -0
  51. app/design/adminhtml/default/default/layout/storeshipper.xml +57 -0
  52. app/design/adminhtml/default/default/template/storeshipper/sales/info.phtml +144 -0
  53. app/design/adminhtml/default/default/template/storeshipper/sales/order/creditmemo/create/form.phtml +88 -0
  54. app/design/adminhtml/default/default/template/storeshipper/sales/order/creditmemo/view/form.phtml +97 -0
  55. app/design/adminhtml/default/default/template/storeshipper/sales/order/invoice/create/form.phtml +119 -0
  56. app/design/adminhtml/default/default/template/storeshipper/sales/order/invoice/view/form.phtml +93 -0
  57. app/design/adminhtml/default/default/template/storeshipper/sales/order/shipment/create/form.phtml +114 -0
  58. app/design/adminhtml/default/default/template/storeshipper/sales/order/shipment/view/form.phtml +117 -0
  59. app/design/adminhtml/default/default/template/storeshipper/stores.phtml +1 -0
  60. app/design/frontend/base/default/layout/pickup.xml +20 -0
  61. app/design/frontend/base/default/layout/storeshipper.xml +64 -0
  62. app/design/frontend/base/default/template/pickup/checkout/onepage/shipping_method/available.phtml +123 -0
  63. app/design/frontend/base/default/template/pickup/pickup.phtml +361 -0
  64. app/design/frontend/base/default/template/storeshipper/ourstores.phtml +287 -0
  65. app/design/frontend/base/default/template/storeshipper/sales/order/details.phtml +116 -0
  66. app/design/frontend/base/default/template/storeshipper/sales/order/info.phtml +101 -0
  67. app/design/frontend/base/default/template/storeshipper/sales/order/print.phtml +85 -0
  68. app/design/frontend/base/default/template/storeshipper/sales/order/print/creditmemo.phtml +98 -0
  69. app/design/frontend/base/default/template/storeshipper/sales/order/print/invoice.phtml +94 -0
  70. app/design/frontend/proxymit/default/template/sales/order/info.phtml +101 -0
  71. app/etc/modules/Proxymit_Pickup.xml +9 -0
  72. app/etc/modules/Proxymit_StoreShipper.xml +12 -0
  73. app/locale/en_US/template/email/sales/storeshipper_customer.html +112 -0
  74. app/locale/en_US/template/email/sales/storeshipper_manager.html +112 -0
  75. package.xml +21 -0
app/code/community/Proxymit/Pickup/Block/Pickup.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Proxymit_Pickup_Block_Pickup extends Mage_Checkout_Block_Onepage_Shipping_Method_Available
3
+ {
4
+ public function __construct(){
5
+ $this->setTemplate('pickup/pickup.phtml');
6
+ }
7
+ // Show only available in Storeview
8
+ public function filterStores($data){
9
+ $res = array();
10
+ foreach ( $data as $st ){
11
+ if($st['available_at_storeview'] == -1 || $st['available_at_storeview'] == Mage::app()->getStore()->getStoreId()){
12
+ array_push($res,$st);
13
+ }
14
+ }
15
+ return $res;
16
+ }
17
+ public function getAllStores() {
18
+ $collection = Mage::getModel ( 'storeshipper/stores' )->getCollection ();
19
+ $data=$collection->getData ();
20
+ return $this->filterStores($data);
21
+ }
22
+ }
app/code/community/Proxymit/Pickup/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Proxymit_Pickup_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/community/Proxymit/Pickup/Model/Carrier/Pickup.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Proxymit_Pickup_Model_Carrier_Pickup extends Mage_Shipping_Model_Carrier_Abstract
4
+ implements Mage_Shipping_Model_Carrier_Interface {
5
+
6
+ protected $_code = 'pickup';
7
+
8
+ public function getFormBlock(){
9
+ return 'pickup/pickup';
10
+ }
11
+
12
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
13
+ {
14
+ if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
15
+ return false;
16
+ }
17
+
18
+ $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
19
+ $result = Mage::getModel('shipping/rate_result');
20
+ $show = true;
21
+ if($show){ // This if condition is just to demonstrate how to return success and error in shipping methods
22
+
23
+ $method = Mage::getModel('shipping/rate_result_method');
24
+ $method->setCarrier($this->_code);
25
+ $method->setMethod($this->_code);
26
+ $method->setCarrierTitle($this->getConfigData('title'));
27
+ $method->setMethodTitle($this->getConfigData('name'));
28
+ $method->setPrice($this->getConfigData('price'));
29
+ $method->setCost($this->getConfigData('price'));
30
+ $result->append($method);
31
+
32
+ }else{
33
+ $error = Mage::getModel('shipping/rate_result_error');
34
+ $error->setCarrier($this->_code);
35
+ $error->setCarrierTitle($this->getConfigData('name'));
36
+ $error->setErrorMessage($this->getConfigData('specificerrmsg'));
37
+ $result->append($error);
38
+ }
39
+ return $result;
40
+ }
41
+ public function getAllowedMethods()
42
+ {
43
+ return array('excellence'=>$this->getConfigData('name'));
44
+ }
45
+ }
app/code/community/Proxymit/Pickup/Model/Mysql4/Pickup.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Proxymit_Pickup_Model_Mysql4_Pickup extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the pickup_id refers to the key field in your database table.
8
+ $this->_init('pickup/pickup', 'id');
9
+ }
10
+ }
app/code/community/Proxymit/Pickup/Model/Mysql4/Pickup/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Proxymit_Pickup_Model_Mysql4_Pickup_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('pickup/pickup');
9
+ }
10
+ }
app/code/community/Proxymit/Pickup/Model/Observer.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Proxymit_Pickup_Model_Observer extends Varien_Object {
3
+ public function saveShippingMethod($evt) {
4
+ $request = $evt->getRequest ();
5
+ $quote = $evt->getQuote ();
6
+ $pickup = $request->getParam ( 'shipping_pickup', false );
7
+ $quote_id = $quote->getId ();
8
+ $data = array (
9
+ $quote_id => $pickup
10
+ );
11
+ $rate = $quote->getShippingAddress()->getShippingMethod();
12
+ if ($pickup && $rate=="pickup_pickup") {
13
+ Mage::getSingleton ( 'checkout/session' )->setPickup ( $data );
14
+ $storeCoord = Mage::getModel ( "storeshipper/stores" )->load ( $pickup ["id_store"] );
15
+ $quote->getShippingAddress ()->setData ( 'firstname', $storeCoord->getName () );
16
+ $quote->getShippingAddress ()->setData ( 'lastname', 'Store' );
17
+ $quote->getShippingAddress ()->setData ( 'street', $storeCoord->getAdress() );
18
+ $quote->getShippingAddress ()->setData ( 'city' , $storeCoord->getCity() );
19
+ $quote->getShippingAddress ()->setData ( 'postcode' , $storeCoord->getZipcode() );
20
+ $quote->getShippingAddress ()->setData ( 'country' , $storeCoord->getCountry() );
21
+ $quote->getShippingAddress ()->setData ( 'telephone' , $storeCoord->getPhone() );
22
+ $quote->getShippingAddress ()->setData ( 'fax' , $storeCoord->getFax() );
23
+
24
+ // $shipping_amount = $quote->getShippingAmount();
25
+ // $quote->setShippingAmount( $shipping_amount + 30 );
26
+ // Mage::log($shipping_amount);
27
+ }
28
+ //print_r ( $data );
29
+ }
30
+ public function saveOrderAfter($evt) {
31
+ $order = $evt->getOrder ();
32
+ $quote = $evt->getQuote ();
33
+ $quote_id = $quote->getId ();
34
+ $pickup = Mage::getSingleton ( 'checkout/session' )->getPickup ();
35
+ if (isset ( $pickup [$quote_id] )) {
36
+ $data = $pickup [$quote_id];
37
+ $data ['order_id'] = $order->getId ();
38
+ $pickupModel = Mage::getModel ( 'pickup/pickup' );
39
+ $pickupModel->setData ( $data );
40
+ $pickupModel->save ();
41
+ //Mage::log ( $data );
42
+ $storeshipperModel = Mage::getModel ( 'storeshipper/orders' );
43
+ $d = array ();
44
+ $d ['id_order'] = $order->getId ();
45
+ $d ['id_store'] = $data ['id_store'];
46
+ $storeshipperModel->setData ( $d );
47
+ $storeshipperModel->save ();
48
+ }
49
+ }
50
+ public function loadOrderAfter($evt) {
51
+ $order = $evt->getOrder ();
52
+ if ($order->getId ()) {
53
+ $order_id = $order->getId ();
54
+ $pickupCollection = Mage::getModel ( 'storeshipper/orders' )->getCollection ();
55
+ $pickupCollection->addFieldToFilter ( 'id_order', $order_id );
56
+ $pickup = $pickupCollection->getFirstItem ();
57
+ $order->setPickupObject ( $pickup );
58
+ //Mage::log($pickup);
59
+ }
60
+ }
61
+ public function loadQuoteAfter($evt) {
62
+ $quote = $evt->getQuote ();
63
+ if ($quote->getId ()) {
64
+ $quote_id = $quote->getId ();
65
+ $pickup = Mage::getSingleton ( 'checkout/session' )->getPickup ();
66
+ if (isset ( $pickup [$quote_id] )) {
67
+ $data = $pickup [$quote_id];
68
+ $quote->setPickupData ( $data );
69
+ }
70
+ // Mage::log($pickup);
71
+ }
72
+ }
73
+ }
app/code/community/Proxymit/Pickup/Model/Pickup.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Proxymit_Pickup_Model_Pickup extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('pickup/pickup');
9
+ }
10
+ }
app/code/community/Proxymit/Pickup/Model/Sales/Order.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Proxymit_Pickup_Model_Sales_Order extends Mage_Sales_Model_Order {
3
+
4
+ public function getShippingDescription() {
5
+ $desc = parent::getShippingDescription ();
6
+ $pickupObject = $this->getPickupObject ();
7
+ // Zend_Debug::dump($pickupObject->getData());
8
+ // die();
9
+ $googleApiKey = Mage::getStoreConfig ( 'carriers/pickup/google_api' );
10
+ if ($pickupObject != NULL && $pickupObject->getData ()) {
11
+ $store = Mage::getModel ( 'storeshipper/stores' )->getCollection ()->getItemById ( $pickupObject->getIdStore () );
12
+ // $desc .= '<p><b>Pickup Date</b>: ' . Mage::app ()->getLocale
13
+ // ()->date ( strtotime ( $pickupObject->getPickupDate () ), null,
14
+ // null, false )->toString ( 'dd/MM/yyyy' ); right: 342px;width: 669px;
15
+ $desc .= '<br/><b>Store Name</b>: ' . $store->getName ();
16
+ $desc .= '<br/><b>Store Adress</b>: ' . $store->getAdress () . ', ' . $store->getCity () . ', ' . Mage::helper("storeshipper")->getCountryName($store->getCountry ());
17
+ $desc .= '<br /><a href="https://maps.google.com/maps?saddr=&daddr=('.$store->getLatitude().','.$store->getLongitude().')&hl=fr&ie=UTF8&sll=48.885953,2.242912&sspn=0.008113,0.01929&geocode=&oq=&t=h&mra=ls" target="_blank"><b>Itinerary</b></a>';
18
+ $desc .= '<br/><b>Phone</b>: ' . $store->getPhone ();
19
+ $desc .= '<br /><br /><br />';
20
+ $desc .= '
21
+ <div id="map-canvas" style="height: 270px; position: relative;"><img src="http://maps.googleapis.com/maps/api/staticmap?sensor=true&center='.$store->getLatitude().','.$store->getLongitude().'&zoom=8&markers=color:red%7Clabel:S%7C'.$store->getLatitude().','.$store->getLongitude().'&size=317x270&key=' . $googleApiKey . '" /></div>
22
+ <script type="text/javascript"
23
+ src="https://maps.googleapis.com/maps/api/js?key=' . $googleApiKey . '&sensor=true">
24
+ </script>
25
+ <script type="text/javascript">
26
+ function initialize() {
27
+
28
+ var mapOptions = {
29
+ center: new google.maps.LatLng('.$store->getLatitude().','.$store->getLongitude().'),
30
+ zoom: 13,
31
+ mapTypeId: google.maps.MapTypeId.ROADMAP
32
+ };
33
+ var map = new google.maps.Map(document.getElementById("map-canvas"),mapOptions);
34
+ var marker = new google.maps.Marker({
35
+ position: new google.maps.LatLng('.$store->getLatitude().','.$store->getLongitude().'),
36
+ title:"'.$store->getName ().'"});
37
+
38
+ marker.setMap(map);
39
+
40
+ }
41
+ google.maps.event.addDomListener(window, "load", initialize);
42
+
43
+
44
+ </script>
45
+ ';
46
+ $desc .= '</p>';
47
+ }
48
+ return $desc;
49
+ }
50
+ }
app/code/community/Proxymit/Pickup/etc/config.xml ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Proxymit_Pickup>
5
+ <version>1.0.1</version>
6
+ </Proxymit_Pickup>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <pickup>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Proxymit_Pickup</module>
14
+ <frontName>pickup</frontName>
15
+ </args>
16
+ </pickup>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <pickup>
21
+ <file>pickup.xml</file>
22
+ </pickup>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <global>
27
+ <events>
28
+ <checkout_controller_onepage_save_shipping_method>
29
+ <observers>
30
+ <checkout_controller_onepage_save_shipping_method>
31
+ <type>model</type>
32
+ <class>pickup/observer</class>
33
+ <method>saveShippingMethod</method>
34
+ </checkout_controller_onepage_save_shipping_method>
35
+ </observers>
36
+ </checkout_controller_onepage_save_shipping_method>
37
+ <sales_model_service_quote_submit_after>
38
+ <observers>
39
+ <checkout_controller_onepage_save_shipping_method>
40
+ <type>model</type>
41
+ <class>pickup/observer</class>
42
+ <method>saveOrderAfter</method>
43
+ </checkout_controller_onepage_save_shipping_method>
44
+ </observers>
45
+ </sales_model_service_quote_submit_after>
46
+ <sales_order_load_after>
47
+ <observers>
48
+ <sales_order_load_after>
49
+ <type>model</type>
50
+ <class>pickup/observer</class>
51
+ <method>loadOrderAfter</method>
52
+ </sales_order_load_after>
53
+ </observers>
54
+ </sales_order_load_after>
55
+ <sales_quote_load_after>
56
+ <observers>
57
+ <sales_quote_load_after>
58
+ <type>model</type>
59
+ <class>pickup/observer</class>
60
+ <method>loadQuoteAfter</method>
61
+ </sales_quote_load_after>
62
+ </observers>
63
+ </sales_quote_load_after>
64
+ </events>
65
+ <models>
66
+ <sales>
67
+ <rewrite>
68
+ <order>Proxymit_Pickup_Model_Sales_Order</order>
69
+ </rewrite>
70
+ </sales>
71
+ <pickup>
72
+ <class>Proxymit_Pickup_Model</class>
73
+ <resourceModel>pickup_mysql4</resourceModel>
74
+ </pickup>
75
+ <pickup_mysql4>
76
+ <class>Proxymit_Pickup_Model_Mysql4</class>
77
+ <entities>
78
+ <pickup>
79
+ <table>order_shipping_pickup</table>
80
+ </pickup>
81
+ </entities>
82
+ </pickup_mysql4>
83
+ </models>
84
+ <resources>
85
+ <pickup_setup>
86
+ <setup>
87
+ <module>Proxymit_Pickup</module>
88
+ </setup>
89
+ <connection>
90
+ <use>core_setup</use>
91
+ </connection>
92
+ </pickup_setup>
93
+ <pickup_write>
94
+ <connection>
95
+ <use>core_write</use>
96
+ </connection>
97
+ </pickup_write>
98
+ <pickup_read>
99
+ <connection>
100
+ <use>core_read</use>
101
+ </connection>
102
+ </pickup_read>
103
+ </resources>
104
+ <blocks>
105
+ <pickup>
106
+ <class>Proxymit_Pickup_Block</class>
107
+ </pickup>
108
+ </blocks>
109
+ <helpers>
110
+ <pickup>
111
+ <class>Proxymit_Pickup_Helper</class>
112
+ </pickup>
113
+ </helpers>
114
+ </global>
115
+ <default>
116
+ <carriers>
117
+ <pickup>
118
+ <active>1</active>
119
+ <model>pickup/carrier_pickup</model>
120
+ <title>Store Shipper</title>
121
+ <name>Store Shipper</name>
122
+ <price>0</price>
123
+ <specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg>
124
+ <email_customer_active>1</email_customer_active>
125
+ <email_manager_active>1</email_manager_active>
126
+ <pickup_after>0</pickup_after>
127
+
128
+ </pickup>
129
+ </carriers>
130
+ </default>
131
+ </config>
app/code/community/Proxymit/Pickup/etc/system.xml ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <sections>
4
+ <carriers>
5
+ <groups>
6
+ <pickup translate="label" module="shipping">
7
+ <label>Store Shipper</label>
8
+ <frontend_type>text</frontend_type>
9
+ <sort_order>99</sort_order>
10
+ <show_in_default>1</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>1</show_in_store>
13
+ <fields>
14
+ <active translate="label">
15
+ <label>Enabled</label>
16
+ <frontend_type>select</frontend_type>
17
+ <source_model>adminhtml/system_config_source_yesno</source_model>
18
+ <sort_order>1</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>1</show_in_store>
22
+ </active>
23
+ <title translate="label">
24
+ <label>Title</label>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>2</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ </title>
31
+ <name translate="label">
32
+ <label>Method Name</label>
33
+ <frontend_type>text</frontend_type>
34
+ <sort_order>2</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>1</show_in_website>
37
+ <show_in_store>1</show_in_store>
38
+ </name>
39
+ <price translate="label">
40
+ <label>Price</label>
41
+ <frontend_type>text</frontend_type>
42
+ <sort_order>3</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>0</show_in_store>
46
+ </price>
47
+ <google_api translate="label">
48
+ <label>Google API v3 Key</label>
49
+ <frontend_type>text</frontend_type>
50
+ <sort_order>4</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>0</show_in_store>
54
+ </google_api>
55
+ <pickup_after translate="label">
56
+ <label>Pickup after</label>
57
+ <frontend_type>text</frontend_type>
58
+ <comment>days</comment>
59
+ <sort_order>5</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>0</show_in_store>
63
+ </pickup_after>
64
+ <email_customer_active translate="label">
65
+ <label>Customer Email Notification</label>
66
+ <frontend_type>select</frontend_type>
67
+ <source_model>adminhtml/system_config_source_yesno</source_model>
68
+ <sort_order>6</sort_order>
69
+ <show_in_default>1</show_in_default>
70
+ <show_in_website>1</show_in_website>
71
+ <show_in_store>1</show_in_store>
72
+ </email_customer_active>
73
+ <email_customer_template translate="label">
74
+ <label>Customer Email Template</label>
75
+ <frontend_type>select</frontend_type>
76
+ <source_model>adminhtml/system_config_source_email_template</source_model>
77
+ <sort_order>7</sort_order>
78
+ <show_in_default>1</show_in_default>
79
+ <show_in_website>1</show_in_website>
80
+ <show_in_store>0</show_in_store>
81
+ </email_customer_template>
82
+ <email_manager_active translate="label">
83
+ <label>Store Manager Email Notification</label>
84
+ <frontend_type>select</frontend_type>
85
+ <source_model>adminhtml/system_config_source_yesno</source_model>
86
+ <sort_order>8</sort_order>
87
+ <show_in_default>1</show_in_default>
88
+ <show_in_website>1</show_in_website>
89
+ <show_in_store>1</show_in_store>
90
+ </email_manager_active>
91
+ <email_manager_template translate="label">
92
+ <label>Store Manager Email Template</label>
93
+ <frontend_type>select</frontend_type>
94
+ <source_model>adminhtml/system_config_source_email_template</source_model>
95
+ <sort_order>9</sort_order>
96
+ <show_in_default>1</show_in_default>
97
+ <show_in_website>1</show_in_website>
98
+ <show_in_store>0</show_in_store>
99
+ </email_manager_template>
100
+ <specificerrmsg translate="label">
101
+ <label>Displayed Error Message</label>
102
+ <frontend_type>textarea</frontend_type>
103
+ <sort_order>10</sort_order>
104
+ <show_in_default>1</show_in_default>
105
+ <show_in_website>1</show_in_website>
106
+ <show_in_store>1</show_in_store>
107
+ </specificerrmsg>
108
+ <sallowspecific translate="label">
109
+ <label>Ship to Applicable Countries</label>
110
+ <frontend_type>select</frontend_type>
111
+ <sort_order>90</sort_order>
112
+ <frontend_class>shipping-applicable-country</frontend_class>
113
+ <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
114
+ <show_in_default>1</show_in_default>
115
+ <show_in_website>1</show_in_website>
116
+ <show_in_store>0</show_in_store>
117
+ </sallowspecific>
118
+ <specificcountry translate="label">
119
+ <label>Ship to Specific Countries</label>
120
+ <frontend_type>multiselect</frontend_type>
121
+ <sort_order>91</sort_order>
122
+ <source_model>adminhtml/system_config_source_country</source_model>
123
+ <show_in_default>1</show_in_default>
124
+ <show_in_website>1</show_in_website>
125
+ <show_in_store>0</show_in_store>
126
+ <can_be_empty>1</can_be_empty>
127
+ </specificcountry>
128
+ </fields>
129
+ </pickup>
130
+ </groups>
131
+ </carriers>
132
+ </sections>
133
+ </config>
app/code/community/Proxymit/Pickup/sql/pickup_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+ CREATE TABLE IF NOT EXISTS {$this->getTable('order_shipping_pickup')} (
9
+ `id` int(11) unsigned NOT NULL auto_increment,
10
+ `order_id` int(11) NOT NULL,
11
+ `store` varchar(255) NOT NULL default '',
12
+ `name` varchar(255) NOT NULL default '',
13
+ PRIMARY KEY (`id`)
14
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
15
+ ");
16
+
17
+ $installer->endSetup();
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Sales/Order/View.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * Proxymit_StoreShipper Module
6
+ * Adminhtml Block
7
+ * Comment : ADDING Notification Buttons to the Order View if the Order is passed by StoreShipper Module
8
+ *
9
+ */
10
+
11
+ class Proxymit_StoreShipper_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View {
12
+ public function __construct() {
13
+
14
+ // ADD Notify Buttons to the Order View if the Order Passed with StoreShipper
15
+ if(Mage::helper("storeshipper")->getOrderMethod($this->getOrderId())=="pickup"){
16
+ // Verify Config : Store Manager Notification enabled
17
+ if(Mage::getStoreConfig('carriers/pickup/email_customer_active')){
18
+ $this->_addButton('notif_client', array(
19
+ 'label' => Mage::helper('storeshipper')->__('Notify Customer '),
20
+ 'onclick' => "confirmSetLocation('Send Email to Customer ?','".Mage::helper('adminhtml')->getUrl('storeshipper/adminhtml_index/notifyCustomer',array("order_id" => $this->getOrderId()))."')",
21
+ 'class' => 'go'
22
+ ), 0, 100, 'header', 'header');
23
+ }
24
+ // Verify Config : Store Manager Notification enabled
25
+ if(Mage::getStoreConfig('carriers/pickup/email_manager_active')){
26
+ $this->_addButton('notif_manager', array(
27
+ 'label' => Mage::helper('storeshipper')->__('Notify Store Manager'),
28
+ 'onclick' => "confirmSetLocation('Send Email to Store Manager ?','".Mage::helper('adminhtml')->getUrl('storeshipper/adminhtml_index/notifyStoreManager',array("order_id" => $this->getOrderId()))."')",
29
+ 'class' => 'go'
30
+ ), 0, 101, 'header', 'header');
31
+ }
32
+ }
33
+ parent::__construct();
34
+ }
35
+
36
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores
7
+ * Comments : Stores
8
+ */
9
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores extends Mage_Adminhtml_Block_Widget_Grid_Container {
10
+ public function __construct() {
11
+ $this->_blockGroup = 'storeshipper';
12
+ $this->_controller = 'adminhtml_stores';
13
+ $this->_headerText = $this->__ ( 'Stores' );
14
+
15
+ $this->_addButton('sync', array(
16
+ 'label' => Mage::helper('adminhtml')->__('Import CSV'),
17
+ 'onclick' => "confirmSetLocation('Import Stores from ".$this->getBaseUrl()."stores.csv ?','".$this->getUrl('*/*/importCsv', array('_current'=>true))."')",
18
+ 'class' => 'add',
19
+ ), -100);
20
+
21
+ parent::__construct ();
22
+ }
23
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores->Edit Store
7
+ * Comments : Edit Store
8
+ */
9
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
10
+ {
11
+ /**
12
+ * Init class
13
+ */
14
+ public function __construct()
15
+ {
16
+ $this->_blockGroup = 'storeshipper';
17
+ $this->_controller = 'adminhtml_stores';
18
+
19
+ parent::__construct();
20
+
21
+ $this->_updateButton('save', 'label', $this->__('Save Store'));
22
+ $this->_updateButton('delete', 'label', $this->__('Delete Store'));
23
+ }
24
+
25
+ /**
26
+ * Get Header text
27
+ *
28
+ * @return string
29
+ */
30
+ public function getHeaderText()
31
+ {
32
+ if (Mage::registry('storeshipper')) {
33
+ return $this->__('Edit Store');
34
+ }
35
+ else {
36
+ return $this->__('New Store');
37
+ }
38
+ }
39
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Button.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores->Edit Store->Contact Information->Add Images
7
+ *
8
+ */
9
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_Button extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
10
+ public function render(Varien_Data_Form_Element_Abstract $element) {
11
+ $html = '
12
+ <input type="button" value="Add Image" onclick="editForm.submit($(\'edit_form\').action+\'back/edit/id/2\');" />
13
+ ';
14
+ return '';
15
+ }
16
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Country.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores->Edit Store->Related Orders
7
+ * Comments : Show Customer Name in the Related Orders Grid
8
+ */
9
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_Country extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {
10
+ public function render(Varien_Object $row) {
11
+ $value = $row->getData();
12
+ return '<span>' . Mage::helper("storeshipper")->getCountryName($value["country"]) . '</span>';
13
+ }
14
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Form.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores->Edit Store->General Infromation Tab
7
+ *
8
+ */
9
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
10
+ {
11
+
12
+ public function __construct()
13
+ {
14
+ parent::__construct();
15
+
16
+ $this->setId('storeshipper_stores_form');
17
+ $this->setTitle($this->__('Store Information'));
18
+ }
19
+
20
+ protected function _prepareForm()
21
+ {
22
+ $form = new Varien_Data_Form(array(
23
+ 'id' => 'edit_form',
24
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
25
+ 'method' => 'post',
26
+ 'enctype' => 'multipart/form-data'
27
+ )
28
+ );
29
+
30
+ $form->setUseContainer(true);
31
+ $this->setForm($form);
32
+ return parent::_prepareForm();
33
+ }
34
+
35
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Html.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores->Edit Store->Related Orders
7
+ * Comments : Show Customer Name in the Related Orders Grid
8
+ */
9
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_Html extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {
10
+ public function render(Varien_Object $row) {
11
+ $value = $row->getData();
12
+ return '<span>' . Mage::helper("storeshipper")->getOrderClientName($value["id_order"]) . '</span>';
13
+ }
14
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Images.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores->Edit Store->Contact Information
7
+ * Comments : Get Images of the store from BASE_URL/media/storeshipper/{id_store}/
8
+ */
9
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_Images extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
10
+ public function render(Varien_Data_Form_Element_Abstract $element) {
11
+ $html = '<div>';
12
+ $path = Mage::getBaseDir ( 'media' ) . DS . 'storeshipper' . DS .$this->getRequest()->getParam('id'). DS;
13
+ $array = $this->dirFiles ( $path );
14
+ foreach ( $array as $key => $file ) {
15
+ $p = Mage::getBaseUrl ( Mage_Core_Model_Store::URL_TYPE_MEDIA ) . 'storeshipper' . DS .$this->getRequest()->getParam('id'). DS . $file;
16
+ $html .= '<div align="center" style="display: inline-block;">
17
+ <a target="_blank" href="' . $p . '"><img style="max-width: 150px;" src="' . $p . '" /></a>
18
+ <br><input class="button form-button" onclick="location.href=\''.$this->getUrl('*/*/deleteImage').'imagename/'.$file.'/id/'.$this->getRequest()->getParam('id').'\'" value="Delete" type="button" /></div>';
19
+ }
20
+ $html .= '</div><br /><hr /><br />';
21
+ return $html;
22
+ }
23
+ function dirFiles($directry) {
24
+ $dir = dir ( $directry ); // Open Directory
25
+ if ($dir != NULL) {
26
+ while ( false !== ($file = $dir->read ()) ) // Reads Directory
27
+ {
28
+ $extension = substr ( $file, strrpos ( $file, '.' ) ); // Gets the File
29
+ // Extension
30
+ if ($extension == ".png" || $extension == ".jpg" || $extension == ".bmp" | $extension == ".gif" | $extension == ".jpeg") // Extensions
31
+ // Allowed
32
+ $filesall [$file] = $file; // Store in Array
33
+ }
34
+ $dir->close (); // Close Directory
35
+ asort ( $filesall ); // Sorts the Array
36
+ return $filesall;
37
+ }
38
+ }
39
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Map.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores->Edit Store->Geolocation Information
7
+ * Comments : Render Google Maps v3
8
+ */
9
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_Map extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
10
+ public function render(Varien_Data_Form_Element_Abstract $element) {
11
+ $html = '
12
+ <script type="text/javascript"
13
+ src="https://maps.googleapis.com/maps/api/js?key='.Mage::getStoreConfig ( 'carriers/pickup/google_api' ).'&sensor=true">
14
+ </script>
15
+ <div id="map-canvas" style="height: 300px; width: 900px"></div><br><br>
16
+ <script type="text/javascript">
17
+ document.getElementById("form_tabs_geo_section").onclick=function(){document.getElementById("form_tabs_geo_section_content").style.display="block";initialize();initialize();};
18
+ var map = new google.maps.Map(document.getElementById("map-canvas"));
19
+ function initialize() {
20
+ map = new google.maps.Map(document.getElementById("map-canvas"));
21
+ var mapOptions = {
22
+ center: new google.maps.LatLng(document.getElementById("latitude").value,document.getElementById("longitude").value),
23
+ zoom: 1,
24
+ mapTypeId: google.maps.MapTypeId.ROADMAP
25
+ };
26
+ map = new google.maps.Map(document.getElementById("map-canvas"),
27
+ mapOptions);
28
+ addMarker(document.getElementById("latitude").value,document.getElementById("longitude").value,"");
29
+ pointStore(document.getElementById("latitude").value,document.getElementById("longitude").value);
30
+ }
31
+ google.maps.event.addDomListener(window, "load", initialize);
32
+ google.maps.event.trigger(map, "resize");
33
+ function pointStore(lat, long){
34
+ map.panTo(new google.maps.LatLng(lat, long));
35
+ map.setZoom(6);
36
+ }
37
+ function addMarker(lat, long, name){
38
+ var marker = new google.maps.Marker({
39
+ position: new google.maps.LatLng(lat, long),
40
+ map: map,
41
+ draggable: true,
42
+ title: name
43
+ });
44
+ google.maps.event.addListener(marker, "drag", function() { setCoord(marker.getPosition().lat(),marker.getPosition().lng()); } );
45
+ }
46
+ function setCoord(lt,lg){
47
+ document.getElementById("latitude").value=lt;
48
+ document.getElementById("longitude").value=lg;
49
+ google.maps.event.trigger(document.getElementById("latitude"), "blur");
50
+ }
51
+
52
+
53
+
54
+ </script>
55
+
56
+ ';
57
+ return $html;
58
+ }
59
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/StoreViewColumn.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores->Edit Store->Related Orders
7
+ * Comments : Show Customer Name in the Related Orders Grid
8
+ */
9
+
10
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_StoreViewColumn extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {
11
+ public function render(Varien_Object $row) {
12
+ $value = $row->getData();
13
+ return '<span>' . Mage::helper("storeshipper")->getStoreViewName($value["available_at_storeview"]) . '</span>';
14
+ }
15
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Tab/Contact.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores->Edit Store->Contact Infromation Tab
7
+ *
8
+ */
9
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_Tab_Contact extends Mage_Adminhtml_Block_Widget_Form {
10
+ protected function _prepareForm() {
11
+ $form = new Varien_Data_Form ();
12
+ $this->setForm ( $form );
13
+ $fieldset = $form->addFieldset ( 'contact_form', array (
14
+ 'legend' => Mage::helper ( 'storeshipper' )->__ ( 'Contact Information' )
15
+ ) );
16
+
17
+ $model = Mage::registry ( 'storeshipper' );
18
+
19
+ if (! $model) {
20
+ $model = Mage::getModel ( 'storeshipper/stores' );
21
+ }
22
+ if ($model->getId ()) {
23
+ $fieldset->addField ( 'id', 'hidden', array (
24
+ 'name' => 'id'
25
+ ) );
26
+ }
27
+
28
+ $fieldset->addField ( 'email', 'text', array (
29
+ 'name' => 'email',
30
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Email' ),
31
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Email' ),
32
+ 'required' => true
33
+ ) );
34
+ $fieldset->addField ( 'website', 'text', array (
35
+ 'name' => 'website',
36
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Website' ),
37
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Website' ),
38
+ 'required' => false
39
+ ) );
40
+
41
+ $fieldset->addField ( 'phone', 'text', array (
42
+ 'name' => 'phone',
43
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Phone Number' ),
44
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Phone Number' ),
45
+ 'required' => true
46
+ ) );
47
+ $fieldset->addField ( 'fax', 'text', array (
48
+ 'name' => 'fax',
49
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Fax' ),
50
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Fax' ),
51
+ 'required' => false
52
+ ) );
53
+ $fieldset = $form->addFieldset ( 'images_contact_form', array (
54
+ 'legend' => Mage::helper ( 'storeshipper' )->__ ( 'Store Images' )
55
+ ) );
56
+ $customField = $fieldset->addField ( 'images', 'text', array (
57
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Images' ),
58
+ 'name' => 'images'
59
+ ) );
60
+ $customField->setRenderer ( $this->getLayout ()->createBlock ( 'storeshipper/adminhtml_stores_edit_images' ) );
61
+
62
+ $fieldset->addField ( 'store_image', 'image', array (
63
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Add Image' ),
64
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Add Image' ),
65
+ 'value' => '',
66
+ 'name' => 'store_image'
67
+ ) );
68
+ $customField = $fieldset->addField ( 'add_image', 'text', array (
69
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Add Image' ),
70
+ 'name' => 'add_image',
71
+ 'title' => ' '
72
+ ) );
73
+ $customField->setRenderer ( $this->getLayout ()->createBlock ( 'storeshipper/adminhtml_stores_edit_button' ) );
74
+
75
+ $fieldset = $form->addFieldset ( 'manager_contact_form', array (
76
+ 'legend' => Mage::helper ( 'storeshipper' )->__ ( 'Manager Information' )
77
+ ) );
78
+ $fieldset->addField ( 'manager_name', 'text', array (
79
+ 'name' => 'manager_name',
80
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Manager Name' ),
81
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Manager Name' ),
82
+ 'required' => true
83
+ ) );
84
+ $fieldset->addField ( 'manager_email', 'text', array (
85
+ 'name' => 'manager_email',
86
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Manager Email' ),
87
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Manager Email' ),
88
+ 'required' => true
89
+ ) );
90
+
91
+ $form->setValues ( $model->getData () );
92
+ return parent::_prepareForm ();
93
+ }
94
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Tab/Form.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores->Edit Store->General Infromation Tab
7
+ *
8
+ */
9
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {
10
+ protected function _prepareForm() {
11
+ $form = new Varien_Data_Form ();
12
+ $this->setForm ( $form );
13
+ $fieldset = $form->addFieldset ( 'info_form', array (
14
+ 'legend' => Mage::helper ( 'storeshipper' )->__ ( 'Store Information' )
15
+ ) );
16
+
17
+ if (Mage::registry ( 'storeshipper' )->_data ["id"] != NULL) {
18
+ $model = Mage::getModel ( 'storeshipper/stores' )->load ( Mage::registry ( 'storeshipper' )->getId () );
19
+ } else {
20
+ $model = Mage::getModel ( 'storeshipper/stores' );
21
+ }
22
+
23
+
24
+ if ($model->getId ()) {
25
+ $fieldset->addField ( 'id', 'hidden', array (
26
+ 'name' => 'id'
27
+ ) );
28
+ }
29
+
30
+ $fieldset->addField ( 'name', 'text', array (
31
+ 'name' => 'name',
32
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Name' ),
33
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Name' ),
34
+ 'required' => true
35
+ ) );
36
+ $fieldset->addField ( 'status', 'select', array (
37
+ 'name' => 'status',
38
+ 'label' => $this->__ ( 'Enable' ),
39
+ 'values' => Mage::getModel ( 'adminhtml/system_config_source_yesno' )->toOptionArray ()
40
+ ) );
41
+
42
+ // $fieldset->addField ( 'shipping_price', 'text', array (
43
+ // 'name' => 'shipping_price',
44
+ // 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Shipping Price' ),
45
+ // 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Shipping Price' ),
46
+ // 'required' => true
47
+ // ) );
48
+
49
+ // Get All Storeviews
50
+ $storess=array();
51
+ array_push($storess, array('value' => -1 , 'label' => 'Show in all stores'));
52
+ foreach (Mage::app()->getWebsites() as $website) {
53
+ foreach ($website->getGroups() as $group) {
54
+ $stores = $group->getStores();
55
+ foreach ($stores as $store) {
56
+ array_push($storess, array('value' => $store->getId() , 'label' => $store->getName()));
57
+ }
58
+ }
59
+ }
60
+ // Get All Countries
61
+ $pays=array();
62
+ array_push($pays, array('value' => '' , 'label' => ''));
63
+
64
+ $_countries = Mage::getResourceModel('directory/country_collection')
65
+ ->loadData()->toOptionArray(false);
66
+ foreach($_countries as $_country){
67
+ array_push($pays, array('value' => $_country['label'] , 'label' => $_country['label']));
68
+ }
69
+
70
+ $fieldset->addField ( 'available_at_storeview', 'select', array (
71
+ 'name' => 'available_at_storeview',
72
+ 'label' => $this->__ ( 'Show in Storeview' ),
73
+ 'values' => $storess
74
+ ) );
75
+
76
+ $fieldset->addField ( 'adress', 'textarea', array (
77
+ 'name' => 'adress',
78
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Adress' ),
79
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Adress' ),
80
+ 'required' => true
81
+ ) );
82
+
83
+ $fieldset->addField('country', 'select', array(
84
+ 'name' => 'country',
85
+ 'label' => 'Country',
86
+ 'required' => true,
87
+ 'values' => Mage::getModel('adminhtml/system_config_source_country')->toOptionArray(),
88
+ ));
89
+ $fieldset->addField ( 'state', 'text', array (
90
+ 'name' => 'state',
91
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'State' ),
92
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'State' ),
93
+ 'required' => true
94
+ ) );
95
+ $fieldset->addField ( 'city', 'text', array (
96
+ 'name' => 'city',
97
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'City' ),
98
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'City' ),
99
+ 'required' => true
100
+ ) );
101
+
102
+ $fieldset->addField ( 'zipcode', 'text', array (
103
+ 'name' => 'zipcode',
104
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Zip code' ),
105
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Zip code' ),
106
+ 'required' => true
107
+ ) );
108
+
109
+ $form->setValues ( $model->getData () );
110
+
111
+ return parent::_prepareForm ();
112
+ }
113
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Tab/Geo.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores->Edit Store->Geolocation Tab
7
+ *
8
+ */
9
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_Tab_Geo extends Mage_Adminhtml_Block_Widget_Form {
10
+ protected function _prepareForm() {
11
+ $form = new Varien_Data_Form ();
12
+ $this->setForm ( $form );
13
+ $fieldset = $form->addFieldset ( 'geo_form', array (
14
+ 'legend' => Mage::helper ( 'storeshipper' )->__ ( 'Geolocation' )
15
+ ) );
16
+
17
+ $model = Mage::registry ( 'storeshipper' );
18
+
19
+ if (! $model) {
20
+ $model = Mage::getModel ( 'storeshipper/stores' );
21
+ }
22
+ if ($model->getId ()) {
23
+ $fieldset->addField ( 'id', 'hidden', array (
24
+ 'name' => 'id'
25
+ ) );
26
+ }
27
+
28
+ $fieldset->addField ( 'latitude', 'text', array (
29
+ 'name' => 'latitude',
30
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Latitude' ),
31
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Latitude' ),
32
+ 'required' => true
33
+ ) );
34
+ $fieldset->addField ( 'longitude', 'text', array (
35
+ 'name' => 'longitude',
36
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Longitude' ),
37
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Longitude' ),
38
+ 'required' => true
39
+ ) );
40
+ $customField = $fieldset->addField('test', 'text', array( 'label' => Mage::helper('storeshipper')->__('Map'), 'name' => 'map', ));
41
+ $customField->setRenderer($this->getLayout()->createBlock('storeshipper/adminhtml_stores_edit_map'));
42
+ $form->setValues ( $model->getData () );
43
+
44
+ return parent::_prepareForm ();
45
+ }
46
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Tab/Grid.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores->Edit Store->Related Orders Tab
7
+ *
8
+ */
9
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_Tab_Grid extends Mage_Adminhtml_Block_Widget_Grid
10
+ {
11
+ public function __construct()
12
+ {
13
+
14
+ parent::__construct();
15
+ $this->setId('storesGrid');
16
+ $this->setDefaultSort('id');
17
+ $this->setDefaultDir('DESC');
18
+ $this->setSaveParametersInSession(true);
19
+ Mage::helper("storeshipper")->getOrderClientName(1);
20
+ }
21
+ protected function _prepareCollection()
22
+ {
23
+ $collection = Mage::getModel('storeshipper/orders')->getCollection();
24
+ if($this->getRequest()->getParam('id')){
25
+ $collection->addFilter('id_store', $this->getRequest()->getParam('id'));
26
+ }else{
27
+ $collection->addFilter('id_store', null);
28
+ }
29
+
30
+
31
+ $this->setCollection($collection);
32
+
33
+ return parent::_prepareCollection();
34
+ }
35
+ protected function _prepareColumns()
36
+ {
37
+ $this->addColumn('id',
38
+ array(
39
+ 'header' => 'ID',
40
+ 'align' =>'right',
41
+ 'width' => '50px',
42
+ 'index' => 'id',
43
+ ));
44
+ $this->addColumn('id_order',
45
+ array(
46
+ 'header' => 'Order',
47
+ 'align' =>'left',
48
+ 'index' => 'id_order',
49
+ ));
50
+
51
+ $this->addColumn('pickup_date',
52
+ array(
53
+ 'header' => 'Ordered in',
54
+ 'align' =>'left',
55
+ 'index' => 'pickup_date',
56
+ ));
57
+
58
+ $this->addColumn('customer_name',
59
+ array(
60
+ 'header' => 'customer_name',
61
+ 'align' =>'left',
62
+ 'renderer' => 'Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_Html',
63
+ ));
64
+
65
+ $this->addExportType('*/*/exportCsv', Mage::helper('storeshipper')->__('CSV'));
66
+ $this->addExportType('*/*/exportXml', Mage::helper('storeshipper')->__('XML'));
67
+ return parent::_prepareColumns();
68
+ }
69
+ public function getRowUrl($row)
70
+ {
71
+ // This is where our row data will link to
72
+ // if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
73
+ // return $this->getUrl('*/sales_order/view', array('order_id' => $row->getIdOrder()),array("admin"=>true));
74
+ // }
75
+ return Mage::helper("adminhtml")->getUrl("adminhtml/sales_order/view/", array('order_id' => $row->getIdOrder()));;
76
+ }
77
+
78
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Tab/Orders.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores->Edit Store->Related Orders Tab
7
+ *
8
+ */
9
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_Tab_Orders extends Mage_Adminhtml_Block_Widget_Form {
10
+ protected function _prepareForm() {
11
+ $form = new Varien_Data_Form ();
12
+ $this->setForm ( $form );
13
+ $fieldset = $form->addFieldset ( 'orders_form', array (
14
+ 'legend' => Mage::helper ( 'storeshipper' )->__ ( 'Related Orders' )
15
+ ) );
16
+
17
+ $model = Mage::registry ( 'storeshipper' );
18
+
19
+ if (! $model) {
20
+ $model = Mage::getModel ( 'storeshipper/stores' );
21
+ }
22
+ if ($model->getId ()) {
23
+ $fieldset->addField ( 'id', 'hidden', array (
24
+ 'name' => 'id'
25
+ ) );
26
+ }
27
+
28
+ $fieldset->addField ( 'orders', 'text', array (
29
+ 'name' => 'orders',
30
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'orders' ),
31
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'orders' ),
32
+ 'required' => true
33
+ ) );
34
+
35
+
36
+ $form->setValues ( $model->getData () );
37
+ return parent::_prepareForm ();
38
+ }
39
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Tab/Schedule.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores->Edit Store->Schedule Tab
7
+ *
8
+ */
9
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_Tab_Schedule extends Mage_Adminhtml_Block_Widget_Form {
10
+ protected function _prepareForm() {
11
+ $form = new Varien_Data_Form ();
12
+ $this->setForm ( $form );
13
+ $fieldset = $form->addFieldset ( 'schedule_form', array (
14
+ 'legend' => Mage::helper ( 'storeshipper' )->__ ( 'Holidays' )
15
+ ) );
16
+
17
+
18
+ $model = Mage::registry ( 'storeshipper' );
19
+ if (! $model) {
20
+ $model = Mage::getModel ( 'storeshipper/stores' );
21
+ }
22
+ if ($model->getId ()) {
23
+ $fieldset->addField ( 'id', 'hidden', array (
24
+ 'name' => 'id'
25
+ ) );
26
+ }
27
+
28
+ $fieldset->addField ( 'description', 'textarea', array (
29
+ 'name' => 'description',
30
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Holidays' ),
31
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Holidays' ),
32
+ 'required' => false
33
+ ) );
34
+ $fieldset = $form->addFieldset ( 'schedule_monday', array (
35
+ 'legend' => Mage::helper ( 'storeshipper' )->__ ( 'Monday' )
36
+ ) );
37
+ $fieldset->addField ( 'monday_open', 'text', array (
38
+ 'name' => 'monday_open',
39
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Opening' ),
40
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Opening' ),
41
+ 'required' => false
42
+ ) );
43
+ $fieldset->addField ( 'monday_close', 'text', array (
44
+ 'name' => 'monday_close',
45
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Closing' ),
46
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Closing' ),
47
+ 'required' => false
48
+ ) );
49
+
50
+ $fieldset = $form->addFieldset ( 'tuesday', array (
51
+ 'legend' => Mage::helper ( 'storeshipper' )->__ ( 'Tuesday' )
52
+ ) );
53
+ $fieldset->addField ( 'tuesday_open', 'text', array (
54
+ 'name' => 'tuesday_open',
55
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Opening' ),
56
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Opening' ),
57
+ 'required' => false
58
+ ) );
59
+ $fieldset->addField ( 'tuesday_close', 'text', array (
60
+ 'name' => 'tuesday_close',
61
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Closing' ),
62
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Closing' ),
63
+ 'required' => false
64
+ ) );
65
+
66
+ $fieldset = $form->addFieldset ( 'wednesday', array (
67
+ 'legend' => Mage::helper ( 'storeshipper' )->__ ( 'Wednesday' )
68
+ ) );
69
+ $fieldset->addField ( 'wednesday_open', 'text', array (
70
+ 'name' => 'wednesday_open',
71
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Opening' ),
72
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Opening' ),
73
+ 'required' => false
74
+ ) );
75
+ $fieldset->addField ( 'wednesday_close', 'text', array (
76
+ 'name' => 'wednesday_close',
77
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Closing' ),
78
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Closing' ),
79
+ 'required' => false
80
+ ) );
81
+
82
+ $fieldset = $form->addFieldset ( 'thursday', array (
83
+ 'legend' => Mage::helper ( 'storeshipper' )->__ ( 'Thursday' )
84
+ ) );
85
+ $fieldset->addField ( 'thursday_open', 'text', array (
86
+ 'name' => 'thursday_open',
87
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Opening' ),
88
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Opening' ),
89
+ 'required' => false
90
+ ) );
91
+ $fieldset->addField ( 'thursday_close', 'text', array (
92
+ 'name' => 'thursday_close',
93
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Closing' ),
94
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Closing' ),
95
+ 'required' => false
96
+ ) );
97
+
98
+ $fieldset = $form->addFieldset ( 'friday', array (
99
+ 'legend' => Mage::helper ( 'storeshipper' )->__ ( 'Friday' )
100
+ ) );
101
+ $fieldset->addField ( 'friday_open', 'text', array (
102
+ 'name' => 'friday_open',
103
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Opening' ),
104
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Opening' ),
105
+ 'required' => false
106
+ ) );
107
+ $fieldset->addField ( 'friday_close', 'text', array (
108
+ 'name' => 'friday_close',
109
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Closing' ),
110
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Closing' ),
111
+ 'required' => false
112
+ ) );
113
+
114
+ $fieldset = $form->addFieldset ( 'saturday', array (
115
+ 'legend' => Mage::helper ( 'storeshipper' )->__ ( 'Saturday' )
116
+ ) );
117
+ $fieldset->addField ( 'saturday_open', 'text', array (
118
+ 'name' => 'saturday_open',
119
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Opening' ),
120
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Opening' ),
121
+ 'required' => false
122
+ ) );
123
+ $fieldset->addField ( 'saturday_close', 'text', array (
124
+ 'name' => 'saturday_close',
125
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Closing' ),
126
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Closing' ),
127
+ 'required' => false
128
+ ) );
129
+
130
+
131
+ $fieldset = $form->addFieldset ( 'sunday', array (
132
+ 'legend' => Mage::helper ( 'storeshipper' )->__ ( 'Sunday' )
133
+ ) );
134
+ $fieldset->addField ( 'sunday_open', 'text', array (
135
+ 'name' => 'sunday_open',
136
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Opening' ),
137
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Opening' ),
138
+ 'required' => false
139
+ ) );
140
+
141
+ $fieldset->addField ( 'sunday_close', 'text', array (
142
+ 'name' => 'sunday_close',
143
+ 'label' => Mage::helper ( 'storeshipper' )->__ ( 'Closing' ),
144
+ 'title' => Mage::helper ( 'storeshipper' )->__ ( 'Closing' ),
145
+ 'required' => false
146
+ ) );
147
+
148
+ $form->setValues ( $model->getData () );
149
+ return parent::_prepareForm ();
150
+ }
151
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Edit/Tabs.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores->Edit Store
7
+ * Comments : Main Tabs Container
8
+ */
9
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
10
+ {
11
+
12
+ public function __construct()
13
+ {
14
+
15
+ parent::__construct();
16
+ $this->setId('form_tabs');
17
+ $this->setDestElementId('edit_form');
18
+ $this->setTitle(Mage::helper('storeshipper')->__('Store Information'));
19
+
20
+ }
21
+
22
+ protected function _beforeToHtml()
23
+ {
24
+
25
+ $this->addTab('form_section', array(
26
+ 'label' => Mage::helper('storeshipper')->__('General Information'),
27
+ 'title' => Mage::helper('storeshipper')->__('General Information'),
28
+ 'content' => $this->getLayout()->createBlock('storeshipper/adminhtml_stores_edit_tab_form')->toHtml(),
29
+ ));
30
+ $this->addTab('contact_section', array(
31
+ 'label' => Mage::helper('storeshipper')->__('Contact Information'),
32
+ 'title' => Mage::helper('storeshipper')->__('Contact Information'),
33
+ 'content' => $this->getLayout()->createBlock('storeshipper/adminhtml_stores_edit_tab_contact')->toHtml(),
34
+ ));
35
+ $this->addTab('geo_section', array(
36
+ 'label' => Mage::helper('storeshipper')->__('Geolocation'),
37
+ 'title' => Mage::helper('storeshipper')->__('Geolocation'),
38
+ 'content' => $this->getLayout()->createBlock('storeshipper/adminhtml_stores_edit_tab_geo')->toHtml(),
39
+ ));
40
+ $this->addTab('schedule_section', array(
41
+ 'label' => Mage::helper('storeshipper')->__('Schedule'),
42
+ 'title' => Mage::helper('storeshipper')->__('Schedule'),
43
+ 'content' => $this->getLayout()->createBlock('storeshipper/adminhtml_stores_edit_tab_schedule')->toHtml(),
44
+ ));
45
+ $this->addTab('orders_section', array(
46
+ 'label' => Mage::helper('storeshipper')->__('Related Orders'),
47
+ 'title' => Mage::helper('storeshipper')->__('Related Orders'),
48
+ 'content' => $this->getLayout()->createBlock('storeshipper/adminhtml_stores_edit_tab_grid')->toHtml(),
49
+ ));
50
+
51
+ return parent::_beforeToHtml();
52
+ }
53
+ }
app/code/community/Proxymit/StoreShipper/Block/Adminhtml/Stores/Grid.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml Block
6
+ * Location : StoreShipper->Manage Stores
7
+ *
8
+ */
9
+ class Proxymit_StoreShipper_Block_Adminhtml_Stores_Grid extends Mage_Adminhtml_Block_Widget_Grid
10
+ {
11
+ public function __construct()
12
+ {
13
+
14
+ parent::__construct();
15
+ $this->setId('storesGrid');
16
+ $this->setDefaultSort('id');
17
+ $this->setDefaultDir('DESC');
18
+ $this->setSaveParametersInSession(true);
19
+ }
20
+ protected function _prepareCollection()
21
+ {
22
+ $collection = Mage::getModel('storeshipper/stores')->getCollection();
23
+ $this->setCollection($collection);
24
+ return parent::_prepareCollection();
25
+ }
26
+ protected function _prepareColumns()
27
+ {
28
+ $this->addColumn('id',
29
+ array(
30
+ 'header' => 'ID',
31
+ 'align' =>'right',
32
+ 'width' => '50px',
33
+ 'index' => 'id',
34
+ ));
35
+ $this->addColumn('name',
36
+ array(
37
+ 'header' => 'name',
38
+ 'align' =>'left',
39
+ 'index' => 'name',
40
+ ));
41
+ $this->addColumn('status',
42
+ array(
43
+ 'header' => 'Status',
44
+ 'align' =>'left',
45
+ 'index' => 'status',
46
+ ));
47
+ $this->addColumn('shipping_price',
48
+ array(
49
+ 'header' => 'Shipping Price',
50
+ 'align' =>'left',
51
+ 'index' => 'shipping_price',
52
+ ));
53
+ $this->addColumn('adress',
54
+ array(
55
+ 'header' => 'Adress',
56
+ 'align' =>'left',
57
+ 'index' => 'adress',
58
+ ));
59
+ $this->addColumn('zipcode',
60
+ array(
61
+ 'header' => 'Zip Code',
62
+ 'align' =>'left',
63
+ 'index' => 'zipcode',
64
+ ));
65
+ $this->addColumn('city',
66
+ array(
67
+ 'header' => 'City',
68
+ 'align' =>'left',
69
+ 'index' => 'city',
70
+ ));
71
+ $this->addColumn('state',
72
+ array(
73
+ 'header' => 'State',
74
+ 'align' =>'left',
75
+ 'index' => 'state',
76
+ ));
77
+ $this->addColumn('country',
78
+ array(
79
+ 'header' => 'Country',
80
+ 'align' =>'left',
81
+ 'index' => 'country',
82
+ 'renderer' => 'Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_Country'
83
+ ));
84
+ $this->addColumn('available_at_storeview',
85
+ array(
86
+ 'header' => 'Available at storeview',
87
+ 'align' =>'left',
88
+ 'index' => 'available_at_storeview',
89
+ 'renderer' => 'Proxymit_StoreShipper_Block_Adminhtml_Stores_Edit_StoreViewColumn'
90
+ ));
91
+
92
+ $this->addExportType('*/*/exportCsv', Mage::helper('storeshipper')->__('CSV'));
93
+ $this->addExportType('*/*/exportXml', Mage::helper('storeshipper')->__('XML'));
94
+ return parent::_prepareColumns();
95
+ }
96
+ public function getRowUrl($row)
97
+ {
98
+ // This is where our row data will link to
99
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
100
+ }
101
+
102
+
103
+ }
app/code/community/Proxymit/StoreShipper/Block/OurStores.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Frontend Block
6
+ * Location : Our Stores
7
+ *
8
+ */
9
+ class Proxymit_StoreShipper_Block_OurStores extends Mage_Core_Block_Template {
10
+ /**
11
+ * Get All Stores
12
+ * return collection of stores
13
+ */
14
+
15
+ // Show only available in Storeview
16
+ public function filterStores($data){
17
+ $res = array();
18
+ foreach ( $data as $st ){
19
+ if(($st['status'] == 1 )&&($st['available_at_storeview'] == -1 || $st['available_at_storeview'] == Mage::app()->getStore()->getStoreId())){
20
+ array_push($res,$st);
21
+ }
22
+ }
23
+ return $res;
24
+ }
25
+ public function getAllStores() {
26
+ $collection = Mage::getModel ( 'storeshipper/stores' )->getCollection ();
27
+ $data=$collection->getData ();
28
+ return $this->filterStores($data);
29
+ }
30
+ /**
31
+ * Get Store name by ID
32
+ * return string
33
+ */
34
+ public function getStoreName($idStore = '0') {
35
+ $str = '';
36
+ return $idStore;
37
+ }
38
+
39
+ /**
40
+ * Get Stores collection by Country, state, city, zipcode
41
+ * return string
42
+ */
43
+ public function findStores($country = '', $state = '', $city = '', $zip = '') {
44
+ $collection = Mage::getModel ( 'storeshipper/stores' )->getCollection ();
45
+ $collection->addFieldToFilter ( 'country', array (
46
+ 'like' => array ("%".$country."%")
47
+ ) );
48
+ return $collection->getData ();
49
+ }
50
+ }
app/code/community/Proxymit/StoreShipper/Block/Sales/Order/Details.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Sales
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Sales order details block
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Sales
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+
35
+ class Mage_Sales_Block_Order_Details extends Mage_Core_Block_Template
36
+ {
37
+
38
+ public function __construct()
39
+ {
40
+ parent::__construct();
41
+ $this->setTemplate('storeshipper/sales/order/details.phtml');
42
+ $this->setOrder(Mage::getModel('sales/order')->load($this->getRequest()->getParam('order_id')));
43
+ Mage::registry('action')->getLayout()->getBlock('root')->setHeaderTitle(Mage::helper('sales')->__('Order Details'));
44
+ }
45
+
46
+ public function getBackUrl()
47
+ {
48
+ return Mage::getUrl('*/*/history');
49
+ }
50
+
51
+ public function getInvoices()
52
+ {
53
+ $invoices = Mage::getResourceModel('sales/invoice_collection')->setOrderFilter($this->getOrder()->getId())->load();
54
+ return $invoices;
55
+ }
56
+
57
+ public function getPrintUrl()
58
+ {
59
+ return Mage::getUrl('*/*/print');
60
+ }
61
+
62
+ }
app/code/community/Proxymit/StoreShipper/Block/Sales/Order/Info.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Sales
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ /**
29
+ * Invoice view comments form
30
+ *
31
+ * @category Mage
32
+ * @package Mage_Sales
33
+ * @author Magento Core Team <core@magentocommerce.com>
34
+ */
35
+ class Proxymit_StoreShipper_Block_Sales_Order_Info extends Mage_Core_Block_Template
36
+ {
37
+ protected $_links = array();
38
+
39
+ protected function _construct()
40
+ {
41
+ parent::_construct();
42
+ $this->setTemplate('storeshipper/sales/order/info.phtml');
43
+ }
44
+
45
+ protected function _prepareLayout()
46
+ {
47
+ if ($headBlock = $this->getLayout()->getBlock('head')) {
48
+ $headBlock->setTitle($this->__('Order # %s', $this->getOrder()->getRealOrderId()));
49
+ }
50
+ $this->setChild(
51
+ 'payment_info',
52
+ $this->helper('payment')->getInfoBlock($this->getOrder()->getPayment())
53
+ );
54
+ }
55
+
56
+ public function getPaymentInfoHtml()
57
+ {
58
+ return $this->getChildHtml('payment_info');
59
+ }
60
+
61
+ /**
62
+ * Retrieve current order model instance
63
+ *
64
+ * @return Mage_Sales_Model_Order
65
+ */
66
+ public function getOrder()
67
+ {
68
+ return Mage::registry('current_order');
69
+ }
70
+
71
+ public function addLink($name, $path, $label)
72
+ {
73
+ $this->_links[$name] = new Varien_Object(array(
74
+ 'name' => $name,
75
+ 'label' => $label,
76
+ 'url' => empty($path) ? '' : Mage::getUrl($path, array('order_id' => $this->getOrder()->getId()))
77
+ ));
78
+ return $this;
79
+ }
80
+
81
+ public function getLinks()
82
+ {
83
+ $this->checkLinks();
84
+ return $this->_links;
85
+ }
86
+
87
+ private function checkLinks()
88
+ {
89
+ $order = $this->getOrder();
90
+ if (!$order->hasInvoices()) {
91
+ unset($this->_links['invoice']);
92
+ }
93
+ if (!$order->hasShipments()) {
94
+ unset($this->_links['shipment']);
95
+ }
96
+ if (!$order->hasCreditmemos()) {
97
+ unset($this->_links['creditmemo']);
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Get url for reorder action
103
+ *
104
+ * @deprecated after 1.6.0.0, logic moved to new block
105
+ * @param Mage_Sales_Order $order
106
+ * @return string
107
+ */
108
+ public function getReorderUrl($order)
109
+ {
110
+ if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
111
+ return $this->getUrl('sales/guest/reorder', array('order_id' => $order->getId()));
112
+ }
113
+ return $this->getUrl('sales/order/reorder', array('order_id' => $order->getId()));
114
+ }
115
+
116
+ /**
117
+ * Get url for printing order
118
+ *
119
+ * @deprecated after 1.6.0.0, logic moved to new block
120
+ * @param Mage_Sales_Order $order
121
+ * @return string
122
+ */
123
+ public function getPrintUrl($order)
124
+ {
125
+ if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
126
+ return $this->getUrl('sales/guest/print', array('order_id' => $order->getId()));
127
+ }
128
+ return $this->getUrl('sales/order/print', array('order_id' => $order->getId()));
129
+ }
130
+
131
+ }
app/code/community/Proxymit/StoreShipper/Helper/Data.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Proxymit_StoreShipper_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ public function getOrderClientName($id_order){
6
+ $order = Mage::getModel('sales/order')->load($id_order);
7
+ $custname = $order->getCustomerName();
8
+ return $custname;
9
+ }
10
+ public function getStoreViewName($available){
11
+ if($available != "-1"){
12
+ $store = Mage::getModel('core/store')->load($available)->getName();
13
+ }else {
14
+ $store = "Show in all stores";
15
+ }
16
+ return $store;
17
+ }
18
+ public function getOrderMethod($id_order){
19
+ $order = Mage::getModel('sales/order')->load($id_order);
20
+ $carr = $order->getShippingCarrier()->getCarrierCode();
21
+ return $carr;
22
+ }
23
+ public function getCountryName($id){
24
+ $country_name=Mage::app()->getLocale()->getCountryTranslation($id);
25
+ return $country_name;
26
+ }
27
+
28
+
29
+
30
+ /// GENERATE CSV
31
+
32
+ protected $_list = null;
33
+
34
+ public function __construct()
35
+ {
36
+ $collection = Mage::getModel('storeshipper/stores')->getCollection();
37
+
38
+ $this->setList($collection);
39
+ }
40
+
41
+ /**
42
+ * Sets current collection
43
+ * @param $query
44
+ */
45
+ public function setList($collection)
46
+ {
47
+ $this->_list = $collection;
48
+ }
49
+
50
+ /**
51
+ * Returns indexes of the fetched array as headers for CSV
52
+ * @param array $products
53
+ * @return array
54
+ */
55
+ protected function _getCsvHeaders($products)
56
+ {
57
+ $product = current($products);
58
+ $headers = array_keys($product->getData());
59
+
60
+ return $headers;
61
+ }
62
+
63
+ /**
64
+ * Generates CSV file with product's list according to the collection in the $this->_list
65
+ * @return array
66
+ */
67
+ public function generateMlnList()
68
+ {
69
+ if (!is_null($this->_list)) {
70
+ $items = $this->_list->getItems();
71
+ if (count($items) > 0) {
72
+
73
+ $io = new Varien_Io_File();
74
+ $path = Mage::getBaseDir('var') . DS . 'export' . DS;
75
+ $name = md5(microtime());
76
+ $file = $path . DS . $name . '.csv';
77
+ $io->setAllowCreateFolders(true);
78
+ $io->open(array('path' => $path));
79
+ $io->streamOpen($file, 'w+');
80
+ $io->streamLock(true);
81
+
82
+ $io->streamWriteCsv($this->_getCsvHeaders($items));
83
+ foreach ($items as $product) {
84
+ $io->streamWriteCsv($product->getData());
85
+ }
86
+
87
+ return array(
88
+ 'type' => 'filename',
89
+ 'value' => $file,
90
+ 'rm' => true // can delete file after use
91
+ );
92
+ }
93
+ }
94
+ }
95
+
96
+
97
+
98
+
99
+ }
app/code/community/Proxymit/StoreShipper/Model/Mysql4/Grid.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Proxymit_StoreShipper_Model_Mysql4_Grid extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ $this->_init('storeshipper/stores', 'id');
8
+ }
9
+ public function addGridPosition($collection,$manager_id){
10
+ // $table2 = $this->getMainTable();
11
+ }
12
+ }
app/code/community/Proxymit/StoreShipper/Model/Mysql4/Grid/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Proxymit_StoreShipper_Model_Mysql4_Grid_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('storeshipper/grid');
9
+ }
10
+ }
app/code/community/Proxymit/StoreShipper/Model/Mysql4/Orders.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Proxymit_StoreShipper_Model_Mysql4_Orders extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ $this->_init('storeshipper/orders', 'id');
8
+ }
9
+ }
app/code/community/Proxymit/StoreShipper/Model/Mysql4/Orders/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Proxymit_StoreShipper_Model_Mysql4_Orders_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('storeshipper/orders');
9
+ }
10
+ }
app/code/community/Proxymit/StoreShipper/Model/Mysql4/Pickup/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Proxymit_StoreShipper_Model_Mysql4_Pickup_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('pickup/pickup');
9
+ }
10
+ }
app/code/community/Proxymit/StoreShipper/Model/Mysql4/Schedule.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Proxymit_StoreShipper_Model_Mysql4_Schedule extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ $this->_init('storeshipper/schedule', 'id');
8
+ }
9
+ }
app/code/community/Proxymit/StoreShipper/Model/Mysql4/Schedule/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Proxymit_StoreShipper_Model_Mysql4_Schedule_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('storeshipper/schedule');
9
+ }
10
+ }
app/code/community/Proxymit/StoreShipper/Model/Mysql4/Stores.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Proxymit_StoreShipper_Model_Mysql4_Stores extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ $this->_init('storeshipper/stores', 'id');
8
+ }
9
+ }
app/code/community/Proxymit/StoreShipper/Model/Mysql4/Stores/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Proxymit_StoreShipper_Model_Mysql4_Stores_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('storeshipper/stores');
9
+ }
10
+ }
app/code/community/Proxymit/StoreShipper/Model/Orders.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Proxymit_StoreShipper_Model_Orders extends Mage_Core_Model_Abstract
3
+ {
4
+
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('storeshipper/orders');
9
+ }
10
+
11
+ }
app/code/community/Proxymit/StoreShipper/Model/Schedule.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Proxymit_StoreShipper_Model_Schedule extends Mage_Core_Model_Abstract
3
+ {
4
+
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('storeshipper/schedule');
9
+ }
10
+
11
+ }
app/code/community/Proxymit/StoreShipper/Model/Stores.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Proxymit_StoreShipper_Model_Stores extends Mage_Core_Model_Abstract
3
+ {
4
+
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('storeshipper/stores');
9
+ }
10
+
11
+ }
app/code/community/Proxymit/StoreShipper/controllers/Adminhtml/IndexController.php ADDED
@@ -0,0 +1,522 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ * Adminhtml_IndexController
6
+ *
7
+ */
8
+ class Proxymit_StoreShipper_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action
9
+ {
10
+ /**
11
+ * Init Action
12
+ */
13
+ protected function _initAction()
14
+ {
15
+ $this->loadLayout()->_setActiveMenu('storeshipper/stores')
16
+ ->_addBreadcrumb('Store Manager','test Manager');
17
+
18
+ return $this;
19
+ }
20
+ /**
21
+ * Index Action
22
+ */
23
+ public function indexAction()
24
+ {
25
+ $this->_initAction();
26
+ $this->renderLayout();
27
+
28
+ }
29
+ /**
30
+ * Add New Store Action
31
+ */
32
+ public function newAction()
33
+ {
34
+ $this->loadLayout();
35
+ $this->_addContent($this->getLayout()->createBlock('storeshipper/adminhtml_stores_edit'))
36
+ ->_addLeft($this->getLayout()->createBlock('storeshipper/adminhtml_stores_edit_tabs'));
37
+ $this->renderLayout();
38
+
39
+ //$this->_forward('edit');
40
+ }
41
+ /**
42
+ * Edit Store Action
43
+ */
44
+ public function editAction()
45
+ {
46
+ $this->_initAction();
47
+
48
+ // Get id if available
49
+ $id = $this->getRequest()->getParam('id');
50
+ $model = Mage::getModel('storeshipper/stores');
51
+
52
+ if ($id) {
53
+ // Load record
54
+ $model->load($id);
55
+
56
+ // Check if record is loaded
57
+ if (!$model->getId()) {
58
+ Mage::getSingleton('adminhtml/session')->addError($this->__('This store no longer exists.'));
59
+ $this->_redirect('*/*/');
60
+
61
+ return;
62
+ }else{
63
+
64
+ }
65
+ }
66
+
67
+ $this->_title($model->getId() ? $model->getName() : $this->__('New Store'));
68
+
69
+ $data = Mage::getSingleton('adminhtml/session')->getBazData(true);
70
+ if (!empty($data)) {
71
+ $model->setData($data);
72
+ }
73
+
74
+ Mage::register('storeshipper', $model);
75
+
76
+ $this->_initAction()
77
+ ->_addContent($this->getLayout()->createBlock('storeshipper/adminhtml_stores_edit')->setData('action', $this->getUrl('*/*/save')))
78
+ ->_addLeft($this->getLayout()->createBlock('storeshipper/adminhtml_stores_edit_tabs'))
79
+ ->renderLayout();
80
+ }
81
+
82
+ /**
83
+ * Delete Store Action
84
+ */
85
+ public function deleteAction() {
86
+ if( $this->getRequest()->getParam('id') > 0 ) {
87
+ try {
88
+ $model = Mage::getModel('storeshipper/stores');
89
+
90
+ $model->setId($this->getRequest()->getParam('id'))
91
+ ->delete();
92
+
93
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
94
+ $this->_redirect('*/*/');
95
+ } catch (Exception $e) {
96
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
97
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
98
+ }
99
+ }
100
+ $this->_redirect('*/*/');
101
+ }
102
+
103
+ /**
104
+ * Save Store Action
105
+ */
106
+ public function saveAction()
107
+ {
108
+ if ($postData = $this->getRequest()->getPost()) {
109
+ $model = Mage::getSingleton('storeshipper/stores');
110
+ // Load Store From ID
111
+ if($this->getRequest()->getParam('id')){
112
+ $model=Mage::getModel("storeshipper/stores")->load($this->getRequest()->getParam('id'));
113
+ }else{
114
+ $model=Mage::getModel("storeshipper/stores");
115
+ }
116
+
117
+
118
+ // Unset ID Store if there is on
119
+ if($this->getRequest()->getParam('id') == null){
120
+ unset($postData["id"]);
121
+ }else{
122
+ $model->setId($this->getRequest()->getParam('id'));
123
+ }
124
+ $model->setData($postData);
125
+ if($this->getRequest()->getParam('id')){
126
+ $model->setId($this->getRequest()->getParam('id'));
127
+ }
128
+ try {
129
+
130
+ $model->save();
131
+
132
+ // Upload Images while Saving Store
133
+ if(isset($_FILES['store_image']['name']) and (file_exists($_FILES['store_image']['tmp_name']))) {
134
+ try {
135
+ $uploader = new Varien_File_Uploader('store_image');
136
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
137
+ $uploader->setAllowRenameFiles(true);
138
+ $uploader->setFilesDispersion(false);
139
+ // Build Path Under media/storeshipper/id_store
140
+ $path = Mage::getBaseDir('media') . DS. 'storeshipper'.DS.$this->getRequest()->getParam('id').DS ;
141
+ $uploader->save($path, $_FILES['store_image']['name']);
142
+ $data['store_image'] = $_FILES['store_image']['name'];
143
+ }catch(Exception $e) {
144
+
145
+ }
146
+ }
147
+ Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The store has been saved.'));
148
+ $this->_redirect('*/*/');
149
+
150
+ return;
151
+ }
152
+ catch (Mage_Core_Exception $e) {
153
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
154
+ }
155
+ catch (Exception $e) {
156
+ Mage::getSingleton('adminhtml/session')->addError($this->__('An error occurred while saving this store.'));
157
+ }
158
+
159
+ Mage::getSingleton('adminhtml/session')->setBazData($postData);
160
+ $this->_redirectReferer();
161
+ }
162
+ }
163
+
164
+ /**
165
+ * Delete image of a store by store ID - Action
166
+ */
167
+ public function deleteImageAction()
168
+ {
169
+ $path = Mage::getBaseDir ( 'media' ) . DS . 'storeshipper' . DS .$this->getRequest()->getParam('id').DS;
170
+ $nm = $this->getRequest()->getParam('imagename');
171
+ unlink($path.$nm);
172
+ $this->_redirect('*/*/edit/id/'.$this->getRequest()->getParam('id').'/');
173
+ }
174
+
175
+ /**
176
+ * Add Image for a store Action
177
+ */
178
+ public function addImageAction()
179
+ {
180
+ $this->_redirect('*/*/edit/id/'.$this->getRequest()->getParam('id').'/');
181
+
182
+ }
183
+
184
+ /**
185
+ * Message content Action
186
+ */
187
+ public function messageAction()
188
+ {
189
+ $data = Mage::getModel('storeshipper/stores')->load($this->getRequest()->getParam('id'));
190
+ echo $data->getContent();
191
+ }
192
+
193
+
194
+ protected function _isAllowed()
195
+ {
196
+ return Mage::getSingleton('admin/session')->isAllowed('storeshipper/stores');
197
+ }
198
+
199
+ /**
200
+ * Import list of stores CSV Action
201
+ */
202
+ public function importCsvAction() {
203
+
204
+ // Import file path
205
+ $fileName = Mage::getBaseDir()."\\stores.csv";
206
+ // delimeter
207
+ $delimiter = ',';
208
+ // enclosure
209
+ $enclosure = '"';
210
+ // init store model
211
+ $model = Mage::getModel('storeshipper/stores');
212
+ // open file on read access
213
+ $file = fopen ( $fileName, "r" );
214
+ if(!$file){
215
+ Mage::getSingleton('adminhtml/session')->addError($this->__('File not found : '.Mage::getBaseUrl().'stores.csv !'));
216
+ $this->_redirect("*/*/", array());
217
+ return;
218
+ }
219
+
220
+ $csvArr=array();
221
+ $i=0;
222
+ while ( ! feof ( $file ) ) {
223
+ $csvArr = fgetcsv ( $file, 0, $delimiter, $enclosure );
224
+ if($i>0){
225
+ $data=array();
226
+ $data["name"]=$csvArr[1];
227
+ $data["status"]=$csvArr[2];
228
+ $data["shipping_price"]=$csvArr[3];
229
+ $data["adress"]=$csvArr[4];
230
+ $data["city"]=$csvArr[5];
231
+ $data["zipcode"]=$csvArr[6];
232
+ $data["country"]=$csvArr[7];
233
+ $data["state"]=$csvArr[8];
234
+ $data["latitude"]=$csvArr[9];
235
+ $data["longitude"]=$csvArr[10];
236
+ $data["description"]=$csvArr[11];
237
+ $data["website"]=$csvArr[12];
238
+ $data["email"]=$csvArr[13];
239
+ $data["phone"]=$csvArr[14];
240
+ $data["fax"]=$csvArr[15];
241
+ $data["manager_name"]=$csvArr[16];
242
+ $data["manager_email"]=$csvArr[17];
243
+ $data["manager_show_frontend"]=$csvArr[18];
244
+ $data["manager_fax"]=$csvArr[19];
245
+ $data["manager_phone"]=$csvArr[20];
246
+ $data["id_schedule"]=NULL;
247
+ $data["available_at_storeview"]=$csvArr[22];
248
+ $data["available_after"]=$csvArr[23];
249
+ $data["monday_open"]=$csvArr[24];
250
+ $data["monday_close"]=$csvArr[25];
251
+ $data["tuesday_open"]=$csvArr[26];
252
+ $data["tuesday_close"]=$csvArr[27];
253
+ $data["wednesday_open"]=$csvArr[28];
254
+ $data["wednesday_close"]=$csvArr[29];
255
+ $data["thursday_open"]=$csvArr[30];
256
+ $data["thursday_close"]=$csvArr[31];
257
+ $data["friday_open"]=$csvArr[32];
258
+ $data["friday_close"]=$csvArr[33];
259
+ $data["saturday_open"]=$csvArr[34];
260
+ $data["saturday_close"]=$csvArr[35];
261
+ $data["sunday_open"]=$csvArr[36];
262
+ $data["sunday_close"]=$csvArr[37];
263
+
264
+ // set model data
265
+ if($data["name"] != NULL){
266
+ $model->setData($data);
267
+ // save line
268
+ $model->save();
269
+ }
270
+
271
+ }
272
+ $i++;
273
+
274
+ }
275
+
276
+ fclose ( $file );
277
+ Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Stores imported successfully '));
278
+ $this->_redirect("*/*/", array());
279
+
280
+ }
281
+
282
+
283
+ /**
284
+ * Export list of stores CSV Action
285
+ */
286
+ public function exportCsvAction()
287
+ {
288
+ // $fileName = 'stores.csv';
289
+ // $content = $this->getLayout()->createBlock('storeshipper/adminhtml_stores_grid')
290
+ // ->getCsv();
291
+ $fileName = 'stores.csv'; //file path of the CSV file in which the data to be saved
292
+
293
+ //$mage_csv = new Varien_File_Csv(); //mage CSV
294
+ $content = Mage::helper('storeshipper')->generateMlnList();
295
+
296
+ $this->_prepareDownloadResponse($fileName, $content);
297
+ }
298
+ /**
299
+ * Export list of stores XML Action
300
+ */
301
+ public function exportXmlAction()
302
+ {
303
+ $fileName = 'stores.xml';
304
+ $content = $this->getLayout()->createBlock('storeshipper/adminhtml_stores_grid')
305
+ ->getXml();
306
+ $this->_prepareDownloadResponse($fileName, $content);
307
+ }
308
+
309
+
310
+ /**
311
+ * Store Manager Email Notification
312
+ */
313
+ public function notifyStoreManagerAction()
314
+ {
315
+ if($this->getRequest()->getParam('order_id')){
316
+ // Retrieve Order ID From redirection
317
+ $order=Mage::getModel('sales/order')->load($this->getRequest()->getParam('order_id'));
318
+
319
+ // Get Store ID
320
+ $storeId = Mage::app()->getStore()->getStoreId();
321
+
322
+ // Get Store Manager Email Adress
323
+ $store_order=Mage::getModel('storeshipper/orders')->getCollection()->addFieldToFilter('id_order',$order->getId() );
324
+ $data=$store_order->getData();
325
+ $store= Mage::getModel('storeshipper/stores')->load($data[0]["id_store"]);
326
+ $email= $store->getManagerEmail();
327
+
328
+ // Retrieve store manager email template id
329
+ $templateId = Mage::getStoreConfig('carriers/pickup/email_manager_template');
330
+ //Zend_Debug::dump($templateId);
331
+ //die();
332
+
333
+ // If default template send email with default template
334
+ if($templateId == "carriers_pickup_email_manager_template"){
335
+
336
+ /**
337
+ * $templateId can be set to numeric or string type value.
338
+ * You can use Id of transactional emails (found in
339
+ * "System->Trasactional Emails"). But better practice is
340
+ * to create a config for this and use xml path to fetch
341
+ * email template info (whatever from file/db).
342
+ */
343
+ //const EMAIL_TEMPLATE_XML_PATH = 'customer/testemail/email_template';
344
+ //$templateId = Mage::getStoreConfig('store');
345
+
346
+ $mailSubject = 'StoreShipper Notification';
347
+
348
+ /**
349
+ * $sender can be of type string or array. You can set identity of
350
+ * diffrent Store emails (like 'support', 'sales', etc.) found
351
+ * in "System->Configuration->General->Store Email Addresses"
352
+ */
353
+ $sender = Array('name' => Mage::getStoreConfig('trans_email/ident_general/name', $storeId),
354
+ 'email' => Mage::getStoreConfig('trans_email/ident_general/email', $storeId));
355
+
356
+ /**
357
+ * If $name = null, then magento will parse the email id
358
+ * and use the base part as name.
359
+ */
360
+ $name = Mage::getStoreConfig('trans_email/ident_general/name', $storeId);
361
+
362
+ $vars = Array();
363
+ /* An example how you can pass magento objects and normal variables*/
364
+
365
+ $vars = Array('order'=>$order);
366
+
367
+ /*This is optional*/
368
+ $storeId = Mage::app()->getStore()->getId();
369
+
370
+ $translate = Mage::getSingleton('core/translate');
371
+ try{
372
+ Mage::getModel('core/email_template')->loadDefault('storeshipper_manager')
373
+ ->setTemplateSubject($mailSubject)
374
+ ->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
375
+ $translate->setTranslateInline(true);
376
+ Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The Store Manager has been notified to '.$email));
377
+ $this->_redirect("adminhtml/sales_order/view", array('order_id'=>$order->getId()));
378
+
379
+ }catch(Exception $e){
380
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Error : Email was not sent !'));
381
+ $this->_redirect("adminhtml/sales_order/view", array('order_id'=>$order->getId()));
382
+ }
383
+ return;
384
+ }
385
+ if($templateId){
386
+ $mailer = Mage::getModel('core/email_template_mailer');
387
+ $emailInfo = Mage::getModel('core/email_info');
388
+ $emailInfo->addTo($email, "Customer Notification");
389
+
390
+ $mailer->addEmailInfo($emailInfo);
391
+ // Set all required params and send emails
392
+ $mailer->setSender(Mage::getStoreConfig('sales_email/shipment/identity', $storeId));
393
+ $mailer->setStoreId($storeId);
394
+ $mailer->setTemplateId($templateId);
395
+
396
+ $mailer->setTemplateParams(array(
397
+ 'order' => $order,
398
+ )
399
+ );
400
+ try {
401
+ // SEND EMAIL
402
+ $mailer->send();
403
+ // Mage::log($mailer);
404
+ Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The Store Manager has been notified to '.$email));
405
+ $this->_redirect("adminhtml/sales_order/view", array('order_id'=>$order->getId()));
406
+ }
407
+ catch (Exception $e) {
408
+ Mage::logException($e);
409
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Invalide Email Template ! Please select a new email template in the Global StoreShipper Config'));
410
+ $this->_redirect("adminhtml/sales_order/view", array('order_id'=>$order->getId()));
411
+ }
412
+ }else{
413
+ Mage::log("Invalide Template");
414
+ }
415
+ }
416
+ }
417
+ /**
418
+ * Client Email Notification
419
+ */
420
+ public function notifyCustomerAction()
421
+ {
422
+ if($this->getRequest()->getParam('order_id')){
423
+ // Retrieve Order ID From redirection
424
+ $order=Mage::getModel('sales/order')->load($this->getRequest()->getParam('order_id'));
425
+ // Get Store ID
426
+ $storeId = Mage::app()->getStore()->getStoreId();
427
+
428
+ // Get Customer Email Adress
429
+ $email = $order->getCustomerEmail();
430
+
431
+ // Retrieve store manager email template id
432
+ $templateId = Mage::getStoreConfig('carriers/pickup/email_customer_template');
433
+ //Zend_Debug::dump($templateId);
434
+ //die();
435
+
436
+ // If default template send email with default template
437
+ if($templateId == "carriers_pickup_email_customer_template"){
438
+
439
+ /**
440
+ * $templateId can be set to numeric or string type value.
441
+ * You can use Id of transactional emails (found in
442
+ * "System->Trasactional Emails"). But better practice is
443
+ * to create a config for this and use xml path to fetch
444
+ * email template info (whatever from file/db).
445
+ */
446
+ //const EMAIL_TEMPLATE_XML_PATH = 'customer/testemail/email_template';
447
+ //$templateId = Mage::getStoreConfig('store');
448
+
449
+ $mailSubject = 'Customer StoreShipper Notification';
450
+
451
+ /**
452
+ * $sender can be of type string or array. You can set identity of
453
+ * diffrent Store emails (like 'support', 'sales', etc.) found
454
+ * in "System->Configuration->General->Store Email Addresses"
455
+ */
456
+ $sender = Array('name' => Mage::getStoreConfig('trans_email/ident_general/name', $storeId),
457
+ 'email' => Mage::getStoreConfig('trans_email/ident_general/email', $storeId));
458
+
459
+ /**
460
+ * If $name = null, then magento will parse the email id
461
+ * and use the base part as name.
462
+ */
463
+ $name = Mage::getStoreConfig('trans_email/ident_general/name', $storeId);
464
+
465
+ $vars = Array();
466
+ /* An example how you can pass magento objects and normal variables*/
467
+
468
+ $vars = Array('order'=>$order);
469
+
470
+ /*This is optional*/
471
+ $storeId = Mage::app()->getStore()->getId();
472
+
473
+ $translate = Mage::getSingleton('core/translate');
474
+ try{
475
+ Mage::getModel('core/email_template')->loadDefault('storeshipper_customer')
476
+ ->setTemplateSubject($mailSubject)
477
+ ->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
478
+ $translate->setTranslateInline(true);
479
+ Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The Customer has been notified to '.$email));
480
+ $this->_redirect("adminhtml/sales_order/view", array('order_id'=>$order->getId()));
481
+
482
+ }catch(Exception $e){
483
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Error : Email was not sent !'));
484
+ $this->_redirect("adminhtml/sales_order/view", array('order_id'=>$order->getId()));
485
+ }
486
+ return;
487
+ }
488
+ if($templateId){
489
+ $mailer = Mage::getModel('core/email_template_mailer');
490
+ $emailInfo = Mage::getModel('core/email_info');
491
+ $emailInfo->addTo($email, "Customer Notification");
492
+
493
+ $mailer->addEmailInfo($emailInfo);
494
+ // Set all required params and send emails
495
+ $mailer->setSender(Mage::getStoreConfig('sales_email/shipment/identity', $storeId));
496
+ $mailer->setStoreId($storeId);
497
+ $mailer->setTemplateId($templateId);
498
+
499
+ $mailer->setTemplateParams(array(
500
+ 'order' => $order,
501
+ )
502
+ );
503
+ try {
504
+ // SEND EMAIL
505
+ $mailer->send();
506
+ // Mage::log($mailer);
507
+ Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The Customer has been notified at '.$email));
508
+ $this->_redirect("adminhtml/sales_order/view", array('order_id'=>$order->getId()));
509
+ }
510
+ catch (Exception $e) {
511
+ Mage::logException($e);
512
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Invalide Email Template ! Please select a new email template in the Global StoreShipper Config'));
513
+ $this->_redirect("adminhtml/sales_order/view", array('order_id'=>$order->getId()));
514
+ }
515
+ }else{
516
+ Mage::log("Invalide Template");
517
+ }
518
+ }
519
+ }
520
+
521
+ }
522
+ ?>
app/code/community/Proxymit/StoreShipper/controllers/IndexController.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Proxymit_StoreShipper_IndexController extends Mage_Core_Controller_Front_Action {
3
+ public function indexAction() {
4
+ $this->loadLayout ();
5
+ $this->renderLayout ();
6
+
7
+
8
+ }
9
+
10
+ // Show only available in Storeview
11
+ public function filterStores($data){
12
+ $res = array();
13
+ foreach ( $data as $st ){
14
+ if(($st['status']==1) && ($st['available_at_storeview'] == -1 || $st['available_at_storeview'] == Mage::app()->getStore()->getStoreId())){
15
+ array_push($res,$st);
16
+ }
17
+ }
18
+ return $res;
19
+ }
20
+
21
+ public function testMethodAction() {
22
+ echo 'test mamethode';
23
+ }
24
+ public function testModelAction() {
25
+ $params = $this->getRequest ()->getParams ();
26
+ $blogpost = Mage::getModel ( 'storeshipper/stores' );
27
+ echo ("Loading the blogpost with an ID of " . $params ['id']);
28
+ $blogpost->load ( $params ['id'] );
29
+ $data = $blogpost->getData ();
30
+ //Zend_Debug::dump ( $data );
31
+ }
32
+
33
+ public function findStores($country = "", $state = "", $city = "", $zip = "") {
34
+ $collection = Mage::getModel ( 'storeshipper/stores' )->getCollection ();
35
+ $collection->addFieldToFilter ( 'country', array (
36
+ 'like' => array (
37
+ "%" . $country . "%"
38
+ )
39
+ ) );
40
+ $collection->addFieldToFilter ( 'state', array (
41
+ 'like' => array (
42
+ "%" . $state . "%"
43
+ )
44
+ ) );
45
+ $collection->addFieldToFilter ( 'city', array (
46
+ 'like' => array (
47
+ "%" . $city . "%"
48
+ )
49
+ ) );
50
+ $collection->addFieldToFilter ( 'zipcode', array (
51
+ 'like' => array (
52
+ "%" . $zip . "%"
53
+ )
54
+ ) );
55
+ return $this->filterStores($collection);
56
+ }
57
+ public function getStoresAction() {
58
+ $params = $this->getRequest ()->getParams ();
59
+ $cntry=$params['country'];
60
+ if($cntry == "All Countries"){
61
+ $cntry="";
62
+ }
63
+ $stores=$this->findStores($cntry,$params['state'],$params['city'],$params['zip']);
64
+ $stores=$this->filterStores($stores);
65
+ ?>
66
+ <div id="stores" style="padding:0px; max-height: 300px; overflow: auto; border: 0px;" class="stores fieldset">
67
+ <h2 class="legend">Stores list</h2>
68
+ <div id="search-result">
69
+ <?php if(count($stores)>0) {?>
70
+ <table class="data-table">
71
+ <tr>
72
+ <th>Store Name</th>
73
+ <?php if (isset($params['search']) && $params['search']!="2"){?><th>Adress</th><?php }?>
74
+ <th>City</th>
75
+ <th>Country</th>
76
+ <th></th>
77
+ </tr>
78
+ <?php
79
+ foreach ( $stores as $store ) {
80
+ ?>
81
+ <tr>
82
+ <td><a
83
+ href="javascript:pointStore(<?php echo $store["latitude"].','.$store["longitude"].','.$store["id"];?>);"><?php echo $store["name"];?></a></td>
84
+ <?php if (isset($params['search']) && $params['search']!="2"){?><td><?php echo $store["adress"];?></td><?php }?>
85
+ <td><?php echo $store["city"];?></td>
86
+ <td><?php echo Mage::helper ( 'storeshipper' )->getCountryName($store["country"]);?></td>
87
+ <td><a target="_new"
88
+ href="javascript:itiniraire('<?php echo $store["latitude"].", ".$store["longitude"];?>')"><img src="http://laviouze.free.fr/images/Map.png" width="30px" /></a></td>
89
+ </tr>
90
+ <?php
91
+ }
92
+ ?>
93
+ </table>
94
+ <?php }else{
95
+ echo "No store available.";
96
+
97
+ }?>
98
+ </div>
99
+ </div>
100
+ <?php
101
+ }
102
+ }
app/code/community/Proxymit/StoreShipper/etc/adminhtml.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <menu>
4
+
5
+ <storeshipper translate="title" module="storeshipper">
6
+ <title>StoreShipper</title>
7
+ <sort_order>100</sort_order>
8
+ <children>
9
+ <stores>
10
+ <title>Manage Stores</title>
11
+ <action>storeshipper/adminhtml_index</action>
12
+ </stores>
13
+ </children>
14
+ </storeshipper>
15
+ </menu>
16
+
17
+ <acl>
18
+ <resources>
19
+ <admin>
20
+ <children>
21
+ <storeshipper translate="title" module="storeshipper">
22
+ <title>StoreShipper</title>
23
+ <sort_order>100</sort_order>
24
+ <children>
25
+ <stores>
26
+ <title>Manage Stores</title>
27
+ <action>storeshipper/adminhtml_index</action>
28
+ </stores>
29
+ </children>
30
+ </storeshipper>
31
+ </children>
32
+ </admin>
33
+ </resources>
34
+ </acl>
35
+ </config>
app/code/community/Proxymit/StoreShipper/etc/config.xml ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Proxymit_StoreShipper>
5
+ <version>1.0.1</version>
6
+ </Proxymit_StoreShipper>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <routeurfrontend>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Proxymit_StoreShipper</module>
14
+ <frontName>stores</frontName>
15
+ </args>
16
+ </routeurfrontend>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <storeshipper>
21
+ <file>storeshipper.xml</file>
22
+ </storeshipper>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <global>
27
+ <models>
28
+ <storeshipper>
29
+ <class>Proxymit_StoreShipper_Model</class>
30
+ <resourceModel>storeshipper_mysql4</resourceModel>
31
+ </storeshipper>
32
+ <storeshipper_mysql4>
33
+ <class>Proxymit_StoreShipper_Model_Mysql4</class>
34
+ <entities>
35
+ <stores>
36
+ <table>storeshipper_store</table>
37
+ </stores>
38
+ <orders>
39
+ <table>storeshipper_order_store</table>
40
+ </orders>
41
+ <!-- <schedule>
42
+ <table>storeshipper_schedule</table>
43
+ </schedule> -->
44
+ </entities>
45
+ </storeshipper_mysql4>
46
+ </models>
47
+ <resources>
48
+ <storeshipper_setup>
49
+ <setup>
50
+ <module>Proxymit_StoreShipper</module>
51
+ </setup>
52
+ <connection>
53
+ <use>core_setup</use>
54
+ </connection>
55
+ </storeshipper_setup>
56
+ <storeshipper_write>
57
+ <connection>
58
+ <use>core_write</use>
59
+ </connection>
60
+ </storeshipper_write>
61
+ <!-- db read connection -->
62
+ <storeshipper_read>
63
+ <connection>
64
+ <use>core_read</use>
65
+ </connection>
66
+ </storeshipper_read>
67
+ </resources>
68
+ <blocks>
69
+ <storeshipper>
70
+ <class>Proxymit_StoreShipper_Block</class>
71
+ </storeshipper>
72
+ <adminhtml>
73
+ <rewrite>
74
+ <sales_order_view>Proxymit_StoreShipper_Block_Adminhtml_Sales_Order_View</sales_order_view>
75
+ </rewrite>
76
+ </adminhtml>
77
+
78
+ <sales>
79
+ <rewrite>
80
+ <order_details>Proxymit_StoreShipper_Block_Sales_Order_Details</order_details>
81
+ <order_info>Proxymit_StoreShipper_Block_Sales_Order_Info</order_info>
82
+ </rewrite>
83
+ </sales>
84
+ </blocks>
85
+ <helpers>
86
+ <storeshipper>
87
+ <class>Proxymit_StoreShipper_Helper</class>
88
+ </storeshipper>
89
+ </helpers>
90
+ <template>
91
+ <email>
92
+ <storeshipper_manager>
93
+ <label>StoreShipper Manager Notification</label>
94
+ <file>sales/storeshipper_manager.html</file>
95
+ <type>html</type>
96
+ </storeshipper_manager>
97
+ <storeshipper_customer>
98
+ <label>StoreShipper Customer Notification</label>
99
+ <file>sales/storeshipper_customer.html</file>
100
+ <type>html</type>
101
+ </storeshipper_customer>
102
+ </email>
103
+ </template>
104
+ </global>
105
+ <admin>
106
+ <routers>
107
+ <storeshipper>
108
+ <use>admin</use>
109
+ <args>
110
+ <module>Proxymit_StoreShipper</module>
111
+ <frontName>storeshipper</frontName>
112
+ </args>
113
+ </storeshipper>
114
+ <adminhtml>
115
+ <args>
116
+ <modules>
117
+ <storeshipper after="Mage_Adminhtml">Proxymit_StoreShipper</storeshipper>
118
+ </modules>
119
+ </args>
120
+ </adminhtml>
121
+ </routers>
122
+ </admin>
123
+ <adminhtml>
124
+ <layout>
125
+ <updates>
126
+ <storeshipper>
127
+ <file>storeshipper.xml</file>
128
+ </storeshipper>
129
+ </updates>
130
+ </layout>
131
+ </adminhtml>
132
+ </config>
app/code/community/Proxymit/StoreShipper/sql/storeshipper_setup/mysql4-install-0.0.1.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup ();
6
+
7
+ $installer->run ( "
8
+ CREATE TABLE IF NOT EXISTS {$this->getTable('storeshipper_order_store')} (
9
+ `id` int(11) NOT NULL AUTO_INCREMENT,
10
+ `id_order` int(11) DEFAULT NULL,
11
+ `id_store` int(11) DEFAULT NULL,
12
+ `pickup_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
13
+ PRIMARY KEY (`id`)
14
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
15
+ CREATE TABLE IF NOT EXISTS {$this->getTable('storeshipper_store')} (
16
+ `id` int(11) NOT NULL AUTO_INCREMENT,
17
+ `name` varchar(45) DEFAULT NULL,
18
+ `status` int(11) DEFAULT NULL,
19
+ `shipping_price` double DEFAULT '0',
20
+ `adress` varchar(45) DEFAULT NULL,
21
+ `city` varchar(45) DEFAULT NULL,
22
+ `zipcode` int(11) DEFAULT NULL,
23
+ `country` varchar(45) DEFAULT NULL,
24
+ `state` varchar(45) DEFAULT NULL,
25
+ `latitude` double DEFAULT NULL,
26
+ `longitude` double DEFAULT NULL,
27
+ `description` text,
28
+ `website` text,
29
+ `email` varchar(45) DEFAULT NULL,
30
+ `phone` varchar(45) DEFAULT NULL,
31
+ `fax` varchar(45) DEFAULT NULL,
32
+ `manager_name` varchar(45) DEFAULT NULL,
33
+ `manager_email` varchar(45) DEFAULT NULL,
34
+ `manager_show_frontend` int(11) DEFAULT NULL,
35
+ `manager_fax` varchar(45) DEFAULT NULL,
36
+ `manager_phone` varchar(45) DEFAULT NULL,
37
+ `id_schedule` int(11) DEFAULT NULL,
38
+ `available_at_storeview` int(11) NOT NULL,
39
+ `available_after` int(11) NOT NULL,
40
+ `monday_open` varchar(10) NOT NULL,
41
+ `monday_close` varchar(10) NOT NULL,
42
+ `tuesday_open` varchar(10) NOT NULL,
43
+ `tuesday_close` varchar(10) NOT NULL,
44
+ `wednesday_open` varchar(10) NOT NULL,
45
+ `wednesday_close` varchar(10) NOT NULL,
46
+ `thursday_open` varchar(10) NOT NULL,
47
+ `thursday_close` varchar(10) NOT NULL,
48
+ `friday_open` varchar(10) NOT NULL,
49
+ `friday_close` varchar(10) NOT NULL,
50
+ `saturday_open` varchar(10) NOT NULL,
51
+ `saturday_close` varchar(10) NOT NULL,
52
+ `sunday_open` varchar(10) NOT NULL,
53
+ `sunday_close` varchar(10) NOT NULL,
54
+ PRIMARY KEY (`id`)
55
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
56
+ " );
57
+
58
+ $installer->endSetup ();
app/design/adminhtml/default/default/layout/storeshipper.xml ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="0.1.0">
3
+ <storeshipper_adminhtml_index_index>
4
+ <reference name="content">
5
+ <block type="storeshipper/adminhtml_stores" name="stores" />
6
+ </reference>
7
+ </storeshipper_adminhtml_index_index>
8
+ <adminhtml_sales_order_view>
9
+ <reference name="order_tab_info">
10
+ <action method="setTemplate">
11
+ <template>storeshipper/sales/info.phtml</template>
12
+ </action>
13
+ </reference>
14
+ </adminhtml_sales_order_view>
15
+ <adminhtml_sales_order_invoice_view>
16
+ <reference name="form">
17
+ <action method="setTemplate">
18
+ <template>storeshipper/sales/order/invoice/view/form.phtml</template>
19
+ </action>
20
+ </reference>
21
+ </adminhtml_sales_order_invoice_view>
22
+ <adminhtml_sales_order_invoice_new>
23
+ <reference name="form">
24
+ <action method="setTemplate">
25
+ <template>storeshipper/sales/order/invoice/create/form.phtml</template>
26
+ </action>
27
+ </reference>
28
+ </adminhtml_sales_order_invoice_new>
29
+ <adminhtml_sales_order_shipment_new>
30
+ <reference name="form">
31
+ <action method="setTemplate">
32
+ <template>storeshipper/sales/order/shipment/create/form.phtml</template>
33
+ </action>
34
+ </reference>
35
+ </adminhtml_sales_order_shipment_new>
36
+ <adminhtml_sales_order_shipment_view>
37
+ <reference name="form">
38
+ <action method="setTemplate">
39
+ <template>storeshipper/sales/order/shipment/view/form.phtml</template>
40
+ </action>
41
+ </reference>
42
+ </adminhtml_sales_order_shipment_view>
43
+ <adminhtml_sales_order_creditmemo_new>
44
+ <reference name="form">
45
+ <action method="setTemplate">
46
+ <template>storeshipper/sales/order/creditmemo/create/form.phtml</template>
47
+ </action>
48
+ </reference>
49
+ </adminhtml_sales_order_creditmemo_new>
50
+ <adminhtml_sales_order_creditmemo_view>
51
+ <reference name="form">
52
+ <action method="setTemplate">
53
+ <template>storeshipper/sales/order/creditmemo/view/form.phtml</template>
54
+ </action>
55
+ </reference>
56
+ </adminhtml_sales_order_creditmemo_view>
57
+ </layout>
app/design/adminhtml/default/default/template/storeshipper/sales/info.phtml ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php /** @var $this Mage_Adminhtml_Block_Sales_Order_View_Tab_Info */ ?>
28
+ <?php $_order = $this->getOrder() ?>
29
+ <div>
30
+ <div id="order-messages">
31
+ <?php echo $this->getChildHtml('order_messages') ?>
32
+ </div>
33
+ <?php echo $this->getChildHtml('order_info') ?>
34
+ <input type="hidden" name="order_id" value="<?php echo $_order->getId() ?>"/>
35
+ <?php if ($_order->getIsVirtual()): ?>
36
+ <div class="box-right">
37
+ <?php else: ?>
38
+ <div class="box-left">
39
+ <?php endif; ?>
40
+ <!--Payment Method-->
41
+ <div class="entry-edit">
42
+ <div class="entry-edit-head">
43
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
44
+ </div>
45
+ <fieldset>
46
+ <?php echo $this->getPaymentHtml() ?>
47
+ <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
48
+ </fieldset>
49
+ </div>
50
+ </div>
51
+ <?php if (!$_order->getIsVirtual()): ?>
52
+ <div class="clear"></div>
53
+ <div class="">
54
+ <!--Shipping Method-->
55
+ <div class="entry-edit">
56
+ <div class="entry-edit-head">
57
+ <h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping &amp; Handling Information') ?></h4>
58
+ </div>
59
+ <fieldset>
60
+ <?php if ($_order->getTracksCollection()->count()) : ?>
61
+ <a href="#" id="linkId" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($_order) ?>','trackorder','width=800,height=600,resizable=yes,scrollbars=yes')" title="<?php echo $this->__('Track Order') ?>"><?php echo $this->__('Track Order') ?></a>
62
+ <br/>
63
+ <?php endif; ?>
64
+ <?php if ($_order->getShippingDescription()): ?>
65
+ <?php //echo $this->escapeHtml($_order->getShippingDescription())
66
+ echo $_order->getShippingDescription();
67
+ ?>
68
+ <script type="text/javascript">
69
+ if(document.getElementById("map-canvas")){
70
+ document.getElementById("map-canvas").style.right="0px";
71
+ document.getElementById("map-canvas").style.width="auto";
72
+ }
73
+ </script>
74
+
75
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
76
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
77
+ <?php else: ?>
78
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
79
+ <?php endif; ?>
80
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
81
+
82
+ <?php echo $_excl; ?>
83
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
84
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
85
+ <?php endif; ?>
86
+ <?php else: ?>
87
+ <?php echo $this->helper('sales')->__('No shipping information available'); ?>
88
+ <?php endif; ?>
89
+ </fieldset>
90
+ </div>
91
+ </div>
92
+ <?php endif; ?>
93
+ <div class="clear"></div>
94
+ <?php echo $this->getGiftOptionsHtml() ?>
95
+ <div class="clear"></div>
96
+ <div class="entry-edit">
97
+ <div class="entry-edit-head">
98
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items Ordered') ?></h4>
99
+ </div>
100
+ </div>
101
+ <?php echo $this->getItemsHtml() ?>
102
+ <div class="clear"></div>
103
+
104
+ <div class="box-left">
105
+ <div class="entry-edit">
106
+ <div class="entry-edit-head">
107
+ <h4><?php echo Mage::helper('sales')->__('Comments History') ?></h4>
108
+ </div>
109
+ <fieldset><?php echo $this->getChildHtml('order_history') ?></fieldset>
110
+ </div>
111
+ </div>
112
+ <div class="box-right entry-edit">
113
+ <div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Order Totals') ?></h4></div>
114
+ <div class="order-totals"><?php echo $this->getChildHtml('order_totals') ?></div>
115
+ </div>
116
+ <div class="clear"></div>
117
+ </div>
118
+
119
+ <?php echo $this->getChildHtml('popup_window');?>
120
+ <script type="text/javascript">
121
+ //<![CDATA[
122
+ /**
123
+ * Retrieve gift options tooltip content
124
+ */
125
+ function getGiftOptionsTooltipContent(itemId) {
126
+ var contentLines = [];
127
+ var headerLine = null;
128
+ var contentLine = null;
129
+
130
+ $$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function (element) {
131
+ if (element.down(0)) {
132
+ headerLine = element.down(0).innerHTML;
133
+ contentLine = element.down(0).next().innerHTML;
134
+ if (contentLine.length > 30) {
135
+ contentLine = contentLine.slice(0,30) + '...';
136
+ }
137
+ contentLines.push(headerLine + ' ' + contentLine);
138
+ }
139
+ });
140
+ return contentLines.join('<br/>');
141
+ }
142
+ giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
143
+ //]]>
144
+ </script>
app/design/adminhtml/default/default/template/storeshipper/sales/order/creditmemo/create/form.phtml ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <form id="edit_form" method="post" action="<?php echo $this->getSaveUrl() ?>">
28
+ <?php echo $this->getBlockHtml('formkey')?>
29
+ <?php $_order = $this->getCreditmemo()->getOrder() ?>
30
+ <?php echo $this->getChildHtml('order_info') ?>
31
+
32
+ <?php if (!$_order->getIsVirtual()): ?>
33
+ <div class="box-left">
34
+ <?php else: ?>
35
+ <div class="box-right">
36
+ <?php endif; ?>
37
+ <!--Billing Address-->
38
+ <div class="entry-edit">
39
+ <div class="entry-edit-head">
40
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
41
+ </div>
42
+ <fieldset>
43
+ <div><?php echo $this->getChildHtml('order_payment') ?></div>
44
+ <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
45
+ <?php /*if ($this->getCreditmemo()->canRefund()): ?>
46
+ <input type="checkbox" name="creditmemo[do_refund]" id="creditmemo_do_refund" value="1" checked/>
47
+ <label for="creditmemo_do_refund" class="normal"><?php echo Mage::helper('sales')->__('Refund Amount') ?></label>
48
+ <?php endif;*/ ?>
49
+ </fieldset>
50
+ </div>
51
+ </div>
52
+ <?php if (!$_order->getIsVirtual()): ?>
53
+ <div class="box-right">
54
+ <!--Shipping Address-->
55
+ <div class="entry-edit">
56
+ <div class="entry-edit-head">
57
+ <h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping Information') ?></h4>
58
+ </div>
59
+ <fieldset>
60
+ <strong><?php echo $_order->getShippingDescription() ?></strong>
61
+ <?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
62
+
63
+ <?php if ($this->helper('tax')->displaySalesPriceInclTax($this->getSource()->getStoreId())): ?>
64
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
65
+ <?php else: ?>
66
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
67
+ <?php endif; ?>
68
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
69
+
70
+ <?php echo $_excl; ?>
71
+ <?php if ($this->helper('tax')->displaySalesBothPrices($this->getSource()->getStoreId()) && $_incl != $_excl): ?>
72
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
73
+ <?php endif; ?>
74
+ </fieldset>
75
+ </div>
76
+ </div>
77
+ <?php endif; ?>
78
+ <div class="clear"></div>
79
+
80
+ <div class="entry-edit">
81
+ <div class="entry-edit-head">
82
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items to Refund') ?></h4>
83
+ </div>
84
+ </div>
85
+ <div id="creditmemo_item_container">
86
+ <?php echo $this->getChildHtml('order_items') ?>
87
+ </div>
88
+ </form>
app/design/adminhtml/default/default/template/storeshipper/sales/order/creditmemo/view/form.phtml ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_order = $this->getCreditmemo()->getOrder() ?>
28
+ <?php echo $this->getChildHtml('order_info') ?>
29
+ <?php if (!$_order->getIsVirtual()): ?>
30
+ <div class="box-left">
31
+ <?php else: ?>
32
+ <div class="box-right">
33
+ <?php endif; ?>
34
+ <!--Billing Address-->
35
+ <div class="entry-edit">
36
+ <div class="entry-edit-head">
37
+ <h4 class="icon-head head-payment-method"><?php echo $this->helper('sales')->__('Payment Information') ?></h4>
38
+ </div>
39
+ <fieldset>
40
+ <div><?php echo $this->getChildHtml('order_payment') ?></div>
41
+ <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
42
+ </fieldset>
43
+ </div>
44
+ </div>
45
+ <?php if (!$_order->getIsVirtual()): ?>
46
+ <div class="box-right">
47
+ <!--Shipping Address-->
48
+ <div class="entry-edit">
49
+ <div class="entry-edit-head">
50
+ <h4 class="icon-head head-shipping-method"><?php echo $this->helper('sales')->__('Shipping Information') ?></h4>
51
+ </div>
52
+ <fieldset>
53
+ <strong><?php echo $_order->getShippingDescription() ?></strong>
54
+ <?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
55
+
56
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
57
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
58
+ <?php else: ?>
59
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
60
+ <?php endif; ?>
61
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
62
+
63
+ <?php echo $_excl; ?>
64
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
65
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
66
+ <?php endif; ?>
67
+ </fieldset>
68
+ </div>
69
+ </div>
70
+ <?php endif; ?>
71
+ <div class="clear"></div>
72
+ <?php $_items = $this->getCreditmemo()->getAllItems() ?>
73
+ <div class="entry-edit">
74
+ <div class="entry-edit-head">
75
+ <h4 class="icon-head head-products"><?php echo $this->helper('sales')->__('Items Refunded') ?></h4>
76
+ </div>
77
+ </div>
78
+ <?php if (count($_items)): ?>
79
+ <div id="creditmemo_items_container">
80
+ <?php echo $this->getChildHtml('creditmemo_items') ?>
81
+ </div>
82
+ <?php else: ?>
83
+ <div class="entry-edit">
84
+ <fieldset><center><?php echo $this->helper('sales')->__('No Items') ?></center></fieldset>
85
+ </div>
86
+ <?php endif; ?>
87
+ <br />
88
+ <div class="box-left entry-edit">
89
+ <div class="entry-edit-head"><h4><?php echo $this->__('Credit Memo History') ?></h4></div>
90
+ <fieldset><?php echo $this->getChildHtml('order_comments') ?></fieldset>
91
+ </div>
92
+
93
+ <div class="box-right entry-edit" id="history_form">
94
+ <div class="entry-edit-head"><h4><?php echo $this->__('Credit Memo Totals') ?></h4></div>
95
+ <div class="order-totals"><?php echo $this->getChildHtml('creditmemo_totals') ?></div>
96
+ </div>
97
+ <div class="clear"></div>
app/design/adminhtml/default/default/template/storeshipper/sales/order/invoice/create/form.phtml ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <form id="edit_form" method="post" action="<?php echo $this->getSaveUrl() ?>">
28
+ <?php echo $this->getBlockHtml('formkey')?>
29
+ <?php $_order = $this->getInvoice()->getOrder() ?>
30
+ <?php echo $this->getChildHtml('order_info') ?>
31
+ <?php if (!$_order->getIsVirtual()): ?>
32
+ <div class="box-left">
33
+ <?php else: ?>
34
+ <div class="box-right">
35
+ <?php endif; ?>
36
+
37
+ <div class="entry-edit">
38
+ <div class="entry-edit-head">
39
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
40
+ </div>
41
+ <fieldset>
42
+ <div><?php echo $this->getChildHtml('order_payment') ?></div>
43
+ <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
44
+ </fieldset>
45
+ </div>
46
+ </div>
47
+ <?php if (!$_order->getIsVirtual()): ?>
48
+ <div class="box-right">
49
+ <!--Shipping Address-->
50
+ <div class="entry-edit">
51
+ <div class="entry-edit-head">
52
+ <h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping Information') ?></h4>
53
+ </div>
54
+ <fieldset>
55
+ <div>
56
+ <strong><?php echo $_order->getShippingDescription() ?></strong>
57
+ <?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
58
+
59
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
60
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
61
+ <?php else: ?>
62
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
63
+ <?php endif; ?>
64
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
65
+
66
+ <?php echo $_excl; ?>
67
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
68
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
69
+ <?php endif; ?>
70
+ </div>
71
+ <?php if ($this->canCreateShipment() && $this->canShipPartiallyItem()): ?>
72
+ <p class="nm">
73
+ <label for="invoice_do_shipment" class="normal"><?php echo Mage::helper('sales')->__('Create Shipment') ?></label>
74
+ <input type="checkbox" name="invoice[do_shipment]" id="invoice_do_shipment" value="1" <?php echo $this->hasInvoiceShipmentTypeMismatch()?' disabled="disabled"':'' ?> />
75
+ </p>
76
+ <?php if ($this->hasInvoiceShipmentTypeMismatch()): ?>
77
+ <small><?php echo $this->__('Some items in this order have different invoice and shipment types. You can create shipment only after the invoice is created.') ?></small>
78
+ <?php endif; ?>
79
+ <?php endif; ?>
80
+ <div id="tracking" style="display:none;"><?php echo $this->getChildHtml('tracking',false) ?></div>
81
+ </fieldset>
82
+ </div>
83
+ </div>
84
+ <?php endif; ?>
85
+ <div class="clear"></div>
86
+
87
+ <div class="entry-edit">
88
+ <div class="entry-edit-head">
89
+ <?php
90
+ $_itemsGridLabel = $this->getForcedShipmentCreate()?'Items to Invoice and Ship':'Items to Invoice';
91
+ ?>
92
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('%s', $_itemsGridLabel) ?></h4>
93
+ </div>
94
+ </div>
95
+ <div id="invoice_item_container">
96
+ <?php echo $this->getChildHtml('order_items') ?>
97
+ </div>
98
+ </form>
99
+ <script type="text/javascript">
100
+ //<![CDATA[
101
+ var createShipment = $('invoice_do_shipment');
102
+ createShipment.observe('click', function(e){
103
+ if (createShipment.checked) {
104
+ document.getElementById('tracking').style.display = 'block';
105
+ } else {
106
+ document.getElementById('tracking').style.display = 'none'
107
+ }
108
+ })
109
+
110
+ /*forced creating of shipment*/
111
+ var forcedShipmentCreate = <?php echo $this->getForcedShipmentCreate() ?>;
112
+ var shipmentElement = $('invoice_do_shipment');
113
+ if (forcedShipmentCreate && shipmentElement) {
114
+ shipmentElement.checked = true;
115
+ shipmentElement.disabled = true;
116
+ document.getElementById('tracking').style.display = 'block';
117
+ }
118
+ //]]>
119
+ </script>
app/design/adminhtml/default/default/template/storeshipper/sales/order/invoice/view/form.phtml ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_invoice = $this->getInvoice() ?>
28
+ <?php $_order = $_invoice->getOrder() ?>
29
+ <?php echo $this->getChildHtml('order_info') ?>
30
+ <?php if (!$_order->getIsVirtual()): ?>
31
+ <div class="box-left">
32
+ <?php else: ?>
33
+ <div class="box-right">
34
+ <?php endif; ?>
35
+ <!--Billing Address-->
36
+ <div class="entry-edit">
37
+ <div class="entry-edit-head">
38
+ <h4 class="icon-head head-payment-method"><?php echo $this->helper('sales')->__('Payment Information') ?></h4>
39
+ </div>
40
+ <fieldset>
41
+ <div><?php echo $this->getChildHtml('order_payment') ?></div>
42
+ <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
43
+ </fieldset>
44
+ </div>
45
+ </div>
46
+ <?php if (!$_order->getIsVirtual()): ?>
47
+ <div class="box-right">
48
+ <!--Shipping Address-->
49
+ <div class="entry-edit">
50
+ <div class="entry-edit-head">
51
+ <h4 class="icon-head head-shipping-method"><?php echo $this->helper('sales')->__('Shipping Information') ?></h4>
52
+ </div>
53
+ <fieldset>
54
+ <strong><?php echo $_order->getShippingDescription() ?></strong>
55
+ <?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
56
+
57
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
58
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
59
+ <?php else: ?>
60
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
61
+ <?php endif; ?>
62
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
63
+
64
+ <?php echo $_excl; ?>
65
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
66
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
67
+ <?php endif; ?>
68
+ <div><?php echo $this->getChildHtml('shipment_tracking') ?></div>
69
+ </fieldset>
70
+ </div>
71
+ <?php endif; ?>
72
+ </div>
73
+ <div class="clear"></div>
74
+
75
+ <div class="entry-edit">
76
+ <div class="entry-edit-head">
77
+ <h4 class="icon-head head-products"><?php echo $this->helper('sales')->__('Items Invoiced') ?></h4>
78
+ </div>
79
+ <div id="invoice_item_container">
80
+ <?php echo $this->getChildHtml('invoice_items') ?>
81
+ </div>
82
+ </div>
83
+
84
+ <div class="box-left entry-edit">
85
+ <div class="entry-edit-head"><h4><?php echo $this->__('Invoice History') ?></h4></div>
86
+ <fieldset><?php echo $this->getChildHtml('order_comments') ?></fieldset>
87
+ </div>
88
+
89
+ <div class="box-right entry-edit" id="history_form">
90
+ <div class="entry-edit-head"><h4><?php echo $this->__('Invoice Totals') ?></h4></div>
91
+ <div class="order-totals"><?php echo $this->getChildHtml('invoice_totals') ?></div>
92
+ </div>
93
+ <div class="clear"></div>
app/design/adminhtml/default/default/template/storeshipper/sales/order/shipment/create/form.phtml ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <form id="edit_form" method="post" action="<?php echo $this->getSaveUrl() ?>">
28
+ <?php echo $this->getBlockHtml('formkey')?>
29
+ <?php $_order = $this->getShipment()->getOrder() ?>
30
+ <?php echo $this->getChildHtml('order_info') ?>
31
+
32
+
33
+ <div class="box-left">
34
+ <!--Billing Address-->
35
+ <div class="entry-edit">
36
+ <div class="entry-edit-head">
37
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
38
+ </div>
39
+ <fieldset>
40
+ <div><?php echo $this->getPaymentHtml() ?></div>
41
+ <div><?php echo Mage::helper('sales')->__('The order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
42
+ </fieldset>
43
+ </div>
44
+ </div>
45
+ <div class="box-right">
46
+ <!--Shipping Address-->
47
+ <div class="entry-edit">
48
+ <div class="entry-edit-head">
49
+ <h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping Information') ?></h4>
50
+ </div>
51
+ <fieldset>
52
+ <div>
53
+ <strong><?php echo $_order->getShippingDescription() ?></strong>
54
+ <?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
55
+
56
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
57
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
58
+ <?php else: ?>
59
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
60
+ <?php endif; ?>
61
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
62
+
63
+ <?php echo $_excl; ?>
64
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
65
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
66
+ <?php endif; ?>
67
+ </div>
68
+ <div><?php echo $this->getChildHtml('shipment_tracking') ?></div>
69
+ </fieldset>
70
+ </div>
71
+ </div>
72
+ <div class="clear"></div>
73
+
74
+ <div class="entry-edit">
75
+ <div class="entry-edit-head">
76
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items to Ship') ?></h4>
77
+ </div>
78
+ </div>
79
+ <div id="ship_items_container">
80
+ <?php echo $this->getItemsHtml() ?>
81
+ </div>
82
+ </form>
83
+ <?php echo $this->getChildHtml('shipment_packaging') ?>
84
+ <script type="text/javascript">
85
+ //<![CDATA[
86
+ document.observe("dom:loaded", function() {
87
+ setTimeout(function(){
88
+ packaging.setConfirmPackagingCallback(function(){
89
+ packaging.setParamsCreateLabelRequest($('edit_form').serialize(true));
90
+ packaging.sendCreateLabelRequest();
91
+ });
92
+ packaging.setLabelCreatedCallback(function(response){
93
+ setLocation("<?php echo $this->getUrl(
94
+ '*/sales_order/view',
95
+ array('order_id' => $this->getShipment()->getOrderId())
96
+ ); ?>");
97
+ });
98
+ packaging.setCancelCallback(function() {
99
+ packaging.cleanPackages();
100
+ $('create_shipping_label').checked = false;
101
+ toggleCreateLabelCheckbox();
102
+ });
103
+ packaging.setItemQtyCallback(function(itemId){
104
+ var item = $$('[name="shipment[items]['+itemId+']"]')[0];
105
+ if (item && !isNaN(item.value)) {
106
+ return item.value;
107
+ }
108
+ });
109
+ }, 500);
110
+ });
111
+
112
+ editForm = new varienForm('edit_form');
113
+ //]]>
114
+ </script>
app/design/adminhtml/default/default/template/storeshipper/sales/order/shipment/view/form.phtml ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_order = $this->getShipment()->getOrder() ?>
28
+ <?php echo $this->getChildHtml('order_info') ?>
29
+
30
+ <div class="box-left">
31
+ <!--Billing Address-->
32
+ <div class="entry-edit">
33
+ <div class="entry-edit-head">
34
+ <h4 class="icon-head head-payment-method"><?php echo $this->helper('sales')->__('Payment Information') ?></h4>
35
+ </div>
36
+ <fieldset>
37
+ <div><?php echo $this->getChildHtml('order_payment') ?></div>
38
+ <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
39
+ </fieldset>
40
+ </div>
41
+ </div>
42
+ <div class="box-right">
43
+ <!--Shipping Address-->
44
+ <div class="entry-edit">
45
+ <div class="entry-edit-head">
46
+ <h4 class="icon-head head-shipping-method"><?php echo $this->helper('sales')->__('Shipping and Tracking Information') ?></h4>
47
+ </div>
48
+ <fieldset>
49
+ <div>
50
+ <?php if($this->getShipment()->getTracksCollection()->count()): ?>
51
+ <a href="#" id="linkId" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($this->getShipment()) ?>','trackshipment','width=800,height=600,resizable=yes,scrollbars=yes')" title="<?php echo $this->__('Track this shipment') ?>"><?php echo $this->__('Track this shipment') ?></a>
52
+ <br/>
53
+ <?php endif; ?>
54
+ <strong><?php echo $_order->getShippingDescription() ?></strong>
55
+ <?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
56
+
57
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
58
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
59
+ <?php else: ?>
60
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
61
+ <?php endif; ?>
62
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
63
+
64
+ <?php echo $_excl; ?>
65
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
66
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
67
+ <?php endif; ?>
68
+ </div>
69
+ <?php if ($this->canCreateShippingLabel()): ?>
70
+ <div style="text-align: center; margin: 10px 0;">
71
+ <?php echo $this->getCreateLabelButton()?>
72
+ <?php if ($this->getShipment()->getShippingLabel()): ?>
73
+ <?php echo $this->getPrintLabelButton() ?>
74
+ <?php endif ?>
75
+ <?php if ($this->getShipment()->getPackages()): ?>
76
+ <?php echo $this->getShowPackagesButton() ?>
77
+ <?php endif ?>
78
+ </div>
79
+ <?php endif ?>
80
+ <div><?php echo $this->getChildHtml('shipment_tracking') ?></div>
81
+ </fieldset>
82
+ <?php echo $this->getChildHtml('shipment_packaging') ?>
83
+ <script type="text/javascript">
84
+ //<![CDATA[
85
+ document.observe("dom:loaded", function() {
86
+ setTimeout(function(){
87
+ packaging.setConfirmPackagingCallback(function(){
88
+ packaging.sendCreateLabelRequest();
89
+ });
90
+ packaging.setLabelCreatedCallback(function(response){
91
+ setLocation("<?php echo $this->getUrl(
92
+ '*/sales_order_shipment/view',
93
+ array('shipment_id' => $this->getShipment()->getId())
94
+ ); ?>");
95
+ });
96
+ }, 500);
97
+ });
98
+ //]]>
99
+ </script>
100
+ </div>
101
+ </div>
102
+ <div class="clear"></div>
103
+
104
+ <div class="entry-edit">
105
+ <div class="entry-edit-head">
106
+ <h4 class="icon-head head-products"><?php echo $this->helper('sales')->__('Items Shipped') ?></h4>
107
+ </div>
108
+ </div>
109
+
110
+ <?php echo $this->getChildHtml('shipment_items') ?>
111
+ <?php echo $this->getChildHtml('shipment_packed') ?>
112
+
113
+ <div class="box-left entry-edit">
114
+ <div class="entry-edit-head"><h4><?php echo $this->__('Shipment History') ?></h4></div>
115
+ <fieldset><?php echo $this->getChildHtml('order_comments') ?></fieldset>
116
+ </div>
117
+ <div class="clear"></div>
app/design/adminhtml/default/default/template/storeshipper/stores.phtml ADDED
@@ -0,0 +1 @@
 
1
+ <?php
app/design/frontend/base/default/layout/pickup.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <checkout_onepage_index>
4
+ <reference name='head'>
5
+ <reference name="head">
6
+ <action method="addItem"><type>js</type><name>pickup/jquery-1.6.4.min.js</name></action>
7
+ <action method="addItem"><type>js</type><name>pickup/noconflict.js</name></action>
8
+ <action method="addItem"><type>js</type><name>pickup/onepage.js</name></action>
9
+ </reference>
10
+ </reference>
11
+ <reference name='checkout.onepage.shipping_method.available'>
12
+ <action method='setTemplate'><template>pickup/checkout/onepage/shipping_method/available.phtml</template></action>
13
+ </reference>
14
+ </checkout_onepage_index>
15
+ <checkout_onepage_shippingmethod>
16
+ <reference name='root'>
17
+ <action method='setTemplate'><template>pickup/checkout/onepage/shipping_method/available.phtml</template></action>
18
+ </reference>
19
+ </checkout_onepage_shippingmethod>
20
+ </layout>
app/design/frontend/base/default/layout/storeshipper.xml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="root">
5
+ <action method="setTemplate">
6
+ <template>page/1column.phtml</template>
7
+ </action>
8
+ </reference>
9
+ <reference name="head">
10
+ <action method="addJs">
11
+ <name>stores/canvasloader/canvasloader.js</name>
12
+ <params />
13
+ </action>
14
+ </reference>
15
+ <reference name="root">
16
+ <reference name="top.links">
17
+ <action method="addLink" translate="label title">
18
+ <label>Our Stores</label>
19
+ <url>stores</url>
20
+ <title>Our Stores</title>
21
+ <prepare>true</prepare>
22
+ <position>1</position>
23
+ <liParams />
24
+ <beforeText></beforeText>
25
+ <afterText></afterText>
26
+ </action>
27
+ </reference>
28
+ </reference>
29
+ </default>
30
+ <routeurfrontend_index_index>
31
+ <reference name="content">
32
+ <block type="storeshipper/ourstores" name="ourstores"
33
+ template="storeshipper/ourstores.phtml" />
34
+ </reference>
35
+ </routeurfrontend_index_index>
36
+ <sales_order_print>
37
+ <reference name="sales.order.print">
38
+ <action method="setTemplate">
39
+ <template>storeshipper/sales/order/print.phtml</template>
40
+ </action>
41
+ </reference>
42
+ </sales_order_print>
43
+ <sales_guest_print>
44
+ <reference name="sales.order.print">
45
+ <action method="setTemplate">
46
+ <template>storeshipper/sales/order/print.phtml</template>
47
+ </action>
48
+ </reference>
49
+ </sales_guest_print>
50
+ <sales_order_printcreditmemo>
51
+ <reference name="sales.order.print.creditmemo">
52
+ <action method="setTemplate">
53
+ <template>storeshipper/sales/order/print.phtml</template>
54
+ </action>
55
+ </reference>
56
+ </sales_order_printcreditmemo>
57
+ <sales_guest_printcreditmemo>
58
+ <reference name="sales.order.print.creditmemo">
59
+ <action method="setTemplate">
60
+ <template>storeshipper/sales/order/print.phtml</template>
61
+ </action>
62
+ </reference>
63
+ </sales_guest_printcreditmemo>
64
+ </layout>
app/design/frontend/base/default/template/pickup/checkout/onepage/shipping_method/available.phtml ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php if (!($_shippingRateGroups = $this->getShippingRates())): ?>
3
+ <p><?php echo $this->__('Sorry, no quotes are available for this order at this time.') ?></p>
4
+ <?php else: ?>
5
+ <dl class="sp-methods">
6
+ <?php $shippingCodePrice = array(); ?>
7
+ <?php $_sole = count($_shippingRateGroups) == 1; foreach ($_shippingRateGroups as $code => $_rates): ?>
8
+ <dt><?php echo $this->getCarrierName($code) ?></dt>
9
+ <dd>
10
+ <ul>
11
+ <?php $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate): ?>
12
+ <?php $shippingCodePrice[] = "'".$_rate->getCode()."':".(float)$_rate->getPrice(); ?>
13
+ <li>
14
+ <?php if ($_rate->getErrorMessage()): ?>
15
+ <ul class="messages"><li class="error-msg"><ul><li><?php echo $_rate->getErrorMessage() ?></li></ul></li></ul>
16
+ <?php else: ?>
17
+ <?php if ($_sole) : ?>
18
+ <span class="no-display"><input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>" checked="checked" /></span>
19
+ <?php else: ?>
20
+ <input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio"/>
21
+
22
+ <?php if ($_rate->getCode() === $this->getAddressShippingMethod()): ?>
23
+ <script type="text/javascript">
24
+ //<![CDATA[
25
+ lastPrice = <?php echo (float)$_rate->getPrice(); ?>;
26
+ //]]>
27
+ </script>
28
+ <?php endif; ?>
29
+
30
+ <?php endif; ?>
31
+ <label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $_rate->getMethodTitle() ?>
32
+ <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
33
+ <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
34
+ <?php echo $_excl; ?>
35
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
36
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
37
+ <?php endif; ?>
38
+ </label>
39
+ <?php
40
+ $carrier = Mage::getModel('shipping/config')->getCarrierInstance($code);
41
+ if($carrier->getFormBlock()){
42
+ $block = $this->getLayout()->createBlock($carrier->getFormBlock());
43
+ $block->setMethodCode($code);
44
+ $block->setRate($_rate);
45
+ $block->setMethodInstance($carrier);
46
+ echo $block->_toHtml();
47
+ }
48
+ ?>
49
+ <?php endif ?>
50
+ </li>
51
+ <?php endforeach; ?>
52
+ </ul>
53
+ </dd>
54
+ <?php endforeach; ?>
55
+ </dl>
56
+ <script type="text/javascript">
57
+ //<![CDATA[
58
+ <?php if (!empty($shippingCodePrice)): ?>
59
+ var shippingCodePrice = {<?php echo implode(',',$shippingCodePrice); ?>};
60
+ <?php endif; ?>
61
+
62
+ $$('input[type="radio"][name="shipping_method"]').each(function(el){
63
+ Event.observe(el, 'click', function(){
64
+ if (el.checked == true) {
65
+ var getShippingCode = el.getValue();
66
+ <?php if (!empty($shippingCodePrice)): ?>
67
+ var newPrice = shippingCodePrice[getShippingCode];
68
+ if (!lastPrice) {
69
+ lastPrice = newPrice;
70
+ quoteBaseGrandTotal += newPrice;
71
+ }
72
+ if (newPrice != lastPrice) {
73
+ quoteBaseGrandTotal += (newPrice-lastPrice);
74
+ lastPrice = newPrice;
75
+ }
76
+ <?php endif; ?>
77
+ checkQuoteBaseGrandTotal = quoteBaseGrandTotal;
78
+ return false;
79
+ }
80
+ });
81
+ });
82
+ //]]>
83
+ jQuery(document).ready(function(){
84
+
85
+ var str= '<li class="control">'+
86
+ '<input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipper_no" value="1" title="Store Shipping (StoreShipper)" class="radio"><label for="billing:use_for_shipper_no">Store Shipping (StoreShipper)</label>'+
87
+ '</li>';
88
+ jQuery(str).appendTo("#co-billing-form ul");
89
+ //console.log(jQuery('opc-billing').append(str));
90
+ hideShippingAll();
91
+ jQuery('input[type="radio"][name="shipping_method"]').click(function(){
92
+ hideShippingAll();
93
+ var code = jQuery(this).val();
94
+ if(jQuery(this).is(':checked')){
95
+ showShipping(code);
96
+ }
97
+ });
98
+ jQuery('input[type="radio"][name="shipping_method"]').each(function(){
99
+ var code = jQuery(this).val();
100
+ if(jQuery(this).is(":checked")){
101
+ showShipping(code);
102
+ }
103
+ });
104
+ });
105
+ function showShipping(code){
106
+ if(jQuery('#'+'shipping_form_'+code).length != 0){
107
+ jQuery('#'+'shipping_form_'+code).show();
108
+ jQuery(this).find('.required-entry').attr('disabled','false');
109
+ initialize();
110
+ if(jQuery("#main_store_select").val() !='-1'){
111
+ jQuery('#selected_store_text').text(jQuery("#main_store_select option[value='"+jQuery("#main_store_select").val()+"']").text());
112
+ }
113
+ }
114
+ }
115
+ function hideShippingAll(){
116
+ jQuery('input[type="radio"][name="shipping_method"]').each(function(){
117
+ var code = jQuery(this).val();
118
+ jQuery('#'+'shipping_form_'+code).hide();
119
+ jQuery(this).find('.required-entry').attr('disabled','true');
120
+ });
121
+ }
122
+ </script>
123
+ <?php endif; ?>
app/design/frontend/base/default/template/pickup/pickup.phtml ADDED
@@ -0,0 +1,361 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ *
6
+ *
7
+ */
8
+ ?>
9
+ <script type="text/javascript">
10
+ /*function initialize() {
11
+ var mapOptions = {
12
+ center: new google.maps.LatLng(0,0),
13
+ zoom: 1,
14
+ mapTypeId: google.maps.MapTypeId.ROADMAP
15
+ };
16
+ map = new google.maps.Map(document.getElementById("map-canvas"),
17
+ mapOptions);
18
+ }*/
19
+ //google.maps.event.addDomListener(window, 'load', initialize);
20
+ </script>
21
+ <?php
22
+ $_code = $this->getMethodCode ();
23
+ $carrier = $this->getMethodInstance ();
24
+ $pickupData = $this->getQuote ()->getPickupData ();
25
+ $_rate = $this->getRate ();
26
+ if (! isset ( $pickupData ['id_store'] )) {
27
+ $pickupData ['id_store'] = '';
28
+ }
29
+ if (! isset ( $pickupData ['store'] )) {
30
+ $pickupData ['store'] = '';
31
+ }
32
+ if (! isset ( $pickupData ['pickup_date'] )) {
33
+ $pickupData ['pickup_date'] = '';
34
+ }
35
+
36
+ ?>
37
+ <ul class="form-list" id="shipping_form_<?php echo $_rate->getCode() ?>"
38
+ style="display: none;">
39
+ <li><span class="input-box"> <select style="display:none;" class="required-entry"
40
+ name="shipping_pickup[id_store]" id="main_store_select">
41
+ <option value='-1'
42
+ <?php if($pickupData['id_store'] == ''){ echo "selected=selected";} ?>><?php echo $this->__('Select Store..');?></option>
43
+ <?php
44
+ $stores = $this->getAllStores ();
45
+ foreach ( $stores as $store ) {
46
+ ?>
47
+ <option value='<?php echo $store["id"]; ?>'
48
+ <?php if($pickupData['id_store'] == $store["id"]){ echo "selected=selected";} ?>><?php echo $store["name"]; ?></option>
49
+ <?php } ?>
50
+ </select>
51
+ </span>
52
+
53
+ <div class="col1-set">
54
+ <div class="col-1">
55
+ <br /><div id="map-canvas" style="height: 240px; width: 603px"></div>
56
+ </div>
57
+ <div align="center"><br />
58
+ <span><?php echo $this->__('Selected store :') ?></span>
59
+ <div style="color: red; font-size: 14px; font-weight: bold;" id="selected_store_text">None</div>
60
+ </div>
61
+ <div class="col2-set">
62
+ <div class="col-1">
63
+ <div class="fieldset">
64
+
65
+ <h2 class="legend">Search</h2>
66
+ <form name="search_form" id="search_form" action="ourstores_submit"
67
+ method="post" accept-charset="utf-8">
68
+ <ul class="form-list">
69
+ <li class="fields">
70
+ <div class="field">
71
+ <label for="country">Country</label>
72
+ <div class="input-box">
73
+ <?php $_countries = Mage::getResourceModel('directory/country_collection')
74
+ ->loadData()
75
+ ->toOptionArray(false) ?>
76
+ <?php if (count($_countries) > 0): ?>
77
+ <select name="country" id="country" style="width: 130px;">
78
+ <option value="">-- All Countries --</option>
79
+ <?php foreach($_countries as $_country): ?>
80
+ <option value="<?php echo $_country['value'] ?>">
81
+ <?php echo $_country['label'] ?>
82
+ </option>
83
+ <?php endforeach; ?>
84
+ </select>
85
+ <?php endif; ?>
86
+ </div>
87
+ </div>
88
+ </li>
89
+ <li class="fields">
90
+ <div class="field">
91
+ <label for="state">State / Province</label>
92
+ <div class="input-box">
93
+ <input name="state" id="state" />
94
+ </div>
95
+ </div>
96
+ <div class="field">
97
+ <label for="city">City</label>
98
+ <div class="input-box">
99
+ <input id="city" name="city" />
100
+ </div>
101
+ </div>
102
+ <div class="field">
103
+ <label for="zip">Zip Code</label>
104
+ <div class="input-box">
105
+ <input id="zip" name="zip" />
106
+ </div>
107
+ </div>
108
+ </li>
109
+ </ul>
110
+ <div class="buttons-set">
111
+ <button type="button" title="Valider" class="button"
112
+ onclick="window.stroreshipper.subm();">
113
+ <span><span>Search</span></span>
114
+ </button>
115
+ </div>
116
+ </form>
117
+ </div>
118
+ </div>
119
+ <div class="col-2">
120
+ <div id="stores" style="padding:0px; max-height: 300px; overflow: auto; border: 0px;" class="stores fieldset">
121
+ <!-- <h2 class="legend">Stores list</h2> -->
122
+ <table class="data-table">
123
+ <tr>
124
+ <th>Store Name</th>
125
+ <th>City</th>
126
+ <th>Country</th>
127
+ <th></th>
128
+ </tr>
129
+ <?php
130
+ $stores = $this->getAllStores ();
131
+ $points = array ();
132
+ $titles = array ();
133
+ foreach ( $stores as $store ) {
134
+ $points [$store ["id"]] = $store ["latitude"] . ',' . $store ["longitude"] . ',"' . $store ["name"] . '"';
135
+ ?>
136
+ <tr>
137
+ <td><a
138
+ href="javascript:stroreshipper.pointStore(<?php echo $store["latitude"].','.$store["longitude"].','.$store["id"];?>);"><?php echo $store["name"];?></a></td>
139
+ <td><?php echo $store["city"];?></td>
140
+ <td><?php echo Mage::helper ( 'storeshipper' )->getCountryName($store["country"]);?></td>
141
+ <td><a target="_new"
142
+ href="javascript:itiniraire('<?php echo $store["latitude"].", ".$store["longitude"];?>')"><img src="http://laviouze.free.fr/images/Map.png" width="30px" /></a></td>
143
+ </tr>
144
+ <?php
145
+ }
146
+ ?>
147
+ </table>
148
+ </div>
149
+ </div>
150
+ </div>
151
+ </div>
152
+ </li>
153
+ </ul>
154
+ <script type="text/javascript">
155
+ window.stroreshipper = {};
156
+ window.loadJsFile = function(filename){
157
+ var fileref=document.createElement('script');
158
+ fileref.setAttribute("type","text/javascript");
159
+ fileref.setAttribute("src", filename);
160
+ if (typeof fileref!="undefined")
161
+ document.getElementsByTagName("head")[0].appendChild(fileref);
162
+ }
163
+ window.initialize = function() {
164
+ setTimeout(function(){
165
+ window.stroreshipper.setAllMap(null);
166
+ markers = [];
167
+ var mapOptions = {
168
+ center: new google.maps.LatLng(0,0),
169
+ zoom: 1,
170
+ mapTypeId: google.maps.MapTypeId.ROADMAP
171
+ };
172
+ map = new google.maps.Map(document.getElementById("map-canvas"),
173
+ mapOptions);
174
+ window.stroreshipper.getLocation();
175
+ <?php
176
+ function dirFiles($directry) {
177
+ $dir = dir ( $directry ); // Open Directory
178
+ if ($dir != NULL) {
179
+ while ( false !== ($file = $dir->read ()) ) // Reads Directory
180
+ {
181
+ $extension = substr ( $file, strrpos ( $file, '.' ) ); // Gets the File
182
+ // Extension
183
+ if ($extension == ".png" || $extension == ".jpg" || $extension == ".bmp" | $extension == ".gif" | $extension == ".jpeg") // Extensions
184
+ // Allowed
185
+ $filesall [$file] = $file; // Store in Array
186
+ }
187
+ $dir->close (); // Close Directory
188
+ asort ( $filesall ); // Sorts the Array
189
+ return $filesall;
190
+ }
191
+
192
+ }
193
+ function getImages($id_store){
194
+ $html = 'new Array(';
195
+ $model_st= Mage::getModel ( 'storeshipper/stores' )->load($id_store);
196
+ $html.='"<p>'.$model_st->getDescription().'</p>",';
197
+ $path = Mage::getBaseDir ( 'media' ) . DS . 'storeshipper' . DS .$id_store. DS;
198
+ $array = dirFiles ( $path );
199
+ if($array !=NULL){
200
+ foreach ( $array as $key => $file ) {
201
+ $p = Mage::getBaseUrl ( Mage_Core_Model_Store::URL_TYPE_MEDIA ) . 'storeshipper/' .$id_store. '/' . $file;
202
+ $html .= '"<a target=\'_blank\' href=\'' . $p . '\'><img style=\'max-width: 150px;\' src=\'' . $p . '\' /></a>",';
203
+ }
204
+ }
205
+ $html .= '"")';
206
+ return $html;
207
+ }
208
+
209
+ foreach ( $points as $key => $p ) {
210
+ echo 'window.stroreshipper.addMarker(' . $p . ','.getImages($key).');';
211
+ }
212
+
213
+ ?>
214
+ var mcOptions = {gridSize: 50, maxZoom: 15};
215
+ mc = new window.MarkerClusterer(map,markers, mcOptions);
216
+ },2000);
217
+ }
218
+ <?php $googleApiKey = Mage::getStoreConfig('carriers/pickup/google_api'); ?>
219
+ <?php if($googleApiKey):?>
220
+ window.loadJsFile("http://maps.google.com/maps/api/js?callback=initialize&key=<?php echo $googleApiKey; ?>&sensor=true");
221
+ <?php else: ?>
222
+ window.loadJsFile("http://maps.google.com/maps/api/js?callback=initialize&sensor=true");
223
+ <?php endif; ?>
224
+ window.loadJsFile("http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js");
225
+ </script>
226
+ <script type="text/javascript">
227
+ //var map = new google.maps.Map(document.getElementById("map-canvas"));
228
+ var mc;
229
+ window.stroreshipper.setAllMap = function(map) {
230
+ for (var i = 0; i < markers.length; i++) {
231
+ markers[i].setMap(map);
232
+ }
233
+ }
234
+ window.itiniraire = function(dest){
235
+ window.open("https://maps.google.com/maps?saddr="+myLocation.toString()+"&daddr=("+dest+")&hl=fr&ie=UTF8&sll=48.885953,2.242912&sspn=0.008113,0.01929&geocode=&oq=&t=h&mra=ls","blank");
236
+ }
237
+ window.stroreshipper.showPosition = function(position) {
238
+ var lat = position.coords.latitude;
239
+ var lng = position.coords.longitude;
240
+ myLocation = new google.maps.LatLng(lat, lng);
241
+ //map.setCenter(new google.maps.LatLng(lat, lng));
242
+ var marker = new google.maps.Marker({
243
+ position: new google.maps.LatLng(lat, lng),
244
+ map: map,
245
+ icon: 'http://www.robotwoods.com/dev/misc/bluecircle.png',
246
+ title: "Your current position"
247
+ });
248
+ }
249
+ window.stroreshipper.getLocation = function() {
250
+ if (navigator.geolocation) {
251
+ navigator.geolocation.getCurrentPosition(window.stroreshipper.showPosition);
252
+ } else {
253
+ alert("Geolocation is not supported by this browser.");
254
+ }
255
+ }
256
+
257
+ var markers = [];
258
+ //google.maps.event.addDomListener(window, 'load', initialize);
259
+
260
+ window.stroreshipper.pointStore = function(lat, long){
261
+ map.panTo(new google.maps.LatLng(lat, long));
262
+ map.setZoom(15);
263
+
264
+ }
265
+ window.stroreshipper.addMarker = function(lat, long, name, images){
266
+ var marker = new google.maps.Marker({
267
+ position: new google.maps.LatLng(lat, long),
268
+ map: map,
269
+ title: name
270
+ });
271
+ var contentString = '<div id="content">'+
272
+ '<div id="siteNotice">'+
273
+ '</div>'+
274
+ '<h1 id="firstHeading" class="firstHeading">'+name+'</h1>'+
275
+ '<div id="bodyContent">'+
276
+ '<p>';
277
+ var i=0;
278
+ for(i=0;i<images.length;i++){
279
+ contentString+=images[i];
280
+ }
281
+ //contentString += '<table><tr><td><img src="http://127.0.0.1/magento1/skin/adminhtml/default/default/images/logo.gif" /></td><td><img src="http://127.0.0.1/magento1/skin/frontend/default/default/images/logo.gif" /></td></tr></table>';
282
+ contentString += '</p>'+
283
+ '</div>'+
284
+ '</div>';
285
+ markers.push(marker);
286
+
287
+
288
+ var infowindow = new google.maps.InfoWindow({
289
+ content: contentString
290
+ });
291
+
292
+ google.maps.event.addListener(marker, 'click', function() {
293
+ infowindow.open(map,marker);
294
+ });
295
+ }
296
+
297
+
298
+ </script>
299
+
300
+
301
+ <script type="text/javascript">
302
+ window.stroreshipper.subm = function(){
303
+ window.stroreshipper.showLoading();
304
+ new Ajax.Request(
305
+ '<?php echo Mage::getBaseUrl(); ?>/stores/index/getStores/',
306
+ {
307
+ method: 'post',
308
+ form: 'search_form',
309
+ parameters: {search:"2", zip:$("zip").getValue(), state:$("state").getValue(), country:$("country").getValue(), city:$("city").getValue() },
310
+ onSuccess: window.stroreshipper.successIt,
311
+ onFailure: function() { console.log('Connection Error !'); }
312
+ }
313
+ );
314
+ }
315
+ window.stroreshipper.successIt = function(response) {
316
+ var content = response.responseText;
317
+ var container = $("stores");
318
+ container.update(content);
319
+ container.update($("search-result"));
320
+ //alert('done');
321
+ }
322
+ window.stroreshipper.showLoading = function(){
323
+ $("stores").update("");
324
+ var cl = new CanvasLoader('stores');
325
+ cl.setDiameter(30); // default is 40
326
+ cl.setDensity(80); // default is 40
327
+ cl.setRange(0.7); // default is 1.3
328
+ cl.show(); // Hidden by default
329
+ }
330
+
331
+ //var map ;
332
+
333
+ Event.observe(window, 'load', function() {
334
+
335
+ //map = new google.maps.Map(document.getElementById("map-canvas"));
336
+ //google.maps.event.addDomListener(window, 'load', initialize);
337
+ });
338
+
339
+ window.stroreshipper.selectStore = function(val) {
340
+ var sel = document.getElementById('main_store_select');
341
+ for(var i = 0, j = sel.options.length; i < j; ++i) {
342
+ if(sel.options[i].text == val) {
343
+ sel.selectedIndex = i;
344
+ }
345
+ }
346
+ }
347
+
348
+
349
+ window.stroreshipper.pointStore = function(lat, long, st){
350
+ map.panTo(new google.maps.LatLng(lat, long));
351
+ map.setZoom(15);
352
+ var sel = document.getElementById('main_store_select');
353
+ for(var i = 0, j = sel.options.length; i < j; ++i) {
354
+ if(sel.options[i].value == st) {
355
+ sel.selectedIndex = i;
356
+ document.getElementById('selected_store_text').innerHTML="&nbsp;&nbsp;<b><font style='color:red;'>" +sel.options[i].innerHTML +" </font></b>";
357
+ }
358
+ }
359
+ }
360
+
361
+ </script>
app/design/frontend/base/default/template/storeshipper/ourstores.phtml ADDED
@@ -0,0 +1,287 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Proxymit_StoreShipper Module
5
+ *
6
+ *
7
+ */
8
+
9
+ if (isset ( $_POST ['search'] )) {
10
+ ?>
11
+
12
+ <div id="search-result">
13
+ serach request
14
+ <h1>Zip : <?php echo $_POST['zip'];?></h1>
15
+ <h1>City : <?php echo $_POST['city'];?></h1>
16
+ <h1>Country : <?php echo $_POST['country'];?></h1>
17
+
18
+ </div>
19
+
20
+ <?php
21
+ } else {
22
+ $googleApiKey = Mage::getStoreConfig ( 'carriers/pickup/google_api' );
23
+ ?>
24
+ <?php //Mage::log(getImages(1)); ?>
25
+ <script type="text/javascript"
26
+ src="https://maps.googleapis.com/maps/api/js?key=<?php echo $googleApiKey; ?>&sensor=true">
27
+ </script>
28
+ <script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js"></script>
29
+
30
+ <div class="col1-set">
31
+ <div class="col-1">
32
+ <div id="map-canvas" style="height: 300px; width: 900px"></div>
33
+
34
+ </div>
35
+ <div class="col2-set">
36
+ <div class="col-1">
37
+ <div class="fieldset">
38
+
39
+ <h2 class="legend">Search</h2>
40
+ <form name="search_form" id="search_form" action="ourstores_submit"
41
+ method="post" accept-charset="utf-8">
42
+ <ul class="form-list">
43
+ <li class="fields">
44
+ <div class="field">
45
+ <label for="country">Country</label>
46
+ <div class="input-box">
47
+ <?php $_countries = Mage::getResourceModel('directory/country_collection')
48
+ ->loadData()
49
+ ->toOptionArray(false) ?>
50
+ <?php if (count($_countries) > 0): ?>
51
+ <select name="country" id="country">
52
+ <option value="All Countries">All Countries</option>
53
+ <?php foreach($_countries as $_country): ?>
54
+ <option value="<?php echo $_country['value'] ?>">
55
+ <?php echo $_country['label'] ?>
56
+ </option>
57
+ <?php endforeach; ?>
58
+ </select>
59
+ <?php endif; ?>
60
+ </div>
61
+ </div>
62
+ </li>
63
+ <li class="fields">
64
+ <div class="field">
65
+ <label for="state">State / Province</label>
66
+ <div class="input-box">
67
+ <input name="state" id="state" />
68
+ </div>
69
+ </div>
70
+ <div class="field">
71
+ <label for="city">City</label>
72
+ <div class="input-box">
73
+ <input id="city" name="city" />
74
+ </div>
75
+ </div>
76
+ <div class="field">
77
+ <label for="zip">Zip Code</label>
78
+ <div class="input-box">
79
+ <input id="zip" name="zip" />
80
+ </div>
81
+ </div>
82
+ </li>
83
+ </ul>
84
+ <div class="buttons-set">
85
+ <button type="button" title="Valider" class="button"
86
+ onclick="subm();">
87
+ <span><span>Search</span></span>
88
+ </button>
89
+ </div>
90
+ </form>
91
+ </div>
92
+ </div>
93
+ <script type="text/javascript">
94
+ var map = new google.maps.Map(document.getElementById("map-canvas"));
95
+ var myLocation = new google.maps.LatLng(0.0, 0.0);
96
+ function itiniraire(dest){
97
+ window.open("https://maps.google.com/maps?saddr="+myLocation.toString()+"&daddr=("+dest+")&hl=fr&ie=UTF8&sll=48.885953,2.242912&sspn=0.008113,0.01929&geocode=&oq=&t=h&mra=ls","blank");
98
+ }
99
+ function getLocation() {
100
+ if (navigator.geolocation) {
101
+ navigator.geolocation.getCurrentPosition(showPosition);
102
+ } else {
103
+ alert("Geolocation is not supported by this browser.");
104
+ }
105
+ }
106
+ function showPosition(position) {
107
+ var lat = position.coords.latitude;
108
+ var lng = position.coords.longitude;
109
+ myLocation = new google.maps.LatLng(lat, lng);
110
+ //map.setCenter(new google.maps.LatLng(lat, lng));
111
+ var marker = new google.maps.Marker({
112
+ position: new google.maps.LatLng(lat, lng),
113
+ map: map,
114
+ icon: 'http://www.robotwoods.com/dev/misc/bluecircle.png',
115
+ title: "Your current position"
116
+ });
117
+ }
118
+ function initialize() {
119
+ var mapOptions = {
120
+ center: new google.maps.LatLng(0,0),
121
+ zoom: 1,
122
+ mapTypeId: google.maps.MapTypeId.ROADMAP
123
+ };
124
+ map = new google.maps.Map(document.getElementById("map-canvas"),
125
+ mapOptions);
126
+ getLocation();
127
+ }
128
+
129
+ var markers = [];
130
+ google.maps.event.addDomListener(window, 'load', initialize);
131
+
132
+ function pointStore(lat, long){
133
+ map.panTo(new google.maps.LatLng(lat, long));
134
+ map.setZoom(15);
135
+
136
+ }
137
+ function addMarker(lat, long, name, images){
138
+ var marker = new google.maps.Marker({
139
+ position: new google.maps.LatLng(lat, long),
140
+ map: map,
141
+ title: name
142
+ });
143
+ var contentString = '<div id="content">'+
144
+ '<div id="siteNotice">'+
145
+ '</div>'+
146
+ '<h1 id="firstHeading" class="firstHeading">'+name+'</h1>'+
147
+ '<div id="bodyContent">'+
148
+ '<p>';
149
+ var i=0;
150
+ for(i=0;i<images.length;i++){
151
+ contentString+=images[i];
152
+ }
153
+ //contentString += '<table><tr><td><img src="http://127.0.0.1/magento1/skin/adminhtml/default/default/images/logo.gif" /></td><td><img src="http://127.0.0.1/magento1/skin/frontend/default/default/images/logo.gif" /></td></tr></table>';
154
+ contentString += '</p>'+
155
+ '</div>'+
156
+ '</div>';
157
+ markers.push(marker);
158
+
159
+
160
+ var infowindow = new google.maps.InfoWindow({
161
+ content: contentString
162
+ });
163
+
164
+ google.maps.event.addListener(marker, 'click', function() {
165
+ infowindow.open(map,marker);
166
+ });
167
+ }
168
+
169
+
170
+ </script>
171
+
172
+ <div class="col-2">
173
+ <div id="stores" style="padding:0px; max-height: 300px; overflow: auto; border: 0px;" class="stores fieldset">
174
+ <!-- <h2 class="legend">Stores list</h2> -->
175
+ <table class="data-table">
176
+ <tr>
177
+ <th>Store Name</th>
178
+ <th>Adress</th>
179
+ <th>City</th>
180
+ <th>Country</th>
181
+ <th></th>
182
+ </tr>
183
+ <?php
184
+ $stores = $this->getAllStores ();
185
+ $points = array ();
186
+ $titles = array ();
187
+ foreach ( $stores as $store ) {
188
+ $points [$store ["id"]] = $store ["latitude"] . ',' . $store ["longitude"] . ',"' . $store ["name"] . '"';
189
+ ?>
190
+ <tr>
191
+ <td><a
192
+ href="javascript:pointStore(<?php echo $store["latitude"].','.$store["longitude"];?>);"><?php echo $store["name"];?></a></td>
193
+ <td><?php echo $store["adress"];?></td>
194
+ <td><?php echo $store["city"];?></td>
195
+ <td><?php echo Mage::helper ( 'storeshipper' )->getCountryName($store["country"]);?></td>
196
+ <td>
197
+ <a target="_new"
198
+ href="javascript:itiniraire('<?php echo $store["latitude"].", ".$store["longitude"];?>')"><img src="http://laviouze.free.fr/images/Map.png" width="30px" /></a></td>
199
+ </tr>
200
+ <?php
201
+ }
202
+ ?>
203
+ </table>
204
+ </div>
205
+ </div>
206
+ </div>
207
+ </div>
208
+ <script type="text/javascript">
209
+ function subm(){
210
+ showLoading();
211
+ new Ajax.Request(
212
+ '<?php echo Mage::getBaseUrl(); ?>/stores/index/getStores/',
213
+ {
214
+ method: 'post',
215
+ form: 'search_form',
216
+ parameters: {search:"1", zip:$("zip").getValue(), state:$("state").getValue(), country:$("country").getValue(), city:$("city").getValue() },
217
+ onSuccess: successIt,
218
+ onFailure: function() { console.log('Connection Error !'); }
219
+ }
220
+ );
221
+ }
222
+ function successIt(response) {
223
+ var content = response.responseText;
224
+ var container = $("stores");
225
+ container.update(content);
226
+ container.update($("search-result"));
227
+ //alert('done');
228
+ }
229
+ function showLoading(){
230
+ $("stores").update("");
231
+ var cl = new CanvasLoader('stores');
232
+ cl.setDiameter(30); // default is 40
233
+ cl.setDensity(80); // default is 40
234
+ cl.setRange(0.7); // default is 1.3
235
+ cl.show(); // Hidden by default
236
+ }
237
+
238
+ <?php } ?>
239
+ google.maps.event.addDomListener(window, 'load', function(){
240
+
241
+ <?php
242
+ function dirFiles($directry) {
243
+ $dir = dir ( $directry ); // Open Directory
244
+ if ($dir != NULL) {
245
+ while ( false !== ($file = $dir->read ()) ) // Reads Directory
246
+ {
247
+ $extension = substr ( $file, strrpos ( $file, '.' ) ); // Gets the File
248
+ // Extension
249
+ if ($extension == ".png" || $extension == ".jpg" || $extension == ".bmp" | $extension == ".gif" | $extension == ".jpeg") // Extensions
250
+ // Allowed
251
+ $filesall [$file] = $file; // Store in Array
252
+ }
253
+ $dir->close (); // Close Directory
254
+ asort ( $filesall ); // Sorts the Array
255
+ return $filesall;
256
+ }
257
+
258
+ }
259
+ function getImages($id_store){
260
+ $html = 'new Array(';
261
+ $model_st= Mage::getModel ( 'storeshipper/stores' )->load($id_store);
262
+ $html.='"<p>'.$model_st->getDescription().'</p>",';
263
+ $path = Mage::getBaseDir ( 'media' ) . DS . 'storeshipper' . DS .$id_store. DS;
264
+ $array = dirFiles ( $path );
265
+ if($array !=NULL){
266
+ foreach ( $array as $key => $file ) {
267
+ $p = Mage::getBaseUrl ( Mage_Core_Model_Store::URL_TYPE_MEDIA ) . 'storeshipper/' .$id_store. '/' . $file;
268
+ $html .= '"<a target=\'_blank\' href=\'' . $p . '\'><img style=\'max-width: 150px;\' src=\'' . $p . '\' /></a>",';
269
+ }
270
+ }
271
+ $html .= '"")';
272
+ return $html;
273
+ }
274
+
275
+ foreach ( $points as $key => $p ) {
276
+ echo 'addMarker(' . $p . ','.getImages($key).');';
277
+ }
278
+
279
+ ?>
280
+ var mcOptions = {gridSize: 50, maxZoom: 15};
281
+ var mc = new MarkerClusterer(map,markers, mcOptions);
282
+
283
+
284
+ });
285
+ </script>
286
+
287
+
app/design/frontend/base/default/template/storeshipper/sales/order/details.phtml ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ /**
28
+ * @deprecated after 1.4.0.0-beta1
29
+ */
30
+ ?>
31
+ <?php $_order = $this->getOrder() ?>
32
+ <div class="page-title title-buttons">
33
+ <h1><?php echo $this->__('My Orders - Details') ?></h1>
34
+ <button class="button"><span><span><?php echo $this->__('Print All Invoices') ?></span></span></button>
35
+ </div>
36
+ <h3><?php echo $this->__('Order #%s', $_order->getRealOrderId()) ?></h3>
37
+ <?php foreach ($this->getInvoices() as $_invoice): ?>
38
+ <div class="page-title">
39
+ <h3><?php echo $this->__('Invoice #%s', $_invoice->getIncrementId()) ?></h3>
40
+ <a href="#" class="link-print"><?php echo $this->__('Print Invoice') ?></a>
41
+ </div>
42
+ <div class="col2-set">
43
+ <div class="col-1">
44
+ <h4><?php echo $this->__('Shipping Address') ?></h4>
45
+ <?php $_shipping = $_invoice->getShippingAddress() ?>
46
+ <address><?php echo $_shipping->getFirstname() ?> <?php echo $_shipping->getLastname() ?><br />
47
+ <?php echo $_shipping->getCompany() ?><br />
48
+ <?php echo $_shipping->getStreet() ?><br />
49
+ <?php echo $_shipping->getCity() ?>, <?php echo $_shipping->getRegion() ?> <?php echo $_shipping->getPostcode() ?><br />
50
+ <strong>T</strong> | <?php echo $_shipping->getTelephone();
51
+ if($_shipping->getFax()): ?>
52
+ <br /><strong>F</strong> | <?php echo $_shipping->getFax() ?>
53
+ <?php endif; ?>
54
+ </address>
55
+ </div>
56
+ <div class="col-2">
57
+ <h4><?php echo $this->__('Billing Address') ?></h4>
58
+ <?php $_billing = $_invoice->getbillingAddress() ?>
59
+ <address><?php echo $_billing->getFirstname() ?> <?php echo $_billing->getLastname() ?><br />
60
+ <?php echo $_billing->getCompany() ?><br />
61
+ <?php echo $_billing->getStreet() ?><br />
62
+ <?php echo $_billing->getCity() ?>, <?php echo $_billing->getRegion() ?> <?php echo $_billing->getPostcode() ?><br />
63
+ <strong>T</strong> | <?php echo $_billing->getTelephone();
64
+ if($_billing->getFax()): ?>
65
+ <br /><strong>F</strong> | <?php echo $_billing->getFax() ?>
66
+ <?php endif; ?>
67
+ </address>
68
+ </div>
69
+ </div>
70
+ <br />
71
+ <div class="col2-set">
72
+ <div class="col-1">
73
+ <h4><?php echo $this->__('Shipping Method') ?></h4>
74
+ <?php echo $this->escapeHtml($_order->getShippingMethod()) ?> <?php echo $_order->getShippingDescription() ?>
75
+ </div>
76
+ <div class="col-2">
77
+ <h4><?php echo $this->__('Payment Method') ?></h4>
78
+ <?php $_payment = $_order->getPayment() ?>
79
+ <?php echo $_payment->getMethod() ?>: <?php echo $_payment->getCcType() ?> xxxx<?php echo $_payment->getCcLast4() ?>
80
+ </div>
81
+ </div>
82
+ <br />
83
+ <h4><?php echo $this->__('Items Ordered') ?></h4>
84
+ <table class="data-table">
85
+ <thead>
86
+ <tr>
87
+ <th><?php echo $this->__('Product Name') ?></th>
88
+ <th class="a-right" width="15%"><?php echo $this->__('Price') ?></th>
89
+ <th class="a-center" width="10%"><?php echo $this->__('Qty Ordered') ?></th>
90
+ <th class="a-center" width="10%"><?php echo $this->__('Qty Shipped') ?></th>
91
+ <th class="a-right" width="20%"><?php echo $this->__('Subtotal') ?></th>
92
+ </tr>
93
+ </thead>
94
+ <tbody>
95
+ <?php $_items = $_invoice->getItemsCollection(); ?>
96
+ <?php $_count = $_items->count(); ?>
97
+ <?php $_index = 0; ?>
98
+ <?php foreach ($_items as $_item): ?>
99
+ <tr<?php echo ($_index++ > $_count ? ' class="last"' : '') ?>>
100
+ <td><?php echo $this->htmlEscape($_item->getProductName()) ?></td>
101
+ <td class="a-right"><?php echo $_order->formatPrice($_item->getPrice()*1) ?></td>
102
+ <td class="a-center"><?php echo $_item->getQty()*1 ?></td>
103
+ <td class="a-center"><?php echo $_item->getQty()*1 ?></td>
104
+ <td class="a-right"><?php echo $_order->formatPrice($_item->getRowTotal()*1) ?></td>
105
+ <?php endforeach; ?>
106
+ </tr>
107
+ </tbody>
108
+ <tfoot>
109
+ <tr>
110
+ <td colspan="4" class="a-right"><?php echo $this->__('Order Subtotal') ?></td>
111
+ <td class="a-right"><?php echo $_order->formatPrice($_invoice->getSubtotal()) ?></td>
112
+ </tr>
113
+ </tfoot>
114
+ </table>
115
+ <br />
116
+ <?php endforeach; ?>
app/design/frontend/base/default/template/storeshipper/sales/order/info.phtml ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php /** @var $this Mage_Sales_Block_Order_Info */ ?>
28
+ <?php $_order = $this->getOrder() ?>
29
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
30
+ <div class="page-title title-buttons">
31
+ <h1><?php echo $this->__('Order #%s - %s', $_order->getRealOrderId(), $_order->getStatusLabel()) ?></h1>
32
+ <?php echo $this->getChildHtml('buttons') ?>
33
+ </div>
34
+ <?php echo $this->getStatusHistoryRssUrl($_order) ?>
35
+ <dl class="order-info">
36
+ <dt><?php echo $this->__('About This Order:') ?></dt>
37
+ <dd>
38
+ <?php $_links = $this->getLinks(); ?>
39
+ <ul id="order-info-tabs">
40
+ <?php foreach ($_links as $_link): ?>
41
+ <?php if($_link->getUrl()): ?>
42
+ <li><a href="<?php echo $_link->getUrl() ?>"><?php echo $_link->getLabel() ?></a></li>
43
+ <?php else: ?>
44
+ <li class="current"><?php echo $_link->getLabel() ?></li>
45
+ <?php endif; ?>
46
+ <?php endforeach; ?>
47
+ </ul>
48
+ <script type="text/javascript">decorateGeneric($('order-info-tabs').select('LI'),['first','last']);</script>
49
+ </dd>
50
+ </dl>
51
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
52
+ <?php if (!$_order->getIsVirtual()): ?>
53
+ <div class="col2-set order-info-box">
54
+ <div class="col-1">
55
+ <div class="box">
56
+ <div class="box-title">
57
+ <h2><?php echo $this->__('Shipping Address') ?></h2>
58
+ </div>
59
+ <div class="box-content">
60
+ <address><?php echo $_order->getShippingAddress()->format('html') ?></address>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ <div class="col-2">
65
+ <div class="box">
66
+ <div class="box-title">
67
+ <h2><?php echo $this->__('Shipping Method') ?></h2>
68
+ </div>
69
+ <div class="box-content">
70
+ <?php if ($_order->getShippingDescription()): ?>
71
+ <?php echo $_order->getShippingDescription() ?>
72
+ <?php else: ?>
73
+ <p><?php echo $this->helper('sales')->__('No shipping information available'); ?></p>
74
+ <?php endif; ?>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ <?php endif; ?>
80
+ <div class="col2-set order-info-box">
81
+ <div class="col-1">
82
+ <div class="box">
83
+ <div class="box-title">
84
+ <h2><?php echo $this->__('Billing Address') ?></h2>
85
+ </div>
86
+ <div class="box-content">
87
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
88
+ </div>
89
+ </div>
90
+ </div>
91
+ <div class="col-2">
92
+ <div class="box box-payment">
93
+ <div class="box-title">
94
+ <h2><?php echo $this->__('Payment Method') ?></h2>
95
+ </div>
96
+ <div class="box-content">
97
+ <?php echo $this->getPaymentInfoHtml() ?>
98
+ </div>
99
+ </div>
100
+ </div>
101
+ </div>
app/design/frontend/base/default/template/storeshipper/sales/order/print.phtml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_order = $this->getOrder() ?>
28
+ <h1><?php echo $this->__('Order #%s', $_order->getRealOrderId()) ?></h1>
29
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
30
+ <div class="col2-set">
31
+ <?php if (!$_order->getIsVirtual()): ?>
32
+ <div class="col-1">
33
+ <h2><?php echo $this->__('Shipping Address') ?></h2>
34
+ <address><?php echo $_order->getShippingAddress()->format('html') ?></address>
35
+ </div>
36
+ <div class="col-2">
37
+ <?php else: ?>
38
+ <div class="col-1">
39
+ <?php endif; ?>
40
+ <h2><?php echo $this->__('Billing Address') ?></h2>
41
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
42
+ </div>
43
+ <?php if (!$_order->getIsVirtual()): ?>
44
+ </div>
45
+ <div class="col2-set">
46
+ <div class="col-1">
47
+ <h2><?php echo $this->__('Shipping Method') ?></h2>
48
+ <?php echo $_order->getShippingDescription() ?>
49
+ </div>
50
+ <?php endif; ?>
51
+ <div class="col-2">
52
+ <h2><?php echo $this->__('Payment Method') ?></h2>
53
+ <?php echo $this->getPaymentInfoHtml() ?>
54
+ </div>
55
+ </div>
56
+ <h2><?php echo $this->__('Items Ordered') ?></h2>
57
+ <table class="data-table" id="my-orders-table">
58
+ <col />
59
+ <col width="1" />
60
+ <col width="1" />
61
+ <col width="1" />
62
+ <col width="1" />
63
+ <thead>
64
+ <tr>
65
+ <th><?php echo $this->__('Product Name') ?></th>
66
+ <th><?php echo $this->__('SKU') ?></th>
67
+ <th class="a-right"><?php echo $this->__('Price') ?></th>
68
+ <th class="a-center"><?php echo $this->__('Qty') ?></th>
69
+ <th class="a-right"><?php echo $this->__('Subtotal') ?></th>
70
+ </tr>
71
+ </thead>
72
+ <tfoot>
73
+ <?php echo $this->getChildHtml('order_totals') ?>
74
+ </tfoot>
75
+ <?php $_items = $_order->getItemsCollection(); ?>
76
+ <?php $_count = $_items->count(); ?>
77
+ <?php foreach ($_items as $_item): ?>
78
+ <?php if ($_item->getParentItem()) continue; ?>
79
+ <tbody>
80
+ <?php echo $this->getItemHtml($_item) ?>
81
+ </tbody>
82
+ <?php endforeach; ?>
83
+ </table>
84
+ <script type="text/javascript">decorateTable('my-orders-table', {'tbody' : ['odd', 'even'], 'tbody tr' : ['first', 'last']})</script>
85
+ <script type="text/javascript">window.print();</script>
app/design/frontend/base/default/template/storeshipper/sales/order/print/creditmemo.phtml ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_order = $this->getOrder() ?>
28
+ <h1><?php echo $this->__('Order #%s', $_order->getRealOrderId()) ?></h1>
29
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
30
+ <?php $_creditmemo = $this->getCreditmemo() ?>
31
+ <?php if($_creditmemo): ?>
32
+ <?php $_creditmemos = array($_creditmemo); ?>
33
+ <?php else: ?>
34
+ <?php $_creditmemos = $_order->getCreditmemosCollection() ?>
35
+ <?php endif; ?>
36
+ <?php foreach ($_creditmemos as $_creditmemo): ?>
37
+ <h2 class="h2"><?php echo $this->__('Refund #%s', $_creditmemo->getIncrementId()) ?></h2>
38
+ <div class="col2-set">
39
+ <div class="col-1">
40
+ <?php if (!$_order->getIsVirtual()): ?>
41
+ <h3><?php echo $this->__('Shipping Address') ?></h3>
42
+ <?php $_shipping = $_creditmemo->getShippingAddress() ?>
43
+ <address><?php echo $_shipping->format('html') ?></address>
44
+ </div>
45
+ <div class="col-2">
46
+ <?php endif; ?>
47
+ <h3><?php echo $this->__('Billing Address') ?></h3>
48
+ <?php $_billing = $_creditmemo->getbillingAddress() ?>
49
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
50
+ </div>
51
+ <?php if (!$_order->getIsVirtual()): ?>
52
+ </div>
53
+ <div class="col2-set">
54
+ <div class="col-1">
55
+ <h3><?php echo $this->__('Shipping Method') ?></h3>
56
+ <?php echo $this->escapeHtml($_order->getShippingDescription()) ?>
57
+ </div>
58
+ <?php endif; ?>
59
+ <div class="col-2">
60
+ <h3><?php echo $this->__('Payment Method') ?></h3>
61
+ <?php echo $this->getPaymentInfoHtml() ?>
62
+ </div>
63
+ </div>
64
+ <h3><?php echo $this->__('Items Refunded') ?></h3>
65
+ <table class="data-table" id="my-refund-table-<?php echo $_creditmemo->getId(); ?>">
66
+ <col />
67
+ <col width="1" />
68
+ <col width="1" />
69
+ <col width="1" />
70
+ <col width="1" />
71
+ <col width="1" />
72
+ <col width="1" />
73
+ <thead>
74
+ <tr>
75
+ <th><?php echo $this->__('Product Name') ?></th>
76
+ <th><?php echo $this->__('SKU') ?></th>
77
+ <th class="a-right"><?php echo $this->__('Price') ?></th>
78
+ <th class="a-center"><?php echo $this->__('Qty') ?></th>
79
+ <th class="a-right"><?php echo $this->__('Subtotal') ?></th>
80
+ <th class="a-center wrap"><?php echo $this->__('Discount Amount') ?></th>
81
+ <th class="a-center wrap"><?php echo $this->__('Row Total') ?></th>
82
+ </tr>
83
+ </thead>
84
+ <tfoot>
85
+ <?php echo $this->getTotalsHtml($_creditmemo);?>
86
+ </tfoot>
87
+ <?php $_items = $_creditmemo->getAllItems(); ?>
88
+ <?php $_count = count($_items); ?>
89
+ <?php foreach ($_items as $_item): ?>
90
+ <?php if ($_item->getOrderItem()->getParentItem()) continue; ?>
91
+ <tbody>
92
+ <?php echo $this->getItemHtml($_item) ?>
93
+ </tbody>
94
+ <?php endforeach; ?>
95
+ </table>
96
+ <script type="text/javascript">decorateTable('my-refund-table-<?php echo $_creditmemo->getId(); ?>', {'tbody' : ['odd', 'even'], 'tbody tr' : ['first', 'last']})</script>
97
+ <?php endforeach; ?>
98
+ <script type="text/javascript">window.print();</script>
app/design/frontend/base/default/template/storeshipper/sales/order/print/invoice.phtml ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_order = $this->getOrder() ?>
28
+ <h1><?php echo $this->__('Order #%s', $_order->getRealOrderId()) ?></h1>
29
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
30
+ <?php $_invoice = $this->getInvoice() ?>
31
+ <?php if($_invoice): ?>
32
+ <?php $_invoices = array($_invoice); ?>
33
+ <?php else: ?>
34
+ <?php $_invoices = $_order->getInvoiceCollection() ?>
35
+ <?php endif; ?>
36
+ <?php foreach ($_invoices as $_invoice): ?>
37
+ <h2 class="h2"><?php echo $this->__('Invoice #%s', $_invoice->getIncrementId()) ?></h2>
38
+ <div class="col2-set">
39
+ <div class="col-1">
40
+ <?php if (!$_order->getIsVirtual()): ?>
41
+ <h3><?php echo $this->__('Shipping Address') ?></h3>
42
+ <?php $_shipping = $_invoice->getShippingAddress() ?>
43
+ <address><?php echo $_shipping->format('html') ?></address>
44
+ </div>
45
+ <div class="col-2">
46
+ <?php endif; ?>
47
+ <h3><?php echo $this->__('Billing Address') ?></h3>
48
+ <?php $_billing = $_invoice->getbillingAddress() ?>
49
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
50
+ </div>
51
+ <?php if (!$_order->getIsVirtual()): ?>
52
+ </div>
53
+ <div class="col2-set">
54
+ <div class="col-1">
55
+ <h3><?php echo $this->__('Shipping Method') ?></h3>
56
+ <?php echo $_order->getShippingDescription() ?>
57
+ </div>
58
+ <?php endif; ?>
59
+ <div class="col-2">
60
+ <h3><?php echo $this->__('Payment Method') ?></h3>
61
+ <?php echo $this->getPaymentInfoHtml() ?>
62
+ </div>
63
+ </div>
64
+ <h3><?php echo $this->__('Items Invoiced') ?></h3>
65
+ <table class="data-table" id="my-invoice-table-<?php echo $_invoice->getId(); ?>">
66
+ <col />
67
+ <col width="1" />
68
+ <col width="1" />
69
+ <col width="1" />
70
+ <col width="1" />
71
+ <thead>
72
+ <tr>
73
+ <th><?php echo $this->__('Product Name') ?></th>
74
+ <th><?php echo $this->__('SKU') ?></th>
75
+ <th class="a-right"><?php echo $this->__('Price') ?></th>
76
+ <th class="a-center"><span class="nobr"><?php echo $this->__('Qty Invoiced') ?></span></th>
77
+ <th class="a-right"><?php echo $this->__('Subtotal') ?></th>
78
+ </tr>
79
+ </thead>
80
+ <tfoot>
81
+ <?php echo $this->getInvoiceTotalsHtml($_invoice)?>
82
+ </tfoot>
83
+ <?php $_items = $_invoice->getItemsCollection(); ?>
84
+ <?php $_count = $_items->count(); ?>
85
+ <?php foreach ($_items as $_item): ?>
86
+ <?php if ($_item->getOrderItem()->getParentItem()) continue; ?>
87
+ <tbody>
88
+ <?php echo $this->getItemHtml($_item) ?>
89
+ </tbody>
90
+ <?php endforeach; ?>
91
+ </table>
92
+ <script type="text/javascript">decorateTable('my-invoice-table-<?php echo $_invoice->getId(); ?>', {'tbody' : ['odd', 'even'], 'tbody tr' : ['first', 'last']})</script>
93
+ <?php endforeach; ?>
94
+ <script type="text/javascript">window.print();</script>
app/design/frontend/proxymit/default/template/sales/order/info.phtml ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php /** @var $this Mage_Sales_Block_Order_Info */ ?>
28
+ <?php $_order = $this->getOrder() ?>
29
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
30
+ <div class="page-title title-buttons">
31
+ <h1><?php echo $this->__('Order #%s - %s', $_order->getRealOrderId(), $_order->getStatusLabel()) ?></h1>
32
+ <?php echo $this->getChildHtml('buttons') ?>
33
+ </div>
34
+ <?php echo $this->getStatusHistoryRssUrl($_order) ?>
35
+ <dl class="order-info">
36
+ <dt><?php echo $this->__('About This Order:') ?></dt>
37
+ <dd>
38
+ <?php $_links = $this->getLinks(); ?>
39
+ <ul id="order-info-tabs">
40
+ <?php foreach ($_links as $_link): ?>
41
+ <?php if($_link->getUrl()): ?>
42
+ <li><a href="<?php echo $_link->getUrl() ?>"><?php echo $_link->getLabel() ?></a></li>
43
+ <?php else: ?>
44
+ <li class="current"><?php echo $_link->getLabel() ?></li>
45
+ <?php endif; ?>
46
+ <?php endforeach; ?>
47
+ </ul>
48
+ <script type="text/javascript">decorateGeneric($('order-info-tabs').select('LI'),['first','last']);</script>
49
+ </dd>
50
+ </dl>
51
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
52
+ <?php if (!$_order->getIsVirtual()): ?>
53
+ <div class="col2-set order-info-box">
54
+ <div class="col-1">
55
+ <div class="box">
56
+ <div class="box-title">
57
+ <h2><?php echo $this->__('Shipping Address') ?></h2>
58
+ </div>
59
+ <div class="box-content">
60
+ <address><?php echo $_order->getShippingAddress()->format('html') ?></address>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ <div class="col-2">
65
+ <div class="box">
66
+ <div class="box-title">
67
+ <h2><?php echo $this->__('Shipping Method') ?></h2>
68
+ </div>
69
+ <div class="box-content">
70
+ <?php if ($_order->getShippingDescription()): ?>
71
+ <?php echo $_order->getShippingDescription() ?>
72
+ <?php else: ?>
73
+ <p><?php echo $this->helper('sales')->__('No shipping information available'); ?></p>
74
+ <?php endif; ?>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ <?php endif; ?>
80
+ <div class="col2-set order-info-box">
81
+ <div class="col-1">
82
+ <div class="box">
83
+ <div class="box-title">
84
+ <h2><?php echo $this->__('Billing Address') ?></h2>
85
+ </div>
86
+ <div class="box-content">
87
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
88
+ </div>
89
+ </div>
90
+ </div>
91
+ <div class="col-2">
92
+ <div class="box box-payment">
93
+ <div class="box-title">
94
+ <h2><?php echo $this->__('Payment Method') ?></h2>
95
+ </div>
96
+ <div class="box-content">
97
+ <?php echo $this->getPaymentInfoHtml() ?>
98
+ </div>
99
+ </div>
100
+ </div>
101
+ </div>
app/etc/modules/Proxymit_Pickup.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Proxymit_Pickup>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Proxymit_Pickup>
8
+ </modules>
9
+ </config>
app/etc/modules/Proxymit_StoreShipper.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Proxymit_StoreShipper>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <depends>
8
+ <Proxymit_Pickup />
9
+ </depends>
10
+ </Proxymit_StoreShipper>
11
+ </modules>
12
+ </config>
app/locale/en_US/template/email/sales/storeshipper_customer.html ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject {{var store.getFrontendName()}}: New Order # {{var order.increment_id}} @-->
2
+ <!--@vars
3
+ {"store url=\"\"":"Store Url",
4
+ "var logo_url":"Email Logo Image Url",
5
+ "var logo_alt":"Email Logo Image Alt",
6
+ "htmlescape var=$order.getCustomerName()":"Customer Name",
7
+ "var store.getFrontendName()":"Store Name",
8
+ "store url=\"customer/account/\"":"Customer Account Url",
9
+ "var order.increment_id":"Order Id",
10
+ "var order.getCreatedAtFormated('long')":"Order Created At (datetime)",
11
+ "var order.getBillingAddress().format('html')":"Billing Address",
12
+ "var payment_html":"Payment Details",
13
+ "var order.getShippingAddress().format('html')":"Shipping Address",
14
+ "var order.getShippingDescription()":"Shipping Description",
15
+ "layout handle=\"sales_email_order_items\" order=$order":"Order Items Grid",
16
+ "var order.getEmailCustomerNote()":"Email Order Note"}
17
+ @-->
18
+ <!--@styles
19
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
20
+ @-->
21
+
22
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
23
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
24
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
25
+ <tr>
26
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
27
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
28
+ <!-- [ header starts here] -->
29
+ <tr>
30
+ <td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
31
+ </tr>
32
+ <!-- [ middle starts here] -->
33
+ <tr>
34
+ <td valign="top">
35
+ <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hello, {{htmlescape var=$order.getCustomerName()}}</h1>
36
+ <p style="font-size:12px; line-height:16px; margin:0;">
37
+ Thank you for your order from {{var store.getFrontendName()}}.
38
+ <b>You have a shippement at our store.</b>
39
+ You can check the status of your order by <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">logging into your account</a>.
40
+ If you have any questions about your order please contact us at <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or call us at <span class="nobr">{{config path='general/store_information/phone'}}</span> Monday - Friday, 8am - 5pm PST.
41
+ </p>
42
+ <p style="font-size:12px; line-height:16px; margin:0;">Your order confirmation is below. Thank you again for your business.</p>
43
+ </tr>
44
+ <tr>
45
+ <td>
46
+ <h2 style="font-size:18px; font-weight:normal; margin:0;">Your Order #{{var order.increment_id}} <small>(placed on {{var order.getCreatedAtFormated('long')}})</small></h2>
47
+ </td>
48
+ </tr>
49
+ <tr>
50
+ <td>
51
+ {{depend order.getIsNotVirtual()}}
52
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
53
+ <thead>
54
+ <tr>
55
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Information:</th>
56
+ <th width="10"></th>
57
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Method:</th>
58
+ </tr>
59
+ </thead>
60
+ <tbody>
61
+ <tr>
62
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
63
+ {{var order.getShippingAddress().format('html')}}
64
+ &nbsp;
65
+ </td>
66
+ <td>&nbsp;</td>
67
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
68
+ {{var order.getShippingDescription()}}
69
+ &nbsp;
70
+ </td>
71
+ </tr>
72
+ </tbody>
73
+ </table>
74
+
75
+
76
+ <br/>
77
+ {{/depend}}
78
+ {{layout handle="sales_email_order_items" order=$order}}
79
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
80
+ <thead>
81
+ <tr>
82
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Billing Information:</th>
83
+ <th width="10"></th>
84
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Payment Method:</th>
85
+ </tr>
86
+ </thead>
87
+ <tbody>
88
+ <tr>
89
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
90
+ {{var order.getBillingAddress().format('html')}}
91
+ </td>
92
+ <td>&nbsp;</td>
93
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
94
+ {{var payment_html}}
95
+ </td>
96
+ </tr>
97
+ </tbody>
98
+ </table>
99
+
100
+ <br/>
101
+ <p style="font-size:12px; margin:0 0 10px 0">{{var order.getEmailCustomerNote()}}</p>
102
+ </td>
103
+ </tr>
104
+ <tr>
105
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
106
+ </tr>
107
+ </table>
108
+ </td>
109
+ </tr>
110
+ </table>
111
+ </div>
112
+ </body>
app/locale/en_US/template/email/sales/storeshipper_manager.html ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject {{var store.getFrontendName()}}: New Order # {{var order.increment_id}} @-->
2
+ <!--@vars
3
+ {"store url=\"\"":"Store Url",
4
+ "var logo_url":"Email Logo Image Url",
5
+ "var logo_alt":"Email Logo Image Alt",
6
+ "htmlescape var=$order.getCustomerName()":"Customer Name",
7
+ "var store.getFrontendName()":"Store Name",
8
+ "store url=\"customer/account/\"":"Customer Account Url",
9
+ "var order.increment_id":"Order Id",
10
+ "var order.getCreatedAtFormated('long')":"Order Created At (datetime)",
11
+ "var order.getBillingAddress().format('html')":"Billing Address",
12
+ "var payment_html":"Payment Details",
13
+ "var order.getShippingAddress().format('html')":"Shipping Address",
14
+ "var order.getShippingDescription()":"Shipping Description",
15
+ "layout handle=\"sales_email_order_items\" order=$order":"Order Items Grid",
16
+ "var order.getEmailCustomerNote()":"Email Order Note",
17
+ "var order.getCustomerEmail()":"Customer Email",
18
+ "var order.getCustomerName()":"Customer Name"}
19
+ @-->
20
+ <!--@styles
21
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
22
+ @-->
23
+
24
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
25
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
26
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
27
+ <tr>
28
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
29
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
30
+ <!-- [ header starts here] -->
31
+ <tr>
32
+ <td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
33
+ </tr>
34
+ <!-- [ middle starts here] -->
35
+ <tr>
36
+ <td valign="top">
37
+ <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hello, {{htmlescape var=$order.getCustomerName()}}</h1>
38
+ <p style="font-size:12px; line-height:16px; margin:0;">
39
+ <b>You have an order for shippement from {{var store.getFrontendName()}}.</b>
40
+ If you have any questions about this order please contact us at <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or call us at <span class="nobr">{{config path='general/store_information/phone'}}</span> Monday - Friday, 8am - 5pm PST.
41
+ </p>
42
+
43
+ </tr>
44
+ <tr>
45
+ <td>
46
+ <h2 style="font-size:18px; font-weight:normal; margin:0;">Order #{{var order.increment_id}} <small>(placed on {{var order.getCreatedAtFormated('long')}})</small></h2>
47
+ </td>
48
+ </tr>
49
+ <tr>
50
+
51
+ <td>
52
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
53
+ <thead>
54
+ <tr>
55
+ <th align="left" width="650" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Customer Information:</th>
56
+ </tr>
57
+ </thead>
58
+ <tbody>
59
+ <tr>
60
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
61
+ <b>Full Name : </b>{{var order.getCustomerName()}}<br />
62
+ <b>Email : </b>{{var order.getCustomerEmail()}} <br />
63
+
64
+ &nbsp;
65
+ </td>
66
+ </tr>
67
+ </tbody>
68
+ </table><br />
69
+ {{layout handle="sales_email_order_items" order=$order}}
70
+ <br /><br />
71
+ {{depend order.getIsNotVirtual()}}
72
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
73
+ <thead>
74
+ <tr>
75
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Information:</th>
76
+ <th width="10"></th>
77
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Method:</th>
78
+ </tr>
79
+ </thead>
80
+ <tbody>
81
+ <tr>
82
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
83
+ {{var order.getShippingAddress().format('html')}}
84
+ &nbsp;
85
+ </td>
86
+ <td>&nbsp;</td>
87
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
88
+ {{var order.getShippingDescription()}}
89
+ &nbsp;
90
+ </td>
91
+ </tr>
92
+ </tbody>
93
+ </table>
94
+
95
+
96
+ <br/>
97
+ {{/depend}}
98
+
99
+
100
+ <br/>
101
+ <p style="font-size:12px; margin:0 0 10px 0">{{var order.getEmailCustomerNote()}}</p>
102
+ </td>
103
+ </tr>
104
+ <tr>
105
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
106
+ </tr>
107
+ </table>
108
+ </td>
109
+ </tr>
110
+ </table>
111
+ </div>
112
+ </body>
package.xml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Proxymit_StoreShipper</name>
4
+ <version>1.0.1</version>
5
+ <stability>stable</stability>
6
+ <license>GNU General Public License (GPL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Store Shipper is a delivery extension that allows customers to receive their products in the nearest store when choosing a delivery method in the checkout page.</summary>
10
+ <description>Store Shipper is a delivery extension that allows customers to receive their products in the nearest store when choosing a delivery method in the checkout page.&#xD;
11
+ It has a back-office interface to manage the details of your stores (ex. Location, Address, Contact coordinates, Schedule of working hours and days ...) with a notification emails to both customers and store owners.&#xD;
12
+ </description>
13
+ <notes>This is an initial submission.&#xD;
14
+ Please feel free to contact us in case of troubleshooting.</notes>
15
+ <authors><author><name>Proxym Group</name><user>Proxym_IT</user><email>magento@proxym-group.com</email></author><author><name>Kais Elouragini</name><user>kaisinter</user><email>kais.elouragini@gmail.com</email></author></authors>
16
+ <date>2015-05-18</date>
17
+ <time>08:12:00</time>
18
+ <contents><target name="magecommunity"><dir name="Proxymit"><dir name="Pickup"><dir name="Block"><file name="Pickup.php" hash="3c7707d7afb5fd8c324f272b6a06be39"/></dir><dir name="Helper"><file name="Data.php" hash="ecf62e258e7c12aa86de4bac15c25a32"/></dir><dir name="Model"><dir name="Carrier"><file name="Pickup.php" hash="a0956839e99a2f606d80dcf7d5e336af"/></dir><dir name="Mysql4"><dir name="Pickup"><file name="Collection.php" hash="79e0f31beff5db9cf37beb6c94ee832b"/></dir><file name="Pickup.php" hash="216c7325f405761b14cbedde449d2cb6"/></dir><file name="Observer.php" hash="5f83ef6b65f99e439a9385ec02e13853"/><file name="Pickup.php" hash="9ed2ad2889e017c1fab32cca4c8355f8"/><dir name="Sales"><file name="Order.php" hash="712cf95fdcebdcd7b9695aedaa88ed2e"/></dir></dir><dir name="etc"><file name="config.xml" hash="ac40b8cdda80bf97ba47177e78b9af93"/><file name="system.xml" hash="64f86253ba611f0fcafd8a9dc055a757"/></dir><dir name="sql"><dir name="pickup_setup"><file name="mysql4-install-0.1.0.php" hash="52c6c1b853ca325914901d86e7d30597"/></dir></dir></dir><dir name="StoreShipper"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="View.php" hash="54f6de1fed7c9023b484ae767f3834fd"/></dir></dir><dir name="Stores"><dir name="Edit"><file name="Button.php" hash="0a1ca8110d14131fef663274cddfb9a4"/><file name="Country.php" hash="b51205ca2ae9bf753ba6759698aba3d5"/><file name="Form.php" hash="b00e363afd28df06dffec013e1037c4d"/><file name="Html.php" hash="c1092b7b84e7e0aeacf525505b9fb622"/><file name="Images.php" hash="6b907f6496fb543f2ff601e8d4c96e5a"/><file name="Map.php" hash="5e697f39d1e75b46d0282516d3288c94"/><file name="StoreViewColumn.php" hash="2c36ba4bba1e4ca3c73951c9a64bc933"/><dir name="Tab"><file name="Contact.php" hash="ed80b6a8e0a71c10109ddd8d9d24506c"/><file name="Form.php" hash="27a0a553a8e5a45b8ee1ac2bdc103c22"/><file name="Geo.php" hash="c48c1df95b3e8d98930d8d63300116b5"/><file name="Grid.php" hash="89a9105c4208e8f01920b3b6a4957744"/><file name="Orders.php" hash="291f387975d9157c67a7705d5840443d"/><file name="Schedule.php" hash="32e1d2c6bb6fb48cfd5a527252a04075"/></dir><file name="Tabs.php" hash="5edef8c10c42c7ba17c974a2c762f933"/></dir><file name="Edit.php" hash="143a89809c04d9a0d7f0a88a27b46552"/><file name="Grid.php" hash="478a9bd09cc964831e95226676901b9e"/></dir><file name="Stores.php" hash="6d1b31b17463dc95836ff622cf1ebc74"/></dir><file name="OurStores.php" hash="9748faf9ae758c86dcd873e0f11da6d8"/><dir name="Sales"><dir name="Order"><file name="Details.php" hash="d8c40cf76dfe2b0ed60e20664efba413"/><file name="Info.php" hash="d5a334a930990147176db75a1414fd73"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="4db730c74e14cd4efc282a400d914dca"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Grid"><file name="Collection.php" hash="0a0cf92a30d0a5975bad8a7a5182600b"/></dir><file name="Grid.php" hash="ae16af89aecc74bcf52a61a9b4ec5187"/><dir name="Orders"><file name="Collection.php" hash="d029e22562052a3016780de47dd1a776"/></dir><file name="Orders.php" hash="d19868310aee510808f8ed977fae066b"/><dir name="Pickup"><file name="Collection.php" hash="826510bf7d5e3a9c2f85d2f02e0510b7"/></dir><dir name="Schedule"><file name="Collection.php" hash="0a9f8bd84b026e04fc537342948c27ce"/></dir><file name="Schedule.php" hash="d4d53ff739fb2f39b9b667f9b413a9f1"/><dir name="Stores"><file name="Collection.php" hash="a7332f6deb916116e9eb258f0a1d7db4"/></dir><file name="Stores.php" hash="2b485a9a369e71dd411dabcef992b1f4"/></dir><file name="Orders.php" hash="bfd510d47f89e711dfc25194617adac3"/><file name="Schedule.php" hash="7dc8e5d93a90298d4d259c3dc5381a2d"/><file name="Stores.php" hash="3573385d27ce0686f037bc173bcc8274"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="cc2aa3a88eecc35131449a3dadd33d44"/></dir><file name="IndexController.php" hash="8ace1e5cb99e7238d68921966a421f40"/></dir><dir name="etc"><file name="adminhtml.xml" hash="1b6752942dc3b158c510197e828b7114"/><file name="config.xml" hash="fc6ba83e7d3811fe840cd6f5e877298b"/></dir><dir name="sql"><dir name="storeshipper_setup"><file name="mysql4-install-0.0.1.php" hash="3758034b948bec840b58b2c8c239e9d0"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="storeshipper.xml" hash="b761b39334537ddd20f9816903fb28c5"/></dir><dir name="template"><dir name="storeshipper"><dir name="sales"><file name="info.phtml" hash="3cb149a18b801d0a79394fc07125a6eb"/><dir name="order"><dir name="creditmemo"><dir name="create"><file name="form.phtml" hash="1c5f908d7f210a5020a72ce12dec215b"/></dir><dir name="view"><file name="form.phtml" hash="cbb0b183c4d7891c94a291e81705db39"/></dir></dir><dir name="invoice"><dir name="create"><file name="form.phtml" hash="e6455ad14f099971af1298cf9fa85537"/></dir><dir name="view"><file name="form.phtml" hash="541d7cfd141f40d990b5174f922590ef"/></dir></dir><dir name="shipment"><dir name="create"><file name="form.phtml" hash="6088357bbc6c1809b3c9dd8fa421dd12"/></dir><dir name="view"><file name="form.phtml" hash="fa14a8a546db34b412071a132c00a8c0"/></dir></dir></dir></dir><file name="stores.phtml" hash="f84214fc43f665c79b92dc7a092b364f"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pickup.xml" hash="939372e4fccfda4858fb9897ba058aa5"/><file name="storeshipper.xml" hash="67097046746c80242734e1906e7000bb"/></dir><dir name="template"><dir name="pickup"><dir name="checkout"><dir name="onepage"><dir name="shipping_method"><file name="available.phtml" hash="b6f05f400203a552938f6516b285116f"/></dir></dir></dir><file name="pickup.phtml" hash="378e2d7cfb97a9e793b285fa61afe25b"/></dir><dir name="storeshipper"><file name="ourstores.phtml" hash="3261e0be928e7e40ad6d31976b934fa8"/><dir name="sales"><dir name="order"><file name="details.phtml" hash="1d55d81837b49180f936d336e6affff7"/><file name="info.phtml" hash="4c8852b5dcfbbc5c5091a29e1930289e"/><dir name="print"><file name="creditmemo.phtml" hash="9de481f4fec7e3358a659b749cb3016d"/><file name="invoice.phtml" hash="a199ce301ab6bdbeedfd4752c2c85b9b"/></dir><file name="print.phtml" hash="35d1b5ffaf9cf17199b021b66494f868"/></dir></dir></dir></dir></dir></dir><dir name="proxymit"><dir name="default"><dir name="template"><dir name="sales"><dir name="order"><file name="info.phtml" hash="38482e9412c9d69349070a4b349784c3"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="sales"><file name="storeshipper_customer.html" hash="bc7196d3d1c2d248eb8e8949c266211f"/><file name="storeshipper_manager.html" hash="bddaf245c893560c2f0d5f9a1c85c527"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Proxymit_Pickup.xml" hash="3927e43fd741918c4097099eda5d9d5d"/><file name="Proxymit_StoreShipper.xml" hash="c2449245e0564b56b5dc48d512b0f722"/></dir></target><target name="magelocal"><dir name="frontend"><dir name="proxymit"><dir name="default"><dir name="template"><dir name="sales"><dir name="order"><dir name="print"><file name="creditmemo.phtml" hash=""/></dir></dir></dir></dir></dir></dir></dir></target></contents>
19
+ <compatible/>
20
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
21
+ </package>