├── README.md ├── admin ├── controller │ └── shipping │ │ └── my.php ├── language │ └── zh-CN │ │ └── shipping │ │ └── my.php └── view │ └── template │ └── shipping │ └── my.tpl └── catalog ├── language └── zh-CN │ └── shipping │ └── my.php └── model └── shipping └── my.php /README.md: -------------------------------------------------------------------------------- 1 | opencart-shipping-plugin 2 | ======================== 3 | 4 | opencart 自定义灵活配送插件 5 | 具体介绍:http://www.yuansir-web.com/?p=509 6 | -------------------------------------------------------------------------------- /admin/controller/shipping/my.php: -------------------------------------------------------------------------------- 1 | load->language('shipping/my'); 14 | 15 | $this->document->setTitle($this->language->get('heading_title')); 16 | 17 | $this->load->model('setting/setting'); 18 | 19 | if (($this->request->server['REQUEST_METHOD'] == 'POST')) { 20 | 21 | $this->model_setting_setting->editSetting('my', $this->request->post); 22 | 23 | $this->session->data['success'] = $this->language->get('text_success'); 24 | 25 | $this->redirect($this->url->link('extension/shipping', 'token=' . $this->session->data['token'], 'SSL')); 26 | } 27 | 28 | $this->data['heading_title'] = $this->language->get('heading_title'); 29 | 30 | 31 | $this->data['button_save'] = $this->language->get('button_save'); 32 | $this->data['button_cancel'] = $this->language->get('button_cancel'); 33 | 34 | $this->data['tab_general'] = $this->language->get('tab_general'); 35 | 36 | $this->data['heading_title'] = $this->language->get('heading_title'); 37 | 38 | if (isset($this->error['warning'])) { 39 | $this->data['error_warning'] = $this->error['warning']; 40 | } else { 41 | $this->data['error_warning'] = ''; 42 | } 43 | 44 | $this->data['breadcrumbs'] = array(); 45 | 46 | $this->data['breadcrumbs'][] = array( 47 | 'text' => $this->language->get('text_home'), 48 | 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 49 | 'separator' => false 50 | ); 51 | 52 | $this->data['breadcrumbs'][] = array( 53 | 'text' => $this->language->get('text_shipping'), 54 | 'href' => $this->url->link('extension/shipping', 'token=' . $this->session->data['token'], 'SSL'), 55 | 'separator' => ' :: ' 56 | ); 57 | 58 | $this->data['breadcrumbs'][] = array( 59 | 'text' => $this->language->get('heading_title'), 60 | 'href' => $this->url->link('shipping/my', 'token=' . $this->session->data['token'], 'SSL'), 61 | 'separator' => ' :: ' 62 | ); 63 | 64 | $this->data['action'] = $this->url->link('shipping/my', 'token=' . $this->session->data['token'], 'SSL'); 65 | 66 | $this->data['cancel'] = $this->url->link('extension/shipping', 'token=' . $this->session->data['token'], 'SSL'); 67 | 68 | if (isset($this->request->post['my_common'])) { 69 | $this->data['my_common'] = $this->request->post['my_common']; 70 | } else { 71 | $this->data['my_common'] = $this->config->get('my_common'); 72 | } 73 | 74 | if (isset($this->request->post['my_free'])) { 75 | $this->data['my_free'] = $this->request->post['my_free']; 76 | } else { 77 | $this->data['my_free'] = $this->config->get('my_free'); 78 | } 79 | 80 | if (isset($this->request->post['my_single_add'])) { 81 | $this->data['my_single_add'] = $this->request->post['my_single_add']; 82 | } else { 83 | $this->data['my_single_add'] = $this->config->get('my_single_add'); 84 | } 85 | 86 | if (isset($this->request->post['my_special_id'])) { 87 | $this->data['my_special_id'] = $this->request->post['my_special_id']; 88 | } else { 89 | $this->data['my_special_id'] = $this->config->get('my_special_id'); 90 | } 91 | 92 | if (isset($this->request->post['my_special_single_price'])) { 93 | $this->data['my_special_single_price'] = $this->request->post['my_special_single_price']; 94 | } else { 95 | $this->data['my_special_single_price'] = $this->config->get('my_special_single_price'); 96 | } 97 | 98 | if (isset($this->request->post['my_special_zone_price'])) { 99 | $this->data['my_special_zone_price'] = $this->request->post['my_special_zone_price']; 100 | } else { 101 | $this->data['my_special_zone_price'] = $this->config->get('my_special_zone_price'); 102 | } 103 | 104 | if (isset($this->request->post['my_special_geo_zone_id'])) { 105 | $this->data['my_special_geo_zone_id'] = $this->request->post['my_special_geo_zone_id']; 106 | } else { 107 | $this->data['my_special_geo_zone_id'] = $this->config->get('my_special_geo_zone_id'); 108 | } 109 | 110 | if (isset($this->request->post['my_geo_zone_id'])) { 111 | $this->data['my_geo_zone_id'] = $this->request->post['my_geo_zone_id']; 112 | } else { 113 | $this->data['my_geo_zone_id'] = $this->config->get('my_geo_zone_id'); 114 | } 115 | 116 | if (isset($this->request->post['my_status'])) { 117 | $this->data['my_status'] = $this->request->post['my_status']; 118 | } else { 119 | $this->data['my_status'] = $this->config->get('my_status'); 120 | } 121 | 122 | if (isset($this->request->post['my_sort_order'])) { 123 | $this->data['my_sort_order'] = $this->request->post['my_sort_order']; 124 | } else { 125 | $this->data['my_sort_order'] = $this->config->get('my_sort_order'); 126 | } 127 | 128 | 129 | 130 | $this->load->model('localisation/geo_zone'); 131 | $this->data['geo_zones'] = $this->model_localisation_geo_zone->getGeoZones(); 132 | 133 | $this->template = 'shipping/my.tpl'; 134 | 135 | $this->children = array( 136 | 'common/header', 137 | 'common/footer', 138 | ); 139 | 140 | $this->response->setOutput($this->render()); 141 | } 142 | 143 | } 144 | -------------------------------------------------------------------------------- /admin/language/zh-CN/shipping/my.php: -------------------------------------------------------------------------------- 1 | 2 |
