示例#1
0
 private function getForm()
 {
     if ($this->getConfig()->get('wk_auction_timezone_set')) {
         if (sizeof($this->model->getAuctions())) {
             $this->data['isauction'] = $this->model->getAuctions()[0]->isAuction();
             $this->data['auction_min'] = $this->model->getAuctions()[0]->getMin();
             $this->data['auction_max'] = $this->model->getAuctions()[0]->getMax();
             $this->data['auction_end'] = $this->model->getAuctions()[0]->getEndDate();
             $this->data['auction_start'] = $this->model->getAuctions()[0]->getStartDate();
             $this->data['auction_name'] = $this->model->getAuctions()[0]->getName();
         } else {
             $this->data['isauction'] = 0;
             $this->data['auction_min'] = '';
             $this->data['auction_max'] = '';
             $this->data['auction_end'] = '';
             $this->data['auction_start'] = '';
             $this->data['auction_name'] = '';
         }
     }
     if (isset($this->error['warning'])) {
         $this->data['error_warning'] = $this->error['warning'];
     } else {
         $this->data['error_warning'] = '';
     }
     if (isset($this->error['name'])) {
         $this->data['error_name'] = $this->error['name'];
     } else {
         $this->data['error_name'] = array();
     }
     if (isset($this->error['meta_description'])) {
         $this->data['error_meta_description'] = $this->error['meta_description'];
     } else {
         $this->data['error_meta_description'] = array();
     }
     if (isset($this->error['description'])) {
         $this->data['error_description'] = $this->error['description'];
     } else {
         $this->data['error_description'] = array();
     }
     if (isset($this->error['model'])) {
         $this->data['error_model'] = $this->error['model'];
     } else {
         $this->data['error_model'] = '';
     }
     if (isset($this->error['date_available'])) {
         $this->data['error_date_available'] = $this->error['date_available'];
     } else {
         $this->data['error_date_available'] = '';
     }
     $url = '';
     if (isset($this->request->get['sort'])) {
         $url .= '&sort=' . $this->request->get['sort'];
     }
     if (isset($this->request->get['order'])) {
         $url .= '&order=' . $this->request->get['order'];
     }
     if (isset($this->request->get['page'])) {
         $url .= '&page=' . $this->request->get['page'];
     }
     $this->setBreadcrumbs();
     $this->data['model'] = $this->model;
     if (!$this->model->getId()) {
         $this->data['action'] = $this->getUrl()->link('catalog/product/insert', 'token=' . $this->getSession()->data['token'] . $url, 'SSL');
     } else {
         $this->data['action'] = $this->getUrl()->link('catalog/product/update', 'token=' . $this->getSession()->data['token'] . '&product_id=' . $this->model->getId() . $url, 'SSL');
     }
     $this->data['cancel'] = $this->getUrl()->link('catalog/product', 'token=' . $this->getSession()->data['token'] . $url, 'SSL');
     $this->data['token'] = $this->getSession()->data['token'];
     //		if (isset($this->request->get['product_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) {
     //			$product_info = ProductDAO::getInstance()->getProduct($this->getRequest()->getParam('product_id'));
     //		}
     $this->data['languages'] = $this->getLoader()->model('localisation/language')->getLanguages();
     //		if (isset($this->request->post['product_description'])) {
     //			$this->data['product_description'] = $this->request->post['product_description'];
     //		} elseif (isset($this->request->get['product_id'])) {
     //			$this->data['product_description'] = ProductDAO::getInstance()->getDescription($this->request->get['product_id']);
     //		} else {
     //			$this->data['product_description'] = new Description($this->getLanguage()->getId(), '');
     //		}
     //		if (isset($this->request->post['model'])) {
     //			$this->data['model'] = $this->request->post['model'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['model'] = $product_info['model'];
     //		} else {
     //			$this->data['model'] = '';
     //		}
     //		if (isset($this->request->post['sku'])) {
     //			$this->data['sku'] = $this->request->post['sku'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['sku'] = $product_info['sku'];
     //		} else {
     //			$this->data['sku'] = '';
     //		}
     //
     //		if (isset($this->request->post['upc'])) {
     //			$this->data['upc'] = $this->request->post['upc'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['upc'] = $product_info['upc'];
     //		} else {
     //			$this->data['upc'] = '';
     //		}
     //
     //		if (isset($this->request->post['location'])) {
     //			$this->data['location'] = $this->request->post['location'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['location'] = $product_info['location'];
     //		} else {
     //			$this->data['location'] = '';
     //		}
     //		if (isset($this->request->post['image_description'])) {
     //			$this->data['image_description'] = $this->request->post['image_description'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['image_description'] = $product_info['image_description'];
     //		} else {
     //			$this->data['image_description'] = '';
     //		}
     //
     //		if (isset($this->request->post['image'])) {
     //			$this->data['image'] = $this->request->post['image'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['image'] = $product_info['image'];
     //		} else {
     //			$this->data['image'] = '';
     //		}
     //		if (!empty($product_info) && $product_info['image'] && file_exists(DIR_IMAGE . $product_info['image'])) {
     //			$this->data['thumb'] = ImageService::getInstance()->resize($product_info['image'], 100, 100);
     //		} else {
     //			$this->data['thumb'] = ImageService::getInstance()->resize('no_image.jpg', 100, 100);
     //		}
     $this->data['stores'] = StoreDAO::getInstance()->getStores();
     //		if (isset($this->request->post['product_store'])) {
     //			$this->data['product_store'] = $this->request->post['product_store'];
     //		} elseif (isset($this->request->get['product_id'])) {
     //			$this->data['product_store'] = ProductDAO::getInstance()->getStores($this->request->get['product_id']);
     //		} else {
     //			$this->data['product_store'] = array(0);
     //		}
     //		if (isset($this->request->post['keyword'])) {
     //			$this->data['keyword'] = $this->request->post['keyword'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['keyword'] = $product_info['keyword'];
     //		} else {
     //			$this->data['keyword'] = '';
     //		}
     //		if (isset($this->request->post['product_tag'])) {
     //			$this->data['product_tag'] = $this->request->post['product_tag'];
     //		} elseif (isset($this->request->get['product_id'])) {
     //			$this->data['product_tag'] = ProductDAO::getInstance()->getProductTags($this->request->get['product_id']);
     //		} else {
     //			$this->data['product_tag'] = array();
     //		}
     $this->data['manufacturers'] = ManufacturerDAO::getInstance()->getManufacturers();
     //		if (isset($this->request->post['manufacturer_id'])) {
     //			$this->data['manufacturer_id'] = $this->request->post['manufacturer_id'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['manufacturer_id'] = $product_info['manufacturer_id'];
     //		} else {
     //			$this->data['manufacturer_id'] = 0;
     //		}
     $this->data['suppliers'] = SupplierDAO::getInstance()->getSuppliers();
     //		if (isset($this->request->post['supplier_id'])) {
     //			$this->data['supplier_id'] = $this->request->post['supplier_id'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['supplier_id'] = $product_info['supplier_id'];
     //		} else {
     //			$this->data['supplier_id'] = 0;
     //		}
     //		if (isset($this->request->post['shipping'])) {
     //			$this->data['shipping'] = $this->request->post['shipping'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['shipping'] = $product_info['shipping'];
     //		} else {
     //			$this->data['shipping'] = 1;
     //		}
     //
     //        if (isset($this->request->post['price'])) {
     //            $this->data['price'] = $this->request->post['price'];
     //        } else if (!empty($product_info)) {
     //            $this->data['price'] = $product_info['price'];
     //        } else {
     //            $this->data['price'] = '';
     //        }
     //		$this->data['tax_classes'] = $this->getLoader()->model('localisation/tax_class')->getTaxClasses();
     //
     //		if (isset($this->request->post['tax_class_id'])) {
     //			$this->data['tax_class_id'] = $this->request->post['tax_class_id'];
     //		} else if (!empty($product_info)) {
     //			$this->data['tax_class_id'] = $product_info['tax_class_id'];
     //		} else {
     //			$this->data['tax_class_id'] = 0;
     //		}
     //		if (isset($this->request->post['date_available'])) {
     //			$this->data['date_available'] = $this->request->post['date_available'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['date_available'] = date('Y-m-d', strtotime($product_info['date_available']));
     //		} else {
     //			$this->data['date_available'] = date('Y-m-d', time() - 86400);
     //		}
     //
     //		if (isset($this->request->post['quantity'])) {
     //			$this->data['quantity'] = $this->request->post['quantity'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['quantity'] = $product_info['quantity'];
     //		} else {
     //			$this->data['quantity'] = '';
     //		}
     //		if (isset($this->request->post['minimum'])) {
     //			$this->data['minimum'] = $this->request->post['minimum'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['minimum'] = $product_info['minimum'];
     //		} else {
     //			$this->data['minimum'] = 1;
     //		}
     //		if (isset($this->request->post['subtract'])) {
     //			$this->data['subtract'] = $this->request->post['subtract'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['subtract'] = $product_info['subtract'];
     //		} else {
     //			$this->data['subtract'] = 0;
     //		}
     //		if (isset($this->request->post['sort_order'])) {
     //			$this->data['sort_order'] = $this->request->post['sort_order'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['sort_order'] = $product_info['sort_order'];
     //		} else {
     //			$this->data['sort_order'] = 1;
     //		}
     $this->data['stock_statuses'] = $this->getLoader()->model('localisation/stock_status')->getStockStatuses();
     //
     //		if (isset($this->request->post['stock_status_id'])) {
     //			$this->data['stock_status_id'] = $this->request->post['stock_status_id'];
     //		} else if (!empty($product_info)) {
     //			$this->data['stock_status_id'] = $product_info['stock_status_id'];
     //		} else {
     //			$this->data['stock_status_id'] = $this->getConfig()->get('config_stock_status_id');
     //		}
     //		if (isset($this->request->post['status'])) {
     //			$this->data['status'] = $this->request->post['status'];
     //		} else if (!empty($product_info)) {
     //			$this->data['status'] = $product_info['status'];
     //		} else {
     //			$this->data['status'] = 1;
     //		}
     //		if (isset($this->request->post['affiliate_commission'])) {
     //			$this->data['affiliate_commission'] = $this->request->post['affiliate_commission'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['affiliate_commission'] = $product_info['affiliate_commission'];
     //		} else {
     //			$this->data['affiliate_commission'] = 0;
     //		}
     //		if (isset($this->request->post['weight'])) {
     //			$this->data['weight'] = $this->request->post['weight'];
     //		} else if (!empty($product_info)) {
     //			$this->data['weight'] = $product_info['weight'];
     //		} else {
     //			$this->data['weight'] = '';
     //		}
     $this->data['weight_classes'] = MeasureUnitDAO::getInstance()->getWeightClasses();
     //
     //		if (isset($this->request->post['weight_class_id'])) {
     //			$this->data['weight_class_id'] = $this->request->post['weight_class_id'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['weight_class_id'] = $product_info['weight_class_id'];
     //		} else {
     //			$this->data['weight_class_id'] = $this->getConfig()->get('config_weight_class_id');
     //		}
     //		if (isset($this->request->post['length'])) {
     //			$this->data['length'] = $this->request->post['length'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['length'] = $product_info['length'];
     //		} else {
     //			$this->data['length'] = '';
     //		}
     //
     //		if (isset($this->request->post['width'])) {
     //			$this->data['width'] = $this->request->post['width'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['width'] = $product_info['width'];
     //		} else {
     //			$this->data['width'] = '';
     //		}
     //
     //		if (isset($this->request->post['height'])) {
     //			$this->data['height'] = $this->request->post['height'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['height'] = $product_info['height'];
     //		} else {
     //			$this->data['height'] = '';
     //		}
     //		$this->getLoader()->model('localisation/length_class');
     $this->data['length_classes'] = MeasureUnitDAO::getInstance()->getLengthClasses();
     //		if (isset($this->request->post['length_class_id'])) {
     //			$this->data['length_class_id'] = $this->request->post['length_class_id'];
     //		} elseif (!empty($product_info)) {
     //			$this->data['length_class_id'] = $product_info['length_class_id'];
     //		} else {
     //			$this->data['length_class_id'] = $this->getConfig()->get('config_length_class_id');
     //		}
     //		if (isset($this->request->post['product_attribute'])) {
     //			$this->data['product_attributes'] = $this->request->post['product_attribute'];
     //		} elseif (isset($this->request->get['product_id'])) {
     //			$this->data['product_attributes'] = ProductDAO::getInstance()->getProductAttributes($this->request->get['product_id']);
     //		} else {
     //			$this->data['product_attributes'] = array();
     //		}
     //		$this->data['product_options'] = array();
     //		if (isset($this->request->post['product_option'])) {
     //			$product_options = $this->request->post['product_option'];
     //            $product_options = new ProductOptionCollection();
     //            foreach ($this->getRequest()->getParam('product_option') as $productOptionParam) {
     //                $productOption = new ProductOption(
     //                    $productOptionParam['product_option_id'],
     //                    Produ
     //                )
     //            }
     //		} elseif (isset($this->request->get['product_id'])) {
     //			$product_options = ProductDAO::getInstance()->getProductOptions($this->request->get['product_id']);
     //		} else {
     //			$product_options = [];
     //		}
     //
     //
     //		foreach ($product_options as $product_option) {
     //			if ($product_option->getType() == 'select' || $product_option->getType() == 'radio' || $product_option->getType() == 'checkbox' || $product_option->getType() == 'image') {
     //				$product_option_value_data = array();
     //
     //				foreach ($product_option->getValue() as $product_option_value) {
     //					$product_option_value_data[] = array(
     //						'product_option_value_id' => $product_option_value->getId(),
     //						'option_value_id'         => $product_option_value->getOptionValue()->getId(),
     //						'quantity'                => $product_option_value->getQuantity(),
     //						'subtract'                => $product_option_value->getSubtract(),
     //						'price'                   => $product_option_value->getPrice(),
     //						'price_prefix'            => $product_option_value->getPrice() > 0 ? '+' : '-',
     //						'points'                  => $product_option_value->getPoints(),
     //						'points_prefix'           => $product_option_value->getPoints() > 0 ? '+' : '-',
     //						'weight'                  => $product_option_value->getWeight(),
     //						'weight_prefix'           => $product_option_value->getWeight() > 0 ? '+' : '-'
     //					);
     //				}
     //
     //				$this->data['product_options'][] = array(
     //					'product_option_id'    => $product_option->getId(),
     //					'option_id'            => $product_option->getOption()->getId(),
     //					'name'                 => $product_option->getOption()->getName(),
     //					'type'                 => $product_option->getType(),
     //					'product_option_value' => $product_option_value_data,
     //					'required'             => $product_option->isRequired()
     //				);
     //			} else {
     //				$this->data['product_options'][] = array(
     //					'product_option_id' => $product_option->getId(),
     //					'option_id'         => $product_option->getOption()->getId(),
     //					'name'              => $product_option->getOption()->getName(),
     //					'type'              => $product_option->getType(),
     //					'option_value'      => $product_option->getValue(),
     //					'required'          => $product_option->isRequired()
     //				);
     //			}
     //		}
     $this->data['create_option_block'] = $this->getOptionForm();
     $this->data['customer_groups'] = $this->getLoader()->model('sale/customer_group')->getCustomerGroups();
     //		if (isset($this->request->post['product_discount'])) {
     //			$this->data['product_discounts'] = $this->request->post['product_discount'];
     //		} elseif (isset($this->request->get['product_id'])) {
     //			$this->data['product_discounts'] = ProductDAO::getInstance()->getProductDiscounts($this->request->get['product_id']);
     //		} else {
     //			$this->data['product_discounts'] = array();
     //		}
     //		if (isset($this->request->post['product_special'])) {
     //			$this->data['product_specials'] = $this->request->post['product_special'];
     //		} elseif (isset($this->request->get['product_id'])) {
     //			$this->data['product_specials'] = ProductDAO::getInstance()->getProductSpecials($this->request->get['product_id']);
     //		} else {
     //			$this->data['product_specials'] = array();
     //		}
     //		if (isset($this->request->post['product_image'])) {
     //			$product_images = $this->request->post['product_image'];
     //		} elseif (isset($this->request->get['product_id'])) {
     //			$product_images = ProductDAO::getInstance()->getProductImages($this->request->get['product_id']);
     //		} else {
     //			$product_images = array();
     //		}
     $this->data['product_images'] = array();
     foreach ($this->model->getImages() as $productImage) {
         if (file_exists(DIR_IMAGE . $productImage->getImagePath())) {
             $image = $productImage->getImagePath();
         } else {
             $image = 'no_image.jpg';
         }
         $this->data['product_images'][] = array('image' => $image, 'thumb' => ImageService::getInstance()->resize($image, 100, 100), 'sort_order' => $productImage->getSortOrder());
     }
     $this->data['no_image'] = ImageService::getInstance()->resize('no_image.jpg', 100, 100);
     $this->data['downloads'] = $this->getLoader()->model('catalog/download')->getDownloads();
     //		if (isset($this->request->post['product_download'])) {
     //			$this->data['product_download'] = $this->request->post['product_download'];
     //		} elseif (isset($this->request->get['product_id'])) {
     //			$this->data['product_download'] = ProductDAO::getInstance()->getProductDownloads($this->request->get['product_id']);
     //		} else {
     //			$this->data['product_download'] = array();
     //		}
     $categories = CategoryDAO::getInstance()->getAllCategories();
     $this->data['categories'] = $this->getAllCategories($categories);
     //		if (isset($this->request->post['main_category_id'])) {
     //			$this->data['main_category_id'] = $this->request->post['main_category_id'];
     //		} elseif (isset($product_info)) {
     //			$this->data['main_category_id'] = $this->model_catalog_product->getProductMainCategoryId($this->request->get['product_id']);
     //		} else {
     //			$this->data['main_category_id'] = 0;
     //		}
     //		if (isset($this->request->post['product_category'])) {
     //			$this->data['product_category'] = $this->request->post['product_category'];
     //		} elseif (isset($this->request->get['product_id'])) {
     //			$this->data['product_category'] = $this->model_catalog_product->getProductCategories($this->request->get['product_id']);
     //		} else {
     //			$this->data['product_category'] = array();
     //		}
     $this->data['categoriesParent'] = $this->getCategoriesParent(0, array_map(function (ProductCategory $item) {
         return $item->getCategory()->getId();
     }, $this->model->getCategories()));
     //		$this->data['scripts'] = '$("#navigation ul").treeview({persist: "location",	collapsed: true, unique: true	});';
     //		if (isset($this->request->post['product_related'])) {
     //			$products = $this->request->post['product_related'];
     //		} elseif (isset($this->request->get['product_id'])) {
     //			$products = $this->model_catalog_product->getProductRelated($this->request->get['product_id']);
     //		} else {
     //			$products = array();
     //		}
     //
     //		$this->data['product_related'] = array();
     //
     //		foreach ($products as $product_id) {
     //			$related_info = $this->model_catalog_product->getProduct($product_id);
     //
     //			if ($related_info) {
     //				$this->data['product_related'][] = array(
     //					'product_id' => $related_info['product_id'],
     //					'name'       => $related_info['name']
     //				);
     //			}
     //		}
     //		if (isset($this->request->post['points'])) {
     //			$this->data['points'] = $this->request->post['points'];
     //		} else if (!empty($product_info)) {
     //			$this->data['points'] = $product_info['points'];
     //		} else {
     //			$this->data['points'] = '';
     //		}
     //		if (isset($this->request->post['koreanName'])) {
     //			$this->data['koreanName'] = $this->request->post['koreanName'];
     //		} else if (!empty($product_info)) {
     //			$this->data['koreanName'] = $product_info['korean_name'];
     //		} else {
     //			$this->data['koreanName'] = '';
     //		}
     //		if (isset($this->request->post['supplierUrl'])) {
     //			$this->data['supplierUrl'] = $this->request->post['supplierUrl'];
     //		} else if (!empty($product_info)) {
     //			$this->data['supplierUrl'] = $product_info['supplier_url'];
     //		} else {
     //			$this->data['supplierUrl'] = '';
     //		}
     //		if (isset($this->request->post['product_reward'])) {
     //			$this->data['product_reward'] = $this->request->post['product_reward'];
     //		} elseif (isset($this->request->get['product_id'])) {
     //			$this->data['product_reward'] = $this->model_catalog_product->getProductRewards($this->request->get['product_id']);
     //		} else {
     //			$this->data['product_reward'] = array();
     //		}
     //		if (isset($this->request->post['product_layout'])) {
     //			$this->data['product_layout'] = $this->request->post['product_layout'];
     //		} elseif (isset($this->request->get['product_id'])) {
     //			$this->data['product_layout'] = $this->model_catalog_product->getProductLayouts($this->request->get['product_id']);
     //		} else {
     //			$this->data['product_layout'] = array();
     //		}
     $this->data['layouts'] = $this->getLoader()->model('design/layout')->getLayouts();
     $this->children = array('common/header', 'common/footer');
     $this->getResponse()->setOutput($this->render('catalog/productForm.tpl.php'));
 }
示例#2
0
 public function index()
 {
     $this->getLoader()->language('shipping/ups');
     $this->document->setTitle($this->language->get('heading_title'));
     $this->getLoader()->model('setting/setting');
     if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate()) {
         $this->model_setting_setting->editSetting('ups', $this->request->post);
         $this->session->data['success'] = $this->language->get('text_success');
         $this->redirect($this->url->link('extension/shipping', 'token=' . $this->session->data['token'], 'SSL'));
     }
     $this->data['heading_title'] = $this->language->get('heading_title');
     $this->data['text_enabled'] = $this->language->get('text_enabled');
     $this->data['text_disabled'] = $this->language->get('text_disabled');
     $this->data['text_yes'] = $this->language->get('text_yes');
     $this->data['text_no'] = $this->language->get('text_no');
     $this->data['text_all_zones'] = $this->language->get('text_all_zones');
     $this->data['text_none'] = $this->language->get('text_none');
     $this->data['text_next_day_air'] = $this->language->get('text_next_day_air');
     $this->data['text_2nd_day_air'] = $this->language->get('text_2nd_day_air');
     $this->data['text_ground'] = $this->language->get('text_ground');
     $this->data['text_worldwide_express'] = $this->language->get('text_worldwide_express');
     $this->data['text_worldwide_express_plus'] = $this->language->get('text_worldwide_express_plus');
     $this->data['text_worldwide_expedited'] = $this->language->get('text_worldwide_expedited');
     $this->data['text_express'] = $this->language->get('text_express');
     $this->data['text_standard'] = $this->language->get('text_standard');
     $this->data['text_3_day_select'] = $this->language->get('text_3_day_select');
     $this->data['text_next_day_air_saver'] = $this->language->get('text_next_day_air_saver');
     $this->data['text_next_day_air_early_am'] = $this->language->get('text_next_day_air_early_am');
     $this->data['text_expedited'] = $this->language->get('text_expedited');
     $this->data['text_2nd_day_air_am'] = $this->language->get('text_2nd_day_air_am');
     $this->data['text_saver'] = $this->language->get('text_saver');
     $this->data['text_express_early_am'] = $this->language->get('text_express_early_am');
     $this->data['text_express_plus'] = $this->language->get('text_express_plus');
     $this->data['text_today_standard'] = $this->language->get('text_today_standard');
     $this->data['text_today_dedicated_courier'] = $this->language->get('text_today_dedicated_courier');
     $this->data['text_today_intercity'] = $this->language->get('text_today_intercity');
     $this->data['text_today_express'] = $this->language->get('text_today_express');
     $this->data['text_today_express_saver'] = $this->language->get('text_today_express_saver');
     $this->data['entry_key'] = $this->language->get('entry_key');
     $this->data['entry_username'] = $this->language->get('entry_username');
     $this->data['entry_password'] = $this->language->get('entry_password');
     $this->data['entry_pickup'] = $this->language->get('entry_pickup');
     $this->data['entry_packaging'] = $this->language->get('entry_packaging');
     $this->data['entry_classification'] = $this->language->get('entry_classification');
     $this->data['entry_origin'] = $this->language->get('entry_origin');
     $this->data['entry_city'] = $this->language->get('entry_city');
     $this->data['entry_state'] = $this->language->get('entry_state');
     $this->data['entry_country'] = $this->language->get('entry_country');
     $this->data['entry_postcode'] = $this->language->get('entry_postcode');
     $this->data['entry_test'] = $this->language->get('entry_test');
     $this->data['entry_quote_type'] = $this->language->get('entry_quote_type');
     $this->data['entry_service'] = $this->language->get('entry_service');
     $this->data['entry_insurance'] = $this->language->get('entry_insurance');
     $this->data['entry_display_weight'] = $this->language->get('entry_display_weight');
     $this->data['entry_weight_code'] = $this->language->get('entry_weight_code');
     $this->data['entry_weight_class'] = $this->language->get('entry_weight_class');
     $this->data['entry_length_code'] = $this->language->get('entry_length_code');
     $this->data['entry_length_class'] = $this->language->get('entry_length_class');
     $this->data['entry_dimension'] = $this->language->get('entry_dimension');
     $this->data['entry_tax_class'] = $this->language->get('entry_tax_class');
     $this->data['entry_geo_zone'] = $this->language->get('entry_geo_zone');
     $this->data['entry_status'] = $this->language->get('entry_status');
     $this->data['entry_sort_order'] = $this->language->get('entry_sort_order');
     $this->data['button_save'] = $this->language->get('button_save');
     $this->data['button_cancel'] = $this->language->get('button_cancel');
     if (isset($this->error['warning'])) {
         $this->data['error_warning'] = $this->error['warning'];
     } else {
         $this->data['error_warning'] = '';
     }
     if (isset($this->error['key'])) {
         $this->data['error_key'] = $this->error['key'];
     } else {
         $this->data['error_key'] = '';
     }
     if (isset($this->error['username'])) {
         $this->data['error_username'] = $this->error['username'];
     } else {
         $this->data['error_username'] = '';
     }
     if (isset($this->error['password'])) {
         $this->data['error_password'] = $this->error['password'];
     } else {
         $this->data['error_password'] = '';
     }
     if (isset($this->error['city'])) {
         $this->data['error_city'] = $this->error['city'];
     } else {
         $this->data['error_city'] = '';
     }
     if (isset($this->error['state'])) {
         $this->data['error_state'] = $this->error['state'];
     } else {
         $this->data['error_state'] = '';
     }
     if (isset($this->error['country'])) {
         $this->data['error_country'] = $this->error['country'];
     } else {
         $this->data['error_country'] = '';
     }
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => false);
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_shipping'), 'href' => $this->url->link('extension/shipping', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => ' :: ');
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('shipping/ups', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => ' :: ');
     $this->data['action'] = $this->url->link('shipping/ups', 'token=' . $this->session->data['token'], 'SSL');
     $this->data['cancel'] = $this->url->link('extension/shipping', 'token=' . $this->session->data['token'], 'SSL');
     if (isset($this->request->post['ups_key'])) {
         $this->data['ups_key'] = $this->request->post['ups_key'];
     } else {
         $this->data['ups_key'] = $this->getConfig()->get('ups_key');
     }
     if (isset($this->request->post['ups_username'])) {
         $this->data['ups_username'] = $this->request->post['ups_username'];
     } else {
         $this->data['ups_username'] = $this->getConfig()->get('ups_username');
     }
     if (isset($this->request->post['ups_password'])) {
         $this->data['ups_password'] = $this->request->post['ups_password'];
     } else {
         $this->data['ups_password'] = $this->getConfig()->get('ups_password');
     }
     if (isset($this->request->post['ups_pickup'])) {
         $this->data['ups_pickup'] = $this->request->post['ups_pickup'];
     } else {
         $this->data['ups_pickup'] = $this->getConfig()->get('ups_pickup');
     }
     $this->data['pickups'] = array();
     $this->data['pickups'][] = array('value' => '01', 'text' => $this->language->get('text_daily_pickup'));
     $this->data['pickups'][] = array('value' => '03', 'text' => $this->language->get('text_customer_counter'));
     $this->data['pickups'][] = array('value' => '06', 'text' => $this->language->get('text_one_time_pickup'));
     $this->data['pickups'][] = array('value' => '07', 'text' => $this->language->get('text_on_call_air_pickup'));
     $this->data['pickups'][] = array('value' => '19', 'text' => $this->language->get('text_letter_center'));
     $this->data['pickups'][] = array('value' => '20', 'text' => $this->language->get('text_air_service_center'));
     $this->data['pickups'][] = array('value' => '11', 'text' => $this->language->get('text_suggested_retail_rates'));
     if (isset($this->request->post['ups_packaging'])) {
         $this->data['ups_packaging'] = $this->request->post['ups_packaging'];
     } else {
         $this->data['ups_packaging'] = $this->getConfig()->get('ups_packaging');
     }
     $this->data['packages'] = array();
     $this->data['packages'][] = array('value' => '02', 'text' => $this->language->get('text_package'));
     $this->data['packages'][] = array('value' => '01', 'text' => $this->language->get('text_ups_letter'));
     $this->data['packages'][] = array('value' => '03', 'text' => $this->language->get('text_ups_tube'));
     $this->data['packages'][] = array('value' => '04', 'text' => $this->language->get('text_ups_pak'));
     $this->data['packages'][] = array('value' => '21', 'text' => $this->language->get('text_ups_express_box'));
     $this->data['packages'][] = array('value' => '24', 'text' => $this->language->get('text_ups_25kg_box'));
     $this->data['packages'][] = array('value' => '25', 'text' => $this->language->get('text_ups_10kg_box'));
     if (isset($this->request->post['ups_classification'])) {
         $this->data['ups_classification'] = $this->request->post['ups_classification'];
     } else {
         $this->data['ups_classification'] = $this->getConfig()->get('ups_classification');
     }
     $this->data['classifications'][] = array('value' => '01', 'text' => '01');
     $this->data['classifications'][] = array('value' => '03', 'text' => '03');
     $this->data['classifications'][] = array('value' => '04', 'text' => '04');
     if (isset($this->request->post['ups_origin'])) {
         $this->data['ups_origin'] = $this->request->post['ups_origin'];
     } else {
         $this->data['ups_origin'] = $this->getConfig()->get('ups_origin');
     }
     $this->data['origins'] = array();
     $this->data['origins'][] = array('value' => 'US', 'text' => $this->language->get('text_us'));
     $this->data['origins'][] = array('value' => 'CA', 'text' => $this->language->get('text_ca'));
     $this->data['origins'][] = array('value' => 'EU', 'text' => $this->language->get('text_eu'));
     $this->data['origins'][] = array('value' => 'PR', 'text' => $this->language->get('text_pr'));
     $this->data['origins'][] = array('value' => 'MX', 'text' => $this->language->get('text_mx'));
     $this->data['origins'][] = array('value' => 'other', 'text' => $this->language->get('text_other'));
     if (isset($this->request->post['ups_city'])) {
         $this->data['ups_city'] = $this->request->post['ups_city'];
     } else {
         $this->data['ups_city'] = $this->getConfig()->get('ups_city');
     }
     if (isset($this->request->post['ups_state'])) {
         $this->data['ups_state'] = $this->request->post['ups_state'];
     } else {
         $this->data['ups_state'] = $this->getConfig()->get('ups_state');
     }
     if (isset($this->request->post['ups_country'])) {
         $this->data['ups_country'] = $this->request->post['ups_country'];
     } else {
         $this->data['ups_country'] = $this->getConfig()->get('ups_country');
     }
     if (isset($this->request->post['ups_postcode'])) {
         $this->data['ups_postcode'] = $this->request->post['ups_postcode'];
     } else {
         $this->data['ups_postcode'] = $this->getConfig()->get('ups_postcode');
     }
     if (isset($this->request->post['ups_test'])) {
         $this->data['ups_test'] = $this->request->post['ups_test'];
     } else {
         $this->data['ups_test'] = $this->getConfig()->get('ups_test');
     }
     if (isset($this->request->post['ups_quote_type'])) {
         $this->data['ups_quote_type'] = $this->request->post['ups_quote_type'];
     } else {
         $this->data['ups_quote_type'] = $this->getConfig()->get('ups_quote_type');
     }
     $this->data['quote_types'] = array();
     $this->data['quote_types'][] = array('value' => 'residential', 'text' => $this->language->get('text_residential'));
     $this->data['quote_types'][] = array('value' => 'commercial', 'text' => $this->language->get('text_commercial'));
     // US
     if (isset($this->request->post['ups_us_01'])) {
         $this->data['ups_us_01'] = $this->request->post['ups_us_01'];
     } else {
         $this->data['ups_us_01'] = $this->getConfig()->get('ups_us_01');
     }
     if (isset($this->request->post['ups_us_02'])) {
         $this->data['ups_us_02'] = $this->request->post['ups_us_02'];
     } else {
         $this->data['ups_us_02'] = $this->getConfig()->get('ups_us_02');
     }
     if (isset($this->request->post['ups_us_03'])) {
         $this->data['ups_us_03'] = $this->request->post['ups_us_03'];
     } else {
         $this->data['ups_us_03'] = $this->getConfig()->get('ups_us_03');
     }
     if (isset($this->request->post['ups_us_07'])) {
         $this->data['ups_us_07'] = $this->request->post['ups_us_07'];
     } else {
         $this->data['ups_us_07'] = $this->getConfig()->get('ups_us_07');
     }
     if (isset($this->request->post['ups_us_08'])) {
         $this->data['ups_us_08'] = $this->request->post['ups_us_08'];
     } else {
         $this->data['ups_us_08'] = $this->getConfig()->get('ups_us_08');
     }
     if (isset($this->request->post['ups_us_11'])) {
         $this->data['ups_us_11'] = $this->request->post['ups_us_11'];
     } else {
         $this->data['ups_us_11'] = $this->getConfig()->get('ups_us_11');
     }
     if (isset($this->request->post['ups_us_12'])) {
         $this->data['ups_us_12'] = $this->request->post['ups_us_12'];
     } else {
         $this->data['ups_us_12'] = $this->getConfig()->get('ups_us_12');
     }
     if (isset($this->request->post['ups_us_13'])) {
         $this->data['ups_us_13'] = $this->request->post['ups_us_13'];
     } else {
         $this->data['ups_us_13'] = $this->getConfig()->get('ups_us_13');
     }
     if (isset($this->request->post['ups_us_14'])) {
         $this->data['ups_us_14'] = $this->request->post['ups_us_14'];
     } else {
         $this->data['ups_us_14'] = $this->getConfig()->get('ups_us_14');
     }
     if (isset($this->request->post['ups_us_54'])) {
         $this->data['ups_us_54'] = $this->request->post['ups_us_54'];
     } else {
         $this->data['ups_us_54'] = $this->getConfig()->get('ups_us_54');
     }
     if (isset($this->request->post['ups_us_59'])) {
         $this->data['ups_us_59'] = $this->request->post['ups_us_59'];
     } else {
         $this->data['ups_us_59'] = $this->getConfig()->get('ups_us_59');
     }
     if (isset($this->request->post['ups_us_65'])) {
         $this->data['ups_us_65'] = $this->request->post['ups_us_65'];
     } else {
         $this->data['ups_us_65'] = $this->getConfig()->get('ups_us_65');
     }
     // Puerto Rico
     if (isset($this->request->post['ups_pr_01'])) {
         $this->data['ups_pr_01'] = $this->request->post['ups_pr_01'];
     } else {
         $this->data['ups_pr_01'] = $this->getConfig()->get('ups_pr_01');
     }
     if (isset($this->request->post['ups_pr_02'])) {
         $this->data['ups_pr_02'] = $this->request->post['ups_pr_02'];
     } else {
         $this->data['ups_pr_02'] = $this->getConfig()->get('ups_pr_02');
     }
     if (isset($this->request->post['ups_pr_03'])) {
         $this->data['ups_pr_03'] = $this->request->post['ups_pr_03'];
     } else {
         $this->data['ups_pr_03'] = $this->getConfig()->get('ups_pr_03');
     }
     if (isset($this->request->post['ups_pr_07'])) {
         $this->data['ups_pr_07'] = $this->request->post['ups_pr_07'];
     } else {
         $this->data['ups_pr_07'] = $this->getConfig()->get('ups_pr_07');
     }
     if (isset($this->request->post['ups_pr_08'])) {
         $this->data['ups_pr_08'] = $this->request->post['ups_pr_08'];
     } else {
         $this->data['ups_pr_08'] = $this->getConfig()->get('ups_pr_08');
     }
     if (isset($this->request->post['ups_pr_14'])) {
         $this->data['ups_pr_14'] = $this->request->post['ups_pr_14'];
     } else {
         $this->data['ups_pr_14'] = $this->getConfig()->get('ups_pr_14');
     }
     if (isset($this->request->post['ups_pr_54'])) {
         $this->data['ups_pr_54'] = $this->request->post['ups_pr_54'];
     } else {
         $this->data['ups_pr_54'] = $this->getConfig()->get('ups_pr_54');
     }
     if (isset($this->request->post['ups_pr_65'])) {
         $this->data['ups_pr_65'] = $this->request->post['ups_pr_65'];
     } else {
         $this->data['ups_pr_65'] = $this->getConfig()->get('ups_pr_65');
     }
     // Canada
     if (isset($this->request->post['ups_ca_01'])) {
         $this->data['ups_ca_01'] = $this->request->post['ups_ca_01'];
     } else {
         $this->data['ups_ca_01'] = $this->getConfig()->get('ups_ca_01');
     }
     if (isset($this->request->post['ups_ca_02'])) {
         $this->data['ups_ca_02'] = $this->request->post['ups_ca_02'];
     } else {
         $this->data['ups_ca_02'] = $this->getConfig()->get('ups_ca_02');
     }
     if (isset($this->request->post['ups_ca_07'])) {
         $this->data['ups_ca_07'] = $this->request->post['ups_ca_07'];
     } else {
         $this->data['ups_ca_07'] = $this->getConfig()->get('ups_ca_07');
     }
     if (isset($this->request->post['ups_ca_08'])) {
         $this->data['ups_ca_08'] = $this->request->post['ups_ca_08'];
     } else {
         $this->data['ups_ca_08'] = $this->getConfig()->get('ups_ca_08');
     }
     if (isset($this->request->post['ups_ca_11'])) {
         $this->data['ups_ca_11'] = $this->request->post['ups_ca_11'];
     } else {
         $this->data['ups_ca_11'] = $this->getConfig()->get('ups_ca_11');
     }
     if (isset($this->request->post['ups_ca_12'])) {
         $this->data['ups_ca_12'] = $this->request->post['ups_ca_12'];
     } else {
         $this->data['ups_ca_12'] = $this->getConfig()->get('ups_ca_12');
     }
     if (isset($this->request->post['ups_ca_13'])) {
         $this->data['ups_ca_13'] = $this->request->post['ups_ca_13'];
     } else {
         $this->data['ups_ca_13'] = $this->getConfig()->get('ups_ca_13');
     }
     if (isset($this->request->post['ups_ca_14'])) {
         $this->data['ups_ca_14'] = $this->request->post['ups_ca_14'];
     } else {
         $this->data['ups_ca_14'] = $this->getConfig()->get('ups_ca_14');
     }
     if (isset($this->request->post['ups_ca_54'])) {
         $this->data['ups_ca_54'] = $this->request->post['ups_ca_54'];
     } else {
         $this->data['ups_ca_54'] = $this->getConfig()->get('ups_ca_54');
     }
     if (isset($this->request->post['ups_ca_65'])) {
         $this->data['ups_ca_65'] = $this->request->post['ups_ca_65'];
     } else {
         $this->data['ups_ca_65'] = $this->getConfig()->get('ups_ca_65');
     }
     // Mexico
     if (isset($this->request->post['ups_mx_07'])) {
         $this->data['ups_mx_07'] = $this->request->post['ups_mx_07'];
     } else {
         $this->data['ups_mx_07'] = $this->getConfig()->get('ups_mx_07');
     }
     if (isset($this->request->post['ups_mx_08'])) {
         $this->data['ups_mx_08'] = $this->request->post['ups_mx_08'];
     } else {
         $this->data['ups_mx_08'] = $this->getConfig()->get('ups_mx_08');
     }
     if (isset($this->request->post['ups_mx_54'])) {
         $this->data['ups_mx_54'] = $this->request->post['ups_mx_54'];
     } else {
         $this->data['ups_mx_54'] = $this->getConfig()->get('ups_mx_54');
     }
     if (isset($this->request->post['ups_mx_65'])) {
         $this->data['ups_mx_65'] = $this->request->post['ups_mx_65'];
     } else {
         $this->data['ups_mx_65'] = $this->getConfig()->get('ups_mx_65');
     }
     // EU
     if (isset($this->request->post['ups_eu_07'])) {
         $this->data['ups_eu_07'] = $this->request->post['ups_eu_07'];
     } else {
         $this->data['ups_eu_07'] = $this->getConfig()->get('ups_eu_07');
     }
     if (isset($this->request->post['ups_eu_08'])) {
         $this->data['ups_eu_08'] = $this->request->post['ups_eu_08'];
     } else {
         $this->data['ups_eu_08'] = $this->getConfig()->get('ups_eu_08');
     }
     if (isset($this->request->post['ups_eu_11'])) {
         $this->data['ups_eu_11'] = $this->request->post['ups_eu_11'];
     } else {
         $this->data['ups_eu_11'] = $this->getConfig()->get('ups_eu_11');
     }
     if (isset($this->request->post['ups_eu_54'])) {
         $this->data['ups_eu_54'] = $this->request->post['ups_eu_54'];
     } else {
         $this->data['ups_eu_54'] = $this->getConfig()->get('ups_eu_54');
     }
     if (isset($this->request->post['ups_eu_65'])) {
         $this->data['ups_eu_65'] = $this->request->post['ups_eu_65'];
     } else {
         $this->data['ups_eu_65'] = $this->getConfig()->get('ups_eu_65');
     }
     if (isset($this->request->post['ups_eu_82'])) {
         $this->data['ups_eu_82'] = $this->request->post['ups_eu_82'];
     } else {
         $this->data['ups_eu_82'] = $this->getConfig()->get('ups_eu_82');
     }
     if (isset($this->request->post['ups_eu_83'])) {
         $this->data['ups_eu_83'] = $this->request->post['ups_eu_83'];
     } else {
         $this->data['ups_eu_83'] = $this->getConfig()->get('ups_eu_83');
     }
     if (isset($this->request->post['ups_eu_84'])) {
         $this->data['ups_eu_84'] = $this->request->post['ups_eu_84'];
     } else {
         $this->data['ups_eu_84'] = $this->getConfig()->get('ups_eu_84');
     }
     if (isset($this->request->post['ups_eu_85'])) {
         $this->data['ups_eu_85'] = $this->request->post['ups_eu_85'];
     } else {
         $this->data['ups_eu_85'] = $this->getConfig()->get('ups_eu_85');
     }
     if (isset($this->request->post['ups_eu_86'])) {
         $this->data['ups_eu_86'] = $this->request->post['ups_eu_86'];
     } else {
         $this->data['ups_eu_86'] = $this->getConfig()->get('ups_eu_86');
     }
     // Other
     if (isset($this->request->post['ups_other_07'])) {
         $this->data['ups_other_07'] = $this->request->post['ups_other_07'];
     } else {
         $this->data['ups_other_07'] = $this->getConfig()->get('ups_other_07');
     }
     if (isset($this->request->post['ups_other_08'])) {
         $this->data['ups_other_08'] = $this->request->post['ups_other_08'];
     } else {
         $this->data['ups_other_08'] = $this->getConfig()->get('ups_other_08');
     }
     if (isset($this->request->post['ups_other_11'])) {
         $this->data['ups_other_11'] = $this->request->post['ups_other_11'];
     } else {
         $this->data['ups_other_11'] = $this->getConfig()->get('ups_other_11');
     }
     if (isset($this->request->post['ups_other_54'])) {
         $this->data['ups_other_54'] = $this->request->post['ups_other_54'];
     } else {
         $this->data['ups_other_54'] = $this->getConfig()->get('ups_other_54');
     }
     if (isset($this->request->post['ups_other_65'])) {
         $this->data['ups_other_65'] = $this->request->post['ups_other_65'];
     } else {
         $this->data['ups_other_65'] = $this->getConfig()->get('ups_other_65');
     }
     if (isset($this->request->post['ups_display_weight'])) {
         $this->data['ups_display_weight'] = $this->request->post['ups_display_weight'];
     } else {
         $this->data['ups_display_weight'] = $this->getConfig()->get('ups_display_weight');
     }
     if (isset($this->request->post['ups_insurance'])) {
         $this->data['ups_insurance'] = $this->request->post['ups_insurance'];
     } else {
         $this->data['ups_insurance'] = $this->getConfig()->get('ups_insurance');
     }
     if (isset($this->request->post['ups_weight_code'])) {
         $this->data['ups_weight_code'] = $this->request->post['ups_weight_code'];
     } else {
         $this->data['ups_weight_code'] = $this->getConfig()->get('ups_weight_code');
     }
     if (isset($this->request->post['ups_weight_class_id'])) {
         $this->data['ups_weight_class_id'] = $this->request->post['ups_weight_class_id'];
     } else {
         $this->data['ups_weight_class_id'] = $this->getConfig()->get('ups_weight_class_id');
     }
     //$this->getLoader()->model('localisation/weight_class');
     $this->data['weight_classes'] = MeasureUnitDAO::getInstance()->getWeightClasses();
     if (isset($this->request->post['ups_length_code'])) {
         $this->data['ups_length_code'] = $this->request->post['ups_length_code'];
     } else {
         $this->data['ups_length_code'] = $this->getConfig()->get('ups_length_code');
     }
     if (isset($this->request->post['ups_length_class'])) {
         $this->data['ups_length_class'] = $this->request->post['ups_length_class'];
     } else {
         $this->data['ups_length_class'] = $this->getConfig()->get('ups_length_class');
     }
     $this->getLoader()->model('localisation/length_class');
     $this->data['length_classes'] = MeasureUnitDAO::getInstance()->getLengthClasses();
     if (isset($this->request->post['ups_length'])) {
         $this->data['ups_length'] = $this->request->post['ups_length'];
     } else {
         $this->data['ups_length'] = $this->getConfig()->get('ups_length');
     }
     if (isset($this->request->post['ups_width'])) {
         $this->data['ups_width'] = $this->request->post['ups_width'];
     } else {
         $this->data['ups_width'] = $this->getConfig()->get('ups_width');
     }
     if (isset($this->request->post['ups_height'])) {
         $this->data['ups_height'] = $this->request->post['ups_height'];
     } else {
         $this->data['ups_height'] = $this->getConfig()->get('ups_height');
     }
     if (isset($this->request->post['ups_tax_class_id'])) {
         $this->data['ups_tax_class_id'] = $this->request->post['ups_tax_class_id'];
     } else {
         $this->data['ups_tax_class_id'] = $this->getConfig()->get('ups_tax_class_id');
     }
     $this->getLoader()->model('localisation/tax_class');
     $this->data['tax_classes'] = $this->model_localisation_tax_class->getTaxClasses();
     if (isset($this->request->post['ups_geo_zone_id'])) {
         $this->data['ups_geo_zone_id'] = $this->request->post['ups_geo_zone_id'];
     } else {
         $this->data['ups_geo_zone_id'] = $this->getConfig()->get('ups_geo_zone_id');
     }
     $this->getLoader()->model('localisation/geo_zone');
     $this->data['geo_zones'] = $this->model_localisation_geo_zone->getGeoZones();
     if (isset($this->request->post['ups_status'])) {
         $this->data['ups_status'] = $this->request->post['ups_status'];
     } else {
         $this->data['ups_status'] = $this->getConfig()->get('ups_status');
     }
     if (isset($this->request->post['ups_sort_order'])) {
         $this->data['ups_sort_order'] = $this->request->post['ups_sort_order'];
     } else {
         $this->data['ups_sort_order'] = $this->getConfig()->get('ups_sort_order');
     }
     $this->template = 'shipping/ups.tpl';
     $this->children = array('common/header', 'common/footer');
     $this->getResponse()->setOutput($this->render());
 }
示例#3
0
 public function index()
 {
     $this->load->language('shipping/usps');
     $this->document->setTitle($this->language->get('heading_title'));
     $this->load->model('setting/setting');
     if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate()) {
         $this->model_setting_setting->editSetting('usps', $this->request->post);
         $this->session->data['success'] = $this->language->get('text_success');
         $this->redirect($this->url->link('extension/shipping', 'token=' . $this->session->data['token'], 'SSL'));
     }
     $this->data['heading_title'] = $this->language->get('heading_title');
     $this->data['text_enabled'] = $this->language->get('text_enabled');
     $this->data['text_disabled'] = $this->language->get('text_disabled');
     $this->data['text_all_zones'] = $this->language->get('text_all_zones');
     $this->data['text_none'] = $this->language->get('text_none');
     $this->data['text_yes'] = $this->language->get('text_yes');
     $this->data['text_no'] = $this->language->get('text_no');
     $this->data['text_domestic_00'] = $this->language->get('text_domestic_00');
     $this->data['text_domestic_01'] = $this->language->get('text_domestic_01');
     $this->data['text_domestic_02'] = $this->language->get('text_domestic_02');
     $this->data['text_domestic_03'] = $this->language->get('text_domestic_03');
     $this->data['text_domestic_1'] = $this->language->get('text_domestic_1');
     $this->data['text_domestic_2'] = $this->language->get('text_domestic_2');
     $this->data['text_domestic_3'] = $this->language->get('text_domestic_3');
     $this->data['text_domestic_4'] = $this->language->get('text_domestic_4');
     $this->data['text_domestic_5'] = $this->language->get('text_domestic_5');
     $this->data['text_domestic_6'] = $this->language->get('text_domestic_6');
     $this->data['text_domestic_7'] = $this->language->get('text_domestic_7');
     $this->data['text_domestic_12'] = $this->language->get('text_domestic_12');
     $this->data['text_domestic_13'] = $this->language->get('text_domestic_13');
     $this->data['text_domestic_16'] = $this->language->get('text_domestic_16');
     $this->data['text_domestic_17'] = $this->language->get('text_domestic_17');
     $this->data['text_domestic_18'] = $this->language->get('text_domestic_18');
     $this->data['text_domestic_19'] = $this->language->get('text_domestic_19');
     $this->data['text_domestic_22'] = $this->language->get('text_domestic_22');
     $this->data['text_domestic_23'] = $this->language->get('text_domestic_23');
     $this->data['text_domestic_25'] = $this->language->get('text_domestic_25');
     $this->data['text_domestic_27'] = $this->language->get('text_domestic_27');
     $this->data['text_domestic_28'] = $this->language->get('text_domestic_28');
     $this->data['text_international_1'] = $this->language->get('text_international_1');
     $this->data['text_international_2'] = $this->language->get('text_international_2');
     $this->data['text_international_4'] = $this->language->get('text_international_4');
     $this->data['text_international_5'] = $this->language->get('text_international_5');
     $this->data['text_international_6'] = $this->language->get('text_international_6');
     $this->data['text_international_7'] = $this->language->get('text_international_7');
     $this->data['text_international_8'] = $this->language->get('text_international_8');
     $this->data['text_international_9'] = $this->language->get('text_international_9');
     $this->data['text_international_10'] = $this->language->get('text_international_10');
     $this->data['text_international_11'] = $this->language->get('text_international_11');
     $this->data['text_international_12'] = $this->language->get('text_international_12');
     $this->data['text_international_13'] = $this->language->get('text_international_13');
     $this->data['text_international_14'] = $this->language->get('text_international_14');
     $this->data['text_international_15'] = $this->language->get('text_international_15');
     $this->data['text_international_16'] = $this->language->get('text_international_16');
     $this->data['text_international_21'] = $this->language->get('text_international_21');
     $this->data['entry_user_id'] = $this->language->get('entry_user_id');
     $this->data['entry_postcode'] = $this->language->get('entry_postcode');
     $this->data['entry_domestic'] = $this->language->get('entry_domestic');
     $this->data['entry_international'] = $this->language->get('entry_international');
     $this->data['entry_size'] = $this->language->get('entry_size');
     $this->data['entry_container'] = $this->language->get('entry_container');
     $this->data['entry_machinable'] = $this->language->get('entry_machinable');
     $this->data['entry_dimension'] = $this->language->get('entry_dimension');
     $this->data['entry_girth'] = $this->language->get('entry_girth');
     $this->data['entry_display_time'] = $this->language->get('entry_display_time');
     $this->data['entry_display_weight'] = $this->language->get('entry_display_weight');
     $this->data['entry_weight_class'] = $this->language->get('entry_weight_class');
     $this->data['entry_tax'] = $this->language->get('entry_tax');
     $this->data['entry_geo_zone'] = $this->language->get('entry_geo_zone');
     $this->data['entry_status'] = $this->language->get('entry_status');
     $this->data['entry_sort_order'] = $this->language->get('entry_sort_order');
     $this->data['entry_debug'] = $this->language->get('entry_debug');
     $this->data['button_save'] = $this->language->get('button_save');
     $this->data['button_cancel'] = $this->language->get('button_cancel');
     $this->data['tab_general'] = $this->language->get('tab_general');
     if (isset($this->error['warning'])) {
         $this->data['error_warning'] = $this->error['warning'];
     } else {
         $this->data['error_warning'] = '';
     }
     if (isset($this->error['user_id'])) {
         $this->data['error_user_id'] = $this->error['user_id'];
     } else {
         $this->data['error_user_id'] = '';
     }
     if (isset($this->error['postcode'])) {
         $this->data['error_postcode'] = $this->error['postcode'];
     } else {
         $this->data['error_postcode'] = '';
     }
     if (isset($this->error['width'])) {
         $this->data['error_width'] = $this->error['width'];
     } else {
         $this->data['error_width'] = '';
     }
     if (isset($this->error['length'])) {
         $this->data['error_length'] = $this->error['length'];
     } else {
         $this->data['error_length'] = '';
     }
     if (isset($this->error['height'])) {
         $this->data['error_height'] = $this->error['height'];
     } else {
         $this->data['error_height'] = '';
     }
     if (isset($this->error['girth'])) {
         $this->data['error_girth'] = $this->error['girth'];
     } else {
         $this->data['error_girth'] = '';
     }
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => false);
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_shipping'), 'href' => $this->url->link('extension/shipping', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => ' :: ');
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('shipping/usps', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => ' :: ');
     $this->data['action'] = $this->url->link('shipping/usps', 'token=' . $this->session->data['token'], 'SSL');
     $this->data['cancel'] = $this->url->link('extension/shipping', 'token=' . $this->session->data['token'], 'SSL');
     if (isset($this->request->post['usps_user_id'])) {
         $this->data['usps_user_id'] = $this->request->post['usps_user_id'];
     } else {
         $this->data['usps_user_id'] = $this->getConfig()->get('usps_user_id');
     }
     if (isset($this->request->post['usps_postcode'])) {
         $this->data['usps_postcode'] = $this->request->post['usps_postcode'];
     } else {
         $this->data['usps_postcode'] = $this->getConfig()->get('usps_postcode');
     }
     if (isset($this->request->post['usps_domestic_00'])) {
         $this->data['usps_domestic_00'] = $this->request->post['usps_domestic_00'];
     } else {
         $this->data['usps_domestic_00'] = $this->getConfig()->get('usps_domestic_00');
     }
     if (isset($this->request->post['usps_domestic_01'])) {
         $this->data['usps_domestic_01'] = $this->request->post['usps_domestic_01'];
     } else {
         $this->data['usps_domestic_01'] = $this->getConfig()->get('usps_domestic_01');
     }
     if (isset($this->request->post['usps_domestic_02'])) {
         $this->data['usps_domestic_02'] = $this->request->post['usps_domestic_02'];
     } else {
         $this->data['usps_domestic_02'] = $this->getConfig()->get('usps_domestic_02');
     }
     if (isset($this->request->post['usps_domestic_03'])) {
         $this->data['usps_domestic_03'] = $this->request->post['usps_domestic_03'];
     } else {
         $this->data['usps_domestic_03'] = $this->getConfig()->get('usps_domestic_03');
     }
     if (isset($this->request->post['usps_domestic_1'])) {
         $this->data['usps_domestic_1'] = $this->request->post['usps_domestic_1'];
     } else {
         $this->data['usps_domestic_1'] = $this->getConfig()->get('usps_domestic_1');
     }
     if (isset($this->request->post['usps_domestic_2'])) {
         $this->data['usps_domestic_2'] = $this->request->post['usps_domestic_2'];
     } else {
         $this->data['usps_domestic_2'] = $this->getConfig()->get('usps_domestic_2');
     }
     if (isset($this->request->post['usps_domestic_3'])) {
         $this->data['usps_domestic_3'] = $this->request->post['usps_domestic_3'];
     } else {
         $this->data['usps_domestic_3'] = $this->getConfig()->get('usps_domestic_3');
     }
     if (isset($this->request->post['usps_domestic_4'])) {
         $this->data['usps_domestic_4'] = $this->request->post['usps_domestic_4'];
     } else {
         $this->data['usps_domestic_4'] = $this->getConfig()->get('usps_domestic_4');
     }
     if (isset($this->request->post['usps_domestic_5'])) {
         $this->data['usps_domestic_5'] = $this->request->post['usps_domestic_5'];
     } else {
         $this->data['usps_domestic_5'] = $this->getConfig()->get('usps_domestic_5');
     }
     if (isset($this->request->post['usps_domestic_6'])) {
         $this->data['usps_domestic_6'] = $this->request->post['usps_domestic_6'];
     } else {
         $this->data['usps_domestic_6'] = $this->getConfig()->get('usps_domestic_6');
     }
     if (isset($this->request->post['usps_domestic_7'])) {
         $this->data['usps_domestic_7'] = $this->request->post['usps_domestic_7'];
     } else {
         $this->data['usps_domestic_7'] = $this->getConfig()->get('usps_domestic_7');
     }
     if (isset($this->request->post['usps_domestic_12'])) {
         $this->data['usps_domestic_12'] = $this->request->post['usps_domestic_12'];
     } else {
         $this->data['usps_domestic_12'] = $this->getConfig()->get('usps_domestic_12');
     }
     if (isset($this->request->post['usps_domestic_13'])) {
         $this->data['usps_domestic_13'] = $this->request->post['usps_domestic_13'];
     } else {
         $this->data['usps_domestic_13'] = $this->getConfig()->get('usps_domestic_13');
     }
     if (isset($this->request->post['usps_domestic_16'])) {
         $this->data['usps_domestic_16'] = $this->request->post['usps_domestic_16'];
     } else {
         $this->data['usps_domestic_16'] = $this->getConfig()->get('usps_domestic_16');
     }
     if (isset($this->request->post['usps_domestic_17'])) {
         $this->data['usps_domestic_17'] = $this->request->post['usps_domestic_17'];
     } else {
         $this->data['usps_domestic_17'] = $this->getConfig()->get('usps_domestic_17');
     }
     if (isset($this->request->post['usps_domestic_18'])) {
         $this->data['usps_domestic_18'] = $this->request->post['usps_domestic_18'];
     } else {
         $this->data['usps_domestic_18'] = $this->getConfig()->get('usps_domestic_18');
     }
     if (isset($this->request->post['usps_domestic_19'])) {
         $this->data['usps_domestic_19'] = $this->request->post['usps_domestic_19'];
     } else {
         $this->data['usps_domestic_19'] = $this->getConfig()->get('usps_domestic_19');
     }
     if (isset($this->request->post['usps_domestic_22'])) {
         $this->data['usps_domestic_22'] = $this->request->post['usps_domestic_22'];
     } else {
         $this->data['usps_domestic_22'] = $this->getConfig()->get('usps_domestic_22');
     }
     if (isset($this->request->post['usps_domestic_23'])) {
         $this->data['usps_domestic_23'] = $this->request->post['usps_domestic_23'];
     } else {
         $this->data['usps_domestic_23'] = $this->getConfig()->get('usps_domestic_23');
     }
     if (isset($this->request->post['usps_domestic_25'])) {
         $this->data['usps_domestic_25'] = $this->request->post['usps_domestic_25'];
     } else {
         $this->data['usps_domestic_25'] = $this->getConfig()->get('usps_domestic_25');
     }
     if (isset($this->request->post['usps_domestic_27'])) {
         $this->data['usps_domestic_27'] = $this->request->post['usps_domestic_27'];
     } else {
         $this->data['usps_domestic_27'] = $this->getConfig()->get('usps_domestic_27');
     }
     if (isset($this->request->post['usps_domestic_28'])) {
         $this->data['usps_domestic_28'] = $this->request->post['usps_domestic_28'];
     } else {
         $this->data['usps_domestic_28'] = $this->getConfig()->get('usps_domestic_28');
     }
     if (isset($this->request->post['usps_international_1'])) {
         $this->data['usps_international_1'] = $this->request->post['usps_international_1'];
     } else {
         $this->data['usps_international_1'] = $this->getConfig()->get('usps_international_1');
     }
     if (isset($this->request->post['usps_international_2'])) {
         $this->data['usps_international_2'] = $this->request->post['usps_international_2'];
     } else {
         $this->data['usps_international_2'] = $this->getConfig()->get('usps_international_2');
     }
     if (isset($this->request->post['usps_international_4'])) {
         $this->data['usps_international_4'] = $this->request->post['usps_international_4'];
     } else {
         $this->data['usps_international_4'] = $this->getConfig()->get('usps_international_4');
     }
     if (isset($this->request->post['usps_international_5'])) {
         $this->data['usps_international_5'] = $this->request->post['usps_international_5'];
     } else {
         $this->data['usps_international_5'] = $this->getConfig()->get('usps_international_5');
     }
     if (isset($this->request->post['usps_international_6'])) {
         $this->data['usps_international_6'] = $this->request->post['usps_international_6'];
     } else {
         $this->data['usps_international_6'] = $this->getConfig()->get('usps_international_6');
     }
     if (isset($this->request->post['usps_international_7'])) {
         $this->data['usps_international_7'] = $this->request->post['usps_international_7'];
     } else {
         $this->data['usps_international_7'] = $this->getConfig()->get('usps_international_7');
     }
     if (isset($this->request->post['usps_international_8'])) {
         $this->data['usps_international_8'] = $this->request->post['usps_international_8'];
     } else {
         $this->data['usps_international_8'] = $this->getConfig()->get('usps_international_8');
     }
     if (isset($this->request->post['usps_international_9'])) {
         $this->data['usps_international_9'] = $this->request->post['usps_international_9'];
     } else {
         $this->data['usps_international_9'] = $this->getConfig()->get('usps_international_9');
     }
     if (isset($this->request->post['usps_international_10'])) {
         $this->data['usps_international_10'] = $this->request->post['usps_international_10'];
     } else {
         $this->data['usps_international_10'] = $this->getConfig()->get('usps_international_10');
     }
     if (isset($this->request->post['usps_international_11'])) {
         $this->data['usps_international_11'] = $this->request->post['usps_international_11'];
     } else {
         $this->data['usps_international_11'] = $this->getConfig()->get('usps_international_11');
     }
     if (isset($this->request->post['usps_international_12'])) {
         $this->data['usps_international_12'] = $this->request->post['usps_international_12'];
     } else {
         $this->data['usps_international_12'] = $this->getConfig()->get('usps_international_12');
     }
     if (isset($this->request->post['usps_international_13'])) {
         $this->data['usps_international_13'] = $this->request->post['usps_international_13'];
     } else {
         $this->data['usps_international_13'] = $this->getConfig()->get('usps_international_13');
     }
     if (isset($this->request->post['usps_international_14'])) {
         $this->data['usps_international_14'] = $this->request->post['usps_international_14'];
     } else {
         $this->data['usps_international_14'] = $this->getConfig()->get('usps_international_14');
     }
     if (isset($this->request->post['usps_international_15'])) {
         $this->data['usps_international_15'] = $this->request->post['usps_international_15'];
     } else {
         $this->data['usps_international_15'] = $this->getConfig()->get('usps_international_15');
     }
     if (isset($this->request->post['usps_international_16'])) {
         $this->data['usps_international_16'] = $this->request->post['usps_international_16'];
     } else {
         $this->data['usps_international_16'] = $this->getConfig()->get('usps_international_16');
     }
     if (isset($this->request->post['usps_international_21'])) {
         $this->data['usps_international_21'] = $this->request->post['usps_international_21'];
     } else {
         $this->data['usps_international_21'] = $this->getConfig()->get('usps_international_21');
     }
     if (isset($this->request->post['usps_size'])) {
         $this->data['usps_size'] = $this->request->post['usps_size'];
     } else {
         $this->data['usps_size'] = $this->getConfig()->get('usps_size');
     }
     $this->data['sizes'] = array();
     $this->data['sizes'][] = array('text' => $this->language->get('text_regular'), 'value' => 'REGULAR');
     $this->data['sizes'][] = array('text' => $this->language->get('text_large'), 'value' => 'LARGE');
     if (isset($this->request->post['usps_container'])) {
         $this->data['usps_container'] = $this->request->post['usps_container'];
     } else {
         $this->data['usps_container'] = $this->getConfig()->get('usps_container');
     }
     $this->data['containers'] = array();
     $this->data['containers'][] = array('text' => $this->language->get('text_rectangular'), 'value' => 'RECTANGULAR');
     $this->data['containers'][] = array('text' => $this->language->get('text_non_rectangular'), 'value' => 'NONRECTANGULAR');
     $this->data['containers'][] = array('text' => $this->language->get('text_variable'), 'value' => 'VARIABLE');
     if (isset($this->request->post['usps_machinable'])) {
         $this->data['usps_machinable'] = $this->request->post['usps_machinable'];
     } else {
         $this->data['usps_machinable'] = $this->getConfig()->get('usps_machinable');
     }
     if (isset($this->request->post['usps_length'])) {
         $this->data['usps_length'] = $this->request->post['usps_length'];
     } else {
         $this->data['usps_length'] = $this->getConfig()->get('usps_length');
     }
     if (isset($this->request->post['usps_width'])) {
         $this->data['usps_width'] = $this->request->post['usps_width'];
     } else {
         $this->data['usps_width'] = $this->getConfig()->get('usps_width');
     }
     if (isset($this->request->post['usps_height'])) {
         $this->data['usps_height'] = $this->request->post['usps_height'];
     } else {
         $this->data['usps_height'] = $this->getConfig()->get('usps_height');
     }
     if (isset($this->request->post['usps_length'])) {
         $this->data['usps_length'] = $this->request->post['usps_length'];
     } else {
         $this->data['usps_length'] = $this->getConfig()->get('usps_length');
     }
     if (isset($this->request->post['usps_girth'])) {
         $this->data['usps_girth'] = $this->request->post['usps_girth'];
     } else {
         $this->data['usps_girth'] = $this->getConfig()->get('usps_girth');
     }
     if (isset($this->request->post['usps_display_time'])) {
         $this->data['usps_display_time'] = $this->request->post['usps_display_time'];
     } else {
         $this->data['usps_display_time'] = $this->getConfig()->get('usps_display_time');
     }
     if (isset($this->request->post['usps_display_weight'])) {
         $this->data['usps_display_weight'] = $this->request->post['usps_display_weight'];
     } else {
         $this->data['usps_display_weight'] = $this->getConfig()->get('usps_display_weight');
     }
     if (isset($this->request->post['usps_weight_class_id'])) {
         $this->data['usps_weight_class_id'] = $this->request->post['usps_weight_class_id'];
     } else {
         $this->data['usps_weight_class_id'] = $this->getConfig()->get('usps_weight_class_id');
     }
     //$this->getLoader()->model('localisation/weight_class');
     $this->data['weight_classes'] = MeasureUnitDAO::getInstance()->getWeightClasses();
     if (isset($this->request->post['usps_tax_class_id'])) {
         $this->data['usps_tax_class_id'] = $this->request->post['usps_tax_class_id'];
     } else {
         $this->data['usps_tax_class_id'] = $this->getConfig()->get('usps_tax_class_id');
     }
     if (isset($this->request->post['usps_geo_zone_id'])) {
         $this->data['usps_geo_zone_id'] = $this->request->post['usps_geo_zone_id'];
     } else {
         $this->data['usps_geo_zone_id'] = $this->getConfig()->get('usps_geo_zone_id');
     }
     if (isset($this->request->post['usps_debug'])) {
         $this->data['usps_debug'] = $this->request->post['usps_debug'];
     } else {
         $this->data['usps_debug'] = $this->getConfig()->get('usps_debug');
     }
     if (isset($this->request->post['usps_status'])) {
         $this->data['usps_status'] = $this->request->post['usps_status'];
     } else {
         $this->data['usps_status'] = $this->getConfig()->get('usps_status');
     }
     if (isset($this->request->post['usps_sort_order'])) {
         $this->data['usps_sort_order'] = $this->request->post['usps_sort_order'];
     } else {
         $this->data['usps_sort_order'] = $this->getConfig()->get('usps_sort_order');
     }
     $this->load->model('localisation/tax_class');
     $this->data['tax_classes'] = $this->model_localisation_tax_class->getTaxClasses();
     $this->load->model('localisation/geo_zone');
     $this->data['geo_zones'] = $this->model_localisation_geo_zone->getGeoZones();
     $this->template = 'shipping/usps.tpl';
     $this->children = array('common/header', 'common/footer');
     $this->getResponse()->setOutput($this->render());
 }
示例#4
0
 public function index()
 {
     $this->getLoader()->language('setting/setting');
     $this->document->setTitle($this->language->get('heading_title'));
     $this->getLoader()->model('setting/setting');
     if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate()) {
         $this->model_setting_setting->editSetting('config', $this->request->post);
         if ($this->getConfig()->get('config_currency_auto')) {
             $this->getLoader()->model('localisation/currency');
             $this->model_localisation_currency->updateCurrencies();
         }
         $this->session->data['success'] = $this->language->get('text_success');
         $this->redirect($this->url->link('setting/store', 'token=' . $this->session->data['token'], 'SSL'));
     }
     $this->data['heading_title'] = $this->language->get('heading_title');
     $this->data['text_none'] = $this->language->get('text_none');
     $this->data['text_yes'] = $this->language->get('text_yes');
     $this->data['text_no'] = $this->language->get('text_no');
     $this->data['text_image_manager'] = $this->language->get('text_image_manager');
     $this->data['text_browse'] = $this->language->get('text_browse');
     $this->data['text_clear'] = $this->language->get('text_clear');
     $this->data['text_shipping'] = $this->language->get('text_shipping');
     $this->data['text_payment'] = $this->language->get('text_payment');
     $this->data['text_mail'] = $this->language->get('text_mail');
     $this->data['text_smtp'] = $this->language->get('text_smtp');
     $this->data['entry_name'] = $this->language->get('entry_name');
     $this->data['entry_owner'] = $this->language->get('entry_owner');
     $this->data['entry_address'] = $this->language->get('entry_address');
     $this->data['entry_email'] = $this->language->get('entry_email');
     $this->data['entry_telephone'] = $this->language->get('entry_telephone');
     $this->data['entry_fax'] = $this->language->get('entry_fax');
     $this->data['entry_title'] = $this->language->get('entry_title');
     $this->data['entry_meta_description'] = $this->language->get('entry_meta_description');
     $this->data['entry_layout'] = $this->language->get('entry_layout');
     $this->data['entry_template'] = $this->language->get('entry_template');
     $this->data['entry_country'] = $this->language->get('entry_country');
     $this->data['entry_zone'] = $this->language->get('entry_zone');
     $this->data['entry_language'] = $this->language->get('entry_language');
     $this->data['entry_admin_language'] = $this->language->get('entry_admin_language');
     $this->data['entry_currency'] = $this->language->get('entry_currency');
     $this->data['entry_currency_auto'] = $this->language->get('entry_currency_auto');
     $this->data['entry_length_class'] = $this->language->get('entry_length_class');
     $this->data['entry_weight_class'] = $this->language->get('entry_weight_class');
     $this->data['entry_catalog_limit'] = $this->language->get('entry_catalog_limit');
     $this->data['entry_admin_limit'] = $this->language->get('entry_admin_limit');
     $this->data['entry_tax'] = $this->language->get('entry_tax');
     $this->data['entry_tax_default'] = $this->language->get('entry_tax_default');
     $this->data['entry_tax_customer'] = $this->language->get('entry_tax_customer');
     $this->data['entry_invoice_prefix'] = $this->language->get('entry_invoice_prefix');
     $this->data['entry_customer_group'] = $this->language->get('entry_customer_group');
     $this->data['entry_customer_price'] = $this->language->get('entry_customer_price');
     $this->data['entry_customer_approval'] = $this->language->get('entry_customer_approval');
     $this->data['entry_guest_checkout'] = $this->language->get('entry_guest_checkout');
     $this->data['entry_account'] = $this->language->get('entry_account');
     $this->data['entry_checkout'] = $this->language->get('entry_checkout');
     $this->data['entry_affiliate'] = $this->language->get('entry_affiliate');
     $this->data['entry_commission'] = $this->language->get('entry_commission');
     $this->data['entry_stock_display'] = $this->language->get('entry_stock_display');
     $this->data['entry_stock_warning'] = $this->language->get('entry_stock_warning');
     $this->data['entry_stock_checkout'] = $this->language->get('entry_stock_checkout');
     $this->data['entry_order_status'] = $this->language->get('entry_order_status');
     $this->data['entry_complete_status'] = $this->language->get('entry_complete_status');
     $this->data['entry_return_status'] = $this->language->get('entry_return_status');
     $this->data['entry_stock_status'] = $this->language->get('entry_stock_status');
     $this->data['entry_review'] = $this->language->get('entry_review');
     $this->data['entry_download'] = $this->language->get('entry_download');
     $this->data['entry_upload_allowed'] = $this->language->get('entry_upload_allowed');
     $this->data['entry_cart_weight'] = $this->language->get('entry_cart_weight');
     $this->data['entry_product_hotness_age'] = $this->language->get('field_product_hotness_age');
     $this->data['entry_logo'] = $this->language->get('entry_logo');
     $this->data['entry_icon'] = $this->language->get('entry_icon');
     $this->data['entry_image_category'] = $this->language->get('entry_image_category');
     $this->data['entry_image_thumb'] = $this->language->get('entry_image_thumb');
     $this->data['entry_image_popup'] = $this->language->get('entry_image_popup');
     $this->data['entry_image_product'] = $this->language->get('entry_image_product');
     $this->data['entry_image_additional'] = $this->language->get('entry_image_additional');
     $this->data['entry_image_related'] = $this->language->get('entry_image_related');
     $this->data['entry_image_compare'] = $this->language->get('entry_image_compare');
     $this->data['entry_image_wishlist'] = $this->language->get('entry_image_wishlist');
     $this->data['entry_image_cart'] = $this->language->get('entry_image_cart');
     $this->data['entry_mail_protocol'] = $this->language->get('entry_mail_protocol');
     $this->data['entry_mail_parameter'] = $this->language->get('entry_mail_parameter');
     $this->data['entry_smtp_host'] = $this->language->get('entry_smtp_host');
     $this->data['entry_smtp_username'] = $this->language->get('entry_smtp_username');
     $this->data['entry_smtp_password'] = $this->language->get('entry_smtp_password');
     $this->data['entry_smtp_port'] = $this->language->get('entry_smtp_port');
     $this->data['entry_smtp_timeout'] = $this->language->get('entry_smtp_timeout');
     $this->data['entry_alert_mail'] = $this->language->get('entry_alert_mail');
     $this->data['entry_account_mail'] = $this->language->get('entry_account_mail');
     $this->data['entry_alert_emails'] = $this->language->get('entry_alert_emails');
     $this->data['entry_use_ssl'] = $this->language->get('entry_use_ssl');
     $this->data['entry_maintenance'] = $this->language->get('entry_maintenance');
     $this->data['entry_encryption'] = $this->language->get('entry_encryption');
     $this->data['entry_seo_url'] = $this->language->get('entry_seo_url');
     $this->data['entry_seo_url_type'] = $this->language->get('entry_seo_url_type');
     $this->data['entry_seo_url_include_path'] = $this->language->get('entry_seo_url_include_path');
     $this->data['entry_seo_url_postfix'] = $this->language->get('entry_seo_url_postfix');
     $this->data['entry_compression'] = $this->language->get('entry_compression');
     $this->data['entry_error_display'] = $this->language->get('entry_error_display');
     $this->data['entry_error_log'] = $this->language->get('entry_error_log');
     $this->data['entry_error_filename'] = $this->language->get('entry_error_filename');
     $this->data['entry_google_analytics'] = $this->language->get('entry_google_analytics');
     $this->data['entry_sms_gatename'] = $this->language->get('entry_sms_gatename');
     $this->data['entry_sms_to'] = $this->language->get('entry_sms_to');
     $this->data['entry_sms_from'] = $this->language->get('entry_sms_from');
     $this->data['entry_sms_message'] = $this->language->get('entry_sms_message');
     $this->data['entry_sms_gate_username'] = $this->language->get('entry_sms_gate_username');
     $this->data['entry_sms_gate_password'] = $this->language->get('entry_sms_gate_password');
     $this->data['entry_sms_alert'] = $this->language->get('entry_sms_alert');
     $this->data['entry_sms_copy'] = $this->language->get('entry_sms_copy');
     $this->data['entry_registred_group'] = $this->language->get('entry_registred_group');
     $this->data['textYandexCounterCode'] = $this->language->get('YANDEX_COUNTER_CODE');
     $this->data['button_save'] = $this->language->get('button_save');
     $this->data['button_cancel'] = $this->language->get('button_cancel');
     $this->data['tab_general'] = $this->language->get('tab_general');
     $this->data['tab_store'] = $this->language->get('tab_store');
     $this->data['tab_local'] = $this->language->get('tab_local');
     $this->data['tab_option'] = $this->language->get('tab_option');
     $this->data['tab_image'] = $this->language->get('tab_image');
     $this->data['tab_mail'] = $this->language->get('tab_mail');
     $this->data['tab_server'] = $this->language->get('tab_server');
     $this->data['tab_sms'] = $this->language->get('tab_sms');
     $this->data['sms_gatenames'] = array();
     $files = glob(DIR_SYSTEM . 'smsgate/*.php');
     foreach ($files as $file) {
         $this->data['sms_gatenames'][] = basename($file, '.php');
     }
     $this->data['token'] = $this->session->data['token'];
     if (isset($this->error['warning'])) {
         $this->data['error_warning'] = $this->error['warning'];
     } else {
         $this->data['error_warning'] = '';
     }
     if (isset($this->error['name'])) {
         $this->data['error_name'] = $this->error['name'];
     } else {
         $this->data['error_name'] = '';
     }
     if (isset($this->error['owner'])) {
         $this->data['error_owner'] = $this->error['owner'];
     } else {
         $this->data['error_owner'] = '';
     }
     if (isset($this->error['address'])) {
         $this->data['error_address'] = $this->error['address'];
     } else {
         $this->data['error_address'] = '';
     }
     if (isset($this->error['email'])) {
         $this->data['error_email'] = $this->error['email'];
     } else {
         $this->data['error_email'] = '';
     }
     if (isset($this->error['telephone'])) {
         $this->data['error_telephone'] = $this->error['telephone'];
     } else {
         $this->data['error_telephone'] = '';
     }
     if (isset($this->error['title'])) {
         $this->data['error_title'] = $this->error['title'];
     } else {
         $this->data['error_title'] = '';
     }
     if (isset($this->error['image_category'])) {
         $this->data['error_image_category'] = $this->error['image_category'];
     } else {
         $this->data['error_image_category'] = '';
     }
     if (isset($this->error['image_thumb'])) {
         $this->data['error_image_thumb'] = $this->error['image_thumb'];
     } else {
         $this->data['error_image_thumb'] = '';
     }
     if (isset($this->error['image_popup'])) {
         $this->data['error_image_popup'] = $this->error['image_popup'];
     } else {
         $this->data['error_image_popup'] = '';
     }
     if (isset($this->error['image_product'])) {
         $this->data['error_image_product'] = $this->error['image_product'];
     } else {
         $this->data['error_image_product'] = '';
     }
     if (isset($this->error['image_additional'])) {
         $this->data['error_image_additional'] = $this->error['image_additional'];
     } else {
         $this->data['error_image_additional'] = '';
     }
     if (isset($this->error['image_related'])) {
         $this->data['error_image_related'] = $this->error['image_related'];
     } else {
         $this->data['error_image_related'] = '';
     }
     if (isset($this->error['image_compare'])) {
         $this->data['error_image_compare'] = $this->error['image_compare'];
     } else {
         $this->data['error_image_compare'] = '';
     }
     if (isset($this->error['image_wishlist'])) {
         $this->data['error_image_wishlist'] = $this->error['image_wishlist'];
     } else {
         $this->data['error_image_wishlist'] = '';
     }
     if (isset($this->error['image_cart'])) {
         $this->data['error_image_cart'] = $this->error['image_cart'];
     } else {
         $this->data['error_image_cart'] = '';
     }
     if (isset($this->error['error_filename'])) {
         $this->data['error_error_filename'] = $this->error['error_filename'];
     } else {
         $this->data['error_error_filename'] = '';
     }
     if (isset($this->error['catalog_limit'])) {
         $this->data['error_catalog_limit'] = $this->error['catalog_limit'];
     } else {
         $this->data['error_catalog_limit'] = '';
     }
     if (isset($this->error['admin_limit'])) {
         $this->data['error_admin_limit'] = $this->error['admin_limit'];
     } else {
         $this->data['error_admin_limit'] = '';
     }
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => false);
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('setting/setting', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => ' :: ');
     if (isset($this->session->data['success'])) {
         $this->data['success'] = $this->session->data['success'];
         unset($this->session->data['success']);
     } else {
         $this->data['success'] = '';
     }
     $this->data['action'] = $this->url->link('setting/setting', 'token=' . $this->session->data['token'], 'SSL');
     $this->data['cancel'] = $this->url->link('setting/store', 'token=' . $this->session->data['token'], 'SSL');
     if (isset($this->request->post['config_name'])) {
         $this->data['config_name'] = $this->request->post['config_name'];
     } else {
         $this->data['config_name'] = $this->getConfig()->get('config_name');
     }
     if (isset($this->request->post['config_owner'])) {
         $this->data['config_owner'] = $this->request->post['config_owner'];
     } else {
         $this->data['config_owner'] = $this->getConfig()->get('config_owner');
     }
     if (isset($this->request->post['config_address'])) {
         $this->data['config_address'] = $this->request->post['config_address'];
     } else {
         $this->data['config_address'] = $this->getConfig()->get('config_address');
     }
     if (isset($this->request->post['config_email'])) {
         $this->data['config_email'] = $this->request->post['config_email'];
     } else {
         $this->data['config_email'] = $this->getConfig()->get('config_email');
     }
     if (isset($this->request->post['config_telephone'])) {
         $this->data['config_telephone'] = $this->request->post['config_telephone'];
     } else {
         $this->data['config_telephone'] = $this->getConfig()->get('config_telephone');
     }
     if (isset($this->request->post['config_fax'])) {
         $this->data['config_fax'] = $this->request->post['config_fax'];
     } else {
         $this->data['config_fax'] = $this->getConfig()->get('config_fax');
     }
     if (isset($this->request->post['config_title'])) {
         $this->data['config_title'] = $this->request->post['config_title'];
     } else {
         $this->data['config_title'] = $this->getConfig()->get('config_title');
     }
     if (isset($this->request->post['config_meta_description'])) {
         $this->data['config_meta_description'] = $this->request->post['config_meta_description'];
     } else {
         $this->data['config_meta_description'] = $this->getConfig()->get('config_meta_description');
     }
     if (isset($this->request->post['config_layout_id'])) {
         $this->data['config_layout_id'] = $this->request->post['config_layout_id'];
     } else {
         $this->data['config_layout_id'] = $this->getConfig()->get('config_layout_id');
     }
     $this->getLoader()->model('design/layout');
     $this->data['layouts'] = $this->model_design_layout->getLayouts();
     if (isset($this->request->post['config_template'])) {
         $this->data['config_template'] = $this->request->post['config_template'];
     } else {
         $this->data['config_template'] = $this->getConfig()->get('config_template');
     }
     $this->data['templates'] = array();
     $directories = glob(DIR_CATALOG . 'view/theme/*', GLOB_ONLYDIR);
     foreach ($directories as $directory) {
         $this->data['templates'][] = basename($directory);
     }
     if (isset($this->request->post['config_country_id'])) {
         $this->data['config_country_id'] = $this->request->post['config_country_id'];
     } else {
         $this->data['config_country_id'] = $this->getConfig()->get('config_country_id');
     }
     $this->getLoader()->model('localisation/country');
     $this->data['countries'] = $this->model_localisation_country->getCountries();
     if (isset($this->request->post['config_zone_id'])) {
         $this->data['config_zone_id'] = $this->request->post['config_zone_id'];
     } else {
         $this->data['config_zone_id'] = $this->getConfig()->get('config_zone_id');
     }
     if (isset($this->request->post['config_language'])) {
         $this->data['config_language'] = $this->request->post['config_language'];
     } else {
         $this->data['config_language'] = $this->getConfig()->get('config_language');
     }
     $this->getLoader()->model('localisation/language');
     $this->data['languages'] = $this->model_localisation_language->getLanguages();
     if (isset($this->request->post['config_admin_language'])) {
         $this->data['config_admin_language'] = $this->request->post['config_admin_language'];
     } else {
         $this->data['config_admin_language'] = $this->getConfig()->get('config_admin_language');
     }
     if (isset($this->request->post['config_currency'])) {
         $this->data['config_currency'] = $this->request->post['config_currency'];
     } else {
         $this->data['config_currency'] = $this->getConfig()->get('config_currency');
     }
     if (isset($this->request->post['config_currency_auto'])) {
         $this->data['config_currency_auto'] = $this->request->post['config_currency_auto'];
     } else {
         $this->data['config_currency_auto'] = $this->getConfig()->get('config_currency_auto');
     }
     $this->getLoader()->model('localisation/currency');
     $this->data['currencies'] = $this->model_localisation_currency->getCurrencies();
     if (isset($this->request->post['config_length_class_id'])) {
         $this->data['config_length_class_id'] = $this->request->post['config_length_class_id'];
     } else {
         $this->data['config_length_class_id'] = $this->getConfig()->get('config_length_class_id');
     }
     $this->getLoader()->model('localisation/length_class');
     $this->data['length_classes'] = $this->model_localisation_length_class->getLengthClasses();
     if (isset($this->request->post['config_weight_class_id'])) {
         $this->data['config_weight_class_id'] = $this->request->post['config_weight_class_id'];
     } else {
         $this->data['config_weight_class_id'] = $this->getConfig()->get('config_weight_class_id');
     }
     //$this->getLoader()->model('localisation/weight_class');
     $this->data['weight_classes'] = MeasureUnitDAO::getInstance()->getWeightClasses();
     if (isset($this->request->post['config_catalog_limit'])) {
         $this->data['config_catalog_limit'] = $this->request->post['config_catalog_limit'];
     } else {
         $this->data['config_catalog_limit'] = $this->getConfig()->get('config_catalog_limit');
     }
     if (isset($this->request->post['config_admin_limit'])) {
         $this->data['config_admin_limit'] = $this->request->post['config_admin_limit'];
     } else {
         $this->data['config_admin_limit'] = $this->getConfig()->get('config_admin_limit');
     }
     if (isset($this->request->post['config_tax'])) {
         $this->data['config_tax'] = $this->request->post['config_tax'];
     } else {
         $this->data['config_tax'] = $this->getConfig()->get('config_tax');
     }
     if (isset($this->request->post['config_tax_default'])) {
         $this->data['config_tax_default'] = $this->request->post['config_tax_default'];
     } else {
         $this->data['config_tax_default'] = $this->getConfig()->get('config_tax_default');
     }
     if (isset($this->request->post['config_tax_customer'])) {
         $this->data['config_tax_customer'] = $this->request->post['config_tax_customer'];
     } else {
         $this->data['config_tax_customer'] = $this->getConfig()->get('config_tax_customer');
     }
     if (isset($this->request->post['config_invoice_prefix'])) {
         $this->data['config_invoice_prefix'] = $this->request->post['config_invoice_prefix'];
     } elseif ($this->getConfig()->get('config_invoice_prefix')) {
         $this->data['config_invoice_prefix'] = $this->getConfig()->get('config_invoice_prefix');
     } else {
         $this->data['config_invoice_prefix'] = 'INV-' . date('Y') . '-00';
     }
     $this->getLoader()->model('sale/customer_group');
     $this->data['customer_groups'] = $this->model_sale_customer_group->getCustomerGroups();
     if (isset($this->request->post['config_registred_group_id'])) {
         $this->data['config_registred_group_id'] = $this->request->post['config_registred_group_id'];
     } else {
         $this->data['config_registred_group_id'] = $this->getConfig()->get('config_registred_group_id');
     }
     if (isset($this->request->post['config_customer_group_id'])) {
         $this->data['config_customer_group_id'] = $this->request->post['config_customer_group_id'];
     } else {
         $this->data['config_customer_group_id'] = $this->getConfig()->get('config_customer_group_id');
     }
     if (isset($this->request->post['config_customer_price'])) {
         $this->data['config_customer_price'] = $this->request->post['config_customer_price'];
     } else {
         $this->data['config_customer_price'] = $this->getConfig()->get('config_customer_price');
     }
     if (isset($this->request->post['config_customer_approval'])) {
         $this->data['config_customer_approval'] = $this->request->post['config_customer_approval'];
     } else {
         $this->data['config_customer_approval'] = $this->getConfig()->get('config_customer_approval');
     }
     if (isset($this->request->post['config_guest_checkout'])) {
         $this->data['config_guest_checkout'] = $this->request->post['config_guest_checkout'];
     } else {
         $this->data['config_guest_checkout'] = $this->getConfig()->get('config_guest_checkout');
     }
     if (isset($this->request->post['config_account_id'])) {
         $this->data['config_account_id'] = $this->request->post['config_account_id'];
     } else {
         $this->data['config_account_id'] = $this->getConfig()->get('config_account_id');
     }
     if (isset($this->request->post['config_checkout_id'])) {
         $this->data['config_checkout_id'] = $this->request->post['config_checkout_id'];
     } else {
         $this->data['config_checkout_id'] = $this->getConfig()->get('config_checkout_id');
     }
     if (isset($this->request->post['config_affiliate_id'])) {
         $this->data['config_affiliate_id'] = $this->request->post['config_affiliate_id'];
     } else {
         $this->data['config_affiliate_id'] = $this->getConfig()->get('config_affiliate_id');
     }
     if (isset($this->request->post['config_commission'])) {
         $this->data['config_commission'] = $this->request->post['config_commission'];
     } elseif ($this->getConfig()->has('config_commission')) {
         $this->data['config_commission'] = $this->getConfig()->get('config_commission');
     } else {
         $this->data['config_commission'] = '5.00';
     }
     $this->getLoader()->model('catalog/information');
     $this->data['informations'] = $this->model_catalog_information->getInformations();
     if (isset($this->request->post['config_stock_display'])) {
         $this->data['config_stock_display'] = $this->request->post['config_stock_display'];
     } else {
         $this->data['config_stock_display'] = $this->getConfig()->get('config_stock_display');
     }
     if (isset($this->request->post['config_stock_warning'])) {
         $this->data['config_stock_warning'] = $this->request->post['config_stock_warning'];
     } else {
         $this->data['config_stock_warning'] = $this->getConfig()->get('config_stock_warning');
     }
     if (isset($this->request->post['config_stock_checkout'])) {
         $this->data['config_stock_checkout'] = $this->request->post['config_stock_checkout'];
     } else {
         $this->data['config_stock_checkout'] = $this->getConfig()->get('config_stock_checkout');
     }
     if (isset($this->request->post['config_stock_status_id'])) {
         $this->data['config_stock_status_id'] = $this->request->post['config_stock_status_id'];
     } else {
         $this->data['config_stock_status_id'] = $this->getConfig()->get('config_stock_status_id');
     }
     $this->getLoader()->model('localisation/stock_status');
     $this->data['stock_statuses'] = $this->model_localisation_stock_status->getStockStatuses();
     if (isset($this->request->post['config_order_status_id'])) {
         $this->data['config_order_status_id'] = $this->request->post['config_order_status_id'];
     } else {
         $this->data['config_order_status_id'] = $this->getConfig()->get('config_order_status_id');
     }
     $this->getLoader()->model('localisation/order_status');
     $this->data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses();
     if (isset($this->request->post['config_complete_status_id'])) {
         $this->data['config_complete_status_id'] = $this->request->post['config_complete_status_id'];
     } else {
         $this->data['config_complete_status_id'] = $this->getConfig()->get('config_complete_status_id');
     }
     if (isset($this->request->post['config_return_status_id'])) {
         $this->data['config_return_status_id'] = $this->request->post['config_return_status_id'];
     } else {
         $this->data['config_return_status_id'] = $this->getConfig()->get('config_return_status_id');
     }
     $this->getLoader()->model('localisation/return_status');
     $this->data['return_statuses'] = $this->model_localisation_return_status->getReturnStatuses();
     if (isset($this->request->post['config_review_status'])) {
         $this->data['config_review_status'] = $this->request->post['config_review_status'];
     } else {
         $this->data['config_review_status'] = $this->getConfig()->get('config_review_status');
     }
     if (isset($this->request->post['config_download'])) {
         $this->data['config_download'] = $this->request->post['config_download'];
     } else {
         $this->data['config_download'] = $this->getConfig()->get('config_download');
     }
     if (isset($this->request->post['config_upload_allowed'])) {
         $this->data['config_upload_allowed'] = $this->request->post['config_upload_allowed'];
     } else {
         $this->data['config_upload_allowed'] = $this->getConfig()->get('config_upload_allowed');
     }
     if (isset($this->request->post['config_cart_weight'])) {
         $this->data['config_cart_weight'] = $this->request->post['config_cart_weight'];
     } else {
         $this->data['config_cart_weight'] = $this->getConfig()->get('config_cart_weight');
     }
     if (isset($this->request->post['config_product_hotness_age'])) {
         $this->data['config_product_hotness_age'] = $this->request->post['config_product_hotness_age'];
     } else {
         $this->data['config_product_hotness_age'] = $this->getConfig()->get('config_product_hotness_age');
     }
     $this->getLoader()->model('tool/image');
     if (isset($this->request->post['config_logo'])) {
         $this->data['config_logo'] = $this->request->post['config_logo'];
     } else {
         $this->data['config_logo'] = $this->getConfig()->get('config_logo');
     }
     if ($this->getConfig()->get('config_logo') && file_exists(DIR_IMAGE . $this->getConfig()->get('config_logo')) && is_file(DIR_IMAGE . $this->getConfig()->get('config_logo'))) {
         $this->data['logo'] = $this->model_tool_image->resize($this->getConfig()->get('config_logo'), 100, 100);
     } else {
         $this->data['logo'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
     }
     if (isset($this->request->post['config_icon'])) {
         $this->data['config_icon'] = $this->request->post['config_icon'];
     } else {
         $this->data['config_icon'] = $this->getConfig()->get('config_icon');
     }
     if ($this->getConfig()->get('config_icon') && file_exists(DIR_IMAGE . $this->getConfig()->get('config_icon')) && is_file(DIR_IMAGE . $this->getConfig()->get('config_icon'))) {
         $this->data['icon'] = $this->model_tool_image->resize($this->getConfig()->get('config_icon'), 100, 100);
     } else {
         $this->data['icon'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
     }
     $this->data['no_image'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
     if (isset($this->request->post['config_image_category_width'])) {
         $this->data['config_image_category_width'] = $this->request->post['config_image_category_width'];
     } else {
         $this->data['config_image_category_width'] = $this->getConfig()->get('config_image_category_width');
     }
     if (isset($this->request->post['config_image_category_height'])) {
         $this->data['config_image_category_height'] = $this->request->post['config_image_category_height'];
     } else {
         $this->data['config_image_category_height'] = $this->getConfig()->get('config_image_category_height');
     }
     if (isset($this->request->post['config_image_thumb_width'])) {
         $this->data['config_image_thumb_width'] = $this->request->post['config_image_thumb_width'];
     } else {
         $this->data['config_image_thumb_width'] = $this->getConfig()->get('config_image_thumb_width');
     }
     if (isset($this->request->post['config_image_thumb_height'])) {
         $this->data['config_image_thumb_height'] = $this->request->post['config_image_thumb_height'];
     } else {
         $this->data['config_image_thumb_height'] = $this->getConfig()->get('config_image_thumb_height');
     }
     if (isset($this->request->post['config_image_popup_width'])) {
         $this->data['config_image_popup_width'] = $this->request->post['config_image_popup_width'];
     } else {
         $this->data['config_image_popup_width'] = $this->getConfig()->get('config_image_popup_width');
     }
     if (isset($this->request->post['config_image_popup_height'])) {
         $this->data['config_image_popup_height'] = $this->request->post['config_image_popup_height'];
     } else {
         $this->data['config_image_popup_height'] = $this->getConfig()->get('config_image_popup_height');
     }
     if (isset($this->request->post['config_image_product_width'])) {
         $this->data['config_image_product_width'] = $this->request->post['config_image_product_width'];
     } else {
         $this->data['config_image_product_width'] = $this->getConfig()->get('config_image_product_width');
     }
     if (isset($this->request->post['config_image_product_height'])) {
         $this->data['config_image_product_height'] = $this->request->post['config_image_product_height'];
     } else {
         $this->data['config_image_product_height'] = $this->getConfig()->get('config_image_product_height');
     }
     if (isset($this->request->post['config_image_additional_width'])) {
         $this->data['config_image_additional_width'] = $this->request->post['config_image_additional_width'];
     } else {
         $this->data['config_image_additional_width'] = $this->getConfig()->get('config_image_additional_width');
     }
     if (isset($this->request->post['config_image_additional_height'])) {
         $this->data['config_image_additional_height'] = $this->request->post['config_image_additional_height'];
     } else {
         $this->data['config_image_additional_height'] = $this->getConfig()->get('config_image_additional_height');
     }
     if (isset($this->request->post['config_image_related_width'])) {
         $this->data['config_image_related_width'] = $this->request->post['config_image_related_width'];
     } else {
         $this->data['config_image_related_width'] = $this->getConfig()->get('config_image_related_width');
     }
     if (isset($this->request->post['config_image_related_height'])) {
         $this->data['config_image_related_height'] = $this->request->post['config_image_related_height'];
     } else {
         $this->data['config_image_related_height'] = $this->getConfig()->get('config_image_related_height');
     }
     if (isset($this->request->post['config_image_compare_width'])) {
         $this->data['config_image_compare_width'] = $this->request->post['config_image_compare_width'];
     } else {
         $this->data['config_image_compare_width'] = $this->getConfig()->get('config_image_compare_width');
     }
     if (isset($this->request->post['config_image_compare_height'])) {
         $this->data['config_image_compare_height'] = $this->request->post['config_image_compare_height'];
     } else {
         $this->data['config_image_compare_height'] = $this->getConfig()->get('config_image_compare_height');
     }
     if (isset($this->request->post['config_image_wishlist_width'])) {
         $this->data['config_image_wishlist_width'] = $this->request->post['config_image_wishlist_width'];
     } else {
         $this->data['config_image_wishlist_width'] = $this->getConfig()->get('config_image_wishlist_width');
     }
     if (isset($this->request->post['config_image_wishlist_height'])) {
         $this->data['config_image_wishlist_height'] = $this->request->post['config_image_wishlist_height'];
     } else {
         $this->data['config_image_wishlist_height'] = $this->getConfig()->get('config_image_wishlist_height');
     }
     if (isset($this->request->post['config_image_cart_width'])) {
         $this->data['config_image_cart_width'] = $this->request->post['config_image_cart_width'];
     } else {
         $this->data['config_image_cart_width'] = $this->getConfig()->get('config_image_cart_width');
     }
     if (isset($this->request->post['config_image_cart_height'])) {
         $this->data['config_image_cart_height'] = $this->request->post['config_image_cart_height'];
     } else {
         $this->data['config_image_cart_height'] = $this->getConfig()->get('config_image_cart_height');
     }
     if (isset($this->request->post['config_mail_protocol'])) {
         $this->data['config_mail_protocol'] = $this->request->post['config_mail_protocol'];
     } else {
         $this->data['config_mail_protocol'] = $this->getConfig()->get('config_mail_protocol');
     }
     if (isset($this->request->post['config_mail_parameter'])) {
         $this->data['config_mail_parameter'] = $this->request->post['config_mail_parameter'];
     } else {
         $this->data['config_mail_parameter'] = $this->getConfig()->get('config_mail_parameter');
     }
     if (isset($this->request->post['config_smtp_host'])) {
         $this->data['config_smtp_host'] = $this->request->post['config_smtp_host'];
     } else {
         $this->data['config_smtp_host'] = $this->getConfig()->get('config_smtp_host');
     }
     if (isset($this->request->post['config_smtp_username'])) {
         $this->data['config_smtp_username'] = $this->request->post['config_smtp_username'];
     } else {
         $this->data['config_smtp_username'] = $this->getConfig()->get('config_smtp_username');
     }
     if (isset($this->request->post['config_smtp_password'])) {
         $this->data['config_smtp_password'] = $this->request->post['config_smtp_password'];
     } else {
         $this->data['config_smtp_password'] = $this->getConfig()->get('config_smtp_password');
     }
     if (isset($this->request->post['config_smtp_port'])) {
         $this->data['config_smtp_port'] = $this->request->post['config_smtp_port'];
     } elseif ($this->getConfig()->get('config_smtp_port')) {
         $this->data['config_smtp_port'] = $this->getConfig()->get('config_smtp_port');
     } else {
         $this->data['config_smtp_port'] = 25;
     }
     if (isset($this->request->post['config_smtp_timeout'])) {
         $this->data['config_smtp_timeout'] = $this->request->post['config_smtp_timeout'];
     } elseif ($this->getConfig()->get('config_smtp_timeout')) {
         $this->data['config_smtp_timeout'] = $this->getConfig()->get('config_smtp_timeout');
     } else {
         $this->data['config_smtp_timeout'] = 5;
     }
     if (isset($this->request->post['config_alert_mail'])) {
         $this->data['config_alert_mail'] = $this->request->post['config_alert_mail'];
     } else {
         $this->data['config_alert_mail'] = $this->getConfig()->get('config_alert_mail');
     }
     if (isset($this->request->post['config_account_mail'])) {
         $this->data['config_account_mail'] = $this->request->post['config_account_mail'];
     } else {
         $this->data['config_account_mail'] = $this->getConfig()->get('config_account_mail');
     }
     if (isset($this->request->post['config_alert_emails'])) {
         $this->data['config_alert_emails'] = $this->request->post['config_alert_emails'];
     } else {
         $this->data['config_alert_emails'] = $this->getConfig()->get('config_alert_emails');
     }
     if (isset($this->request->post['config_use_ssl'])) {
         $this->data['config_use_ssl'] = $this->request->post['config_use_ssl'];
     } else {
         $this->data['config_use_ssl'] = $this->getConfig()->get('config_use_ssl');
     }
     if (isset($this->request->post['config_seo_url'])) {
         $this->data['config_seo_url'] = $this->request->post['config_seo_url'];
     } else {
         $this->data['config_seo_url'] = $this->getConfig()->get('config_seo_url');
     }
     if (isset($this->request->post['config_seo_url_type'])) {
         $this->data['config_seo_url_type'] = $this->request->post['config_seo_url_type'];
     } elseif ($this->getConfig()->get('config_seo_url_type')) {
         $this->data['config_seo_url_type'] = $this->getConfig()->get('config_seo_url_type');
     } else {
         $this->data['config_seo_url_type'] = 'seo_url';
     }
     $this->data['seo_types'] = array();
     $this->data['seo_types'][] = array('type' => 'seo_url', 'name' => $this->language->get('text_seo_url'));
     $this->data['seo_types'][] = array('type' => 'seo_pro', 'name' => $this->language->get('text_seo_pro'));
     if (isset($this->request->post['config_seo_url_include_path'])) {
         $this->data['config_seo_url_include_path'] = $this->request->post['config_seo_url_include_path'];
     } else {
         $this->data['config_seo_url_include_path'] = $this->getConfig()->get('config_seo_url_include_path');
     }
     if (isset($this->request->post['config_seo_url_postfix'])) {
         $this->data['config_seo_url_postfix'] = $this->request->post['config_seo_url_postfix'];
     } else {
         $this->data['config_seo_url_postfix'] = $this->getConfig()->get('config_seo_url_postfix');
     }
     if (isset($this->request->post['config_maintenance'])) {
         $this->data['config_maintenance'] = $this->request->post['config_maintenance'];
     } else {
         $this->data['config_maintenance'] = $this->getConfig()->get('config_maintenance');
     }
     if (isset($this->request->post['config_encryption'])) {
         $this->data['config_encryption'] = $this->request->post['config_encryption'];
     } else {
         $this->data['config_encryption'] = $this->getConfig()->get('config_encryption');
     }
     if (isset($this->request->post['config_compression'])) {
         $this->data['config_compression'] = $this->request->post['config_compression'];
     } else {
         $this->data['config_compression'] = $this->getConfig()->get('config_compression');
     }
     if (isset($this->request->post['config_error_display'])) {
         $this->data['config_error_display'] = $this->request->post['config_error_display'];
     } else {
         $this->data['config_error_display'] = $this->getConfig()->get('config_error_display');
     }
     if (isset($this->request->post['config_error_log'])) {
         $this->data['config_error_log'] = $this->request->post['config_error_log'];
     } else {
         $this->data['config_error_log'] = $this->getConfig()->get('config_error_log');
     }
     if (isset($this->request->post['config_error_filename'])) {
         $this->data['config_error_filename'] = $this->request->post['config_error_filename'];
     } else {
         $this->data['config_error_filename'] = $this->getConfig()->get('config_error_filename');
     }
     if (isset($this->request->post['config_google_analytics'])) {
         $this->data['config_google_analytics'] = $this->request->post['config_google_analytics'];
     } else {
         $this->data['config_google_analytics'] = $this->getConfig()->get('config_google_analytics');
     }
     if (isset($this->request->post['config_sms_gatename'])) {
         $this->data['config_sms_gatename'] = $this->request->post['config_sms_gatename'];
     } else {
         $this->data['config_sms_gatename'] = $this->getConfig()->get('config_sms_gatename');
     }
     if (isset($this->request->post['config_sms_to'])) {
         $this->data['config_sms_to'] = $this->request->post['config_sms_to'];
     } else {
         $this->data['config_sms_to'] = $this->getConfig()->get('config_sms_to');
     }
     if (isset($this->request->post['config_sms_from'])) {
         $this->data['config_sms_from'] = $this->request->post['config_sms_from'];
     } else {
         $this->data['config_sms_from'] = $this->getConfig()->get('config_sms_from');
     }
     if (isset($this->request->post['config_sms_message'])) {
         $this->data['config_sms_message'] = $this->request->post['config_sms_message'];
     } else {
         $this->data['config_sms_message'] = $this->getConfig()->get('config_sms_message');
     }
     if (isset($this->request->post['config_sms_gate_username'])) {
         $this->data['config_sms_gate_username'] = $this->request->post['config_sms_gate_username'];
     } else {
         $this->data['config_sms_gate_username'] = $this->getConfig()->get('config_sms_gate_username');
     }
     if (isset($this->request->post['config_sms_gate_password'])) {
         $this->data['config_sms_gate_password'] = $this->request->post['config_sms_gate_password'];
     } else {
         $this->data['config_sms_gate_password'] = $this->getConfig()->get('config_sms_gate_password');
     }
     if (isset($this->request->post['config_sms_alert'])) {
         $this->data['config_sms_alert'] = $this->request->post['config_sms_alert'];
     } else {
         $this->data['config_sms_alert'] = $this->getConfig()->get('config_sms_alert');
     }
     if (isset($this->request->post['config_sms_copy'])) {
         $this->data['config_sms_copy'] = $this->request->post['config_sms_copy'];
     } else {
         $this->data['config_sms_copy'] = $this->getConfig()->get('config_sms_copy');
     }
     $this->data = array_merge($this->data, $this->parameters);
     $this->template = 'setting/setting.tpl';
     $this->children = array('common/header', 'common/footer');
     $this->getResponse()->setOutput($this->render());
 }
示例#5
0
 private function getForm()
 {
     $this->data['heading_title'] = $this->language->get('heading_title');
     $this->data['entry_title'] = $this->language->get('entry_title');
     $this->data['entry_unit'] = $this->language->get('entry_unit');
     $this->data['entry_value'] = $this->language->get('entry_value');
     $this->data['button_save'] = $this->language->get('button_save');
     $this->data['button_cancel'] = $this->language->get('button_cancel');
     if (isset($this->error['warning'])) {
         $this->data['error_warning'] = $this->error['warning'];
     } else {
         $this->data['error_warning'] = '';
     }
     if (isset($this->error['title'])) {
         $this->data['error_title'] = $this->error['title'];
     } else {
         $this->data['error_title'] = array();
     }
     if (isset($this->error['unit'])) {
         $this->data['error_unit'] = $this->error['unit'];
     } else {
         $this->data['error_unit'] = array();
     }
     $url = '';
     if (isset($this->request->get['sort'])) {
         $url .= '&sort=' . $this->request->get['sort'];
     }
     if (isset($this->request->get['order'])) {
         $url .= '&order=' . $this->request->get['order'];
     }
     if (isset($this->request->get['page'])) {
         $url .= '&page=' . $this->request->get['page'];
     }
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->getUrl()->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => false);
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->getUrl()->link('localisation/weight_class', 'token=' . $this->session->data['token'] . $url, 'SSL'), 'separator' => ' :: ');
     if (!isset($this->request->get['weight_class_id'])) {
         $this->data['action'] = $this->getUrl()->link('localisation/weight_class/insert', 'token=' . $this->session->data['token'] . $url, 'SSL');
     } else {
         $this->data['action'] = $this->getUrl()->link('localisation/weight_class/update', 'token=' . $this->session->data['token'] . '&weight_class_id=' . $this->request->get['weight_class_id'] . $url, 'SSL');
     }
     $this->data['cancel'] = $this->getUrl()->link('localisation/weight_class', 'token=' . $this->session->data['token'] . $url, 'SSL');
     if (isset($this->request->get['weight_class_id']) && $this->request->server['REQUEST_METHOD'] != 'POST') {
         $weight_class_info = MeasureUnitDAO::getInstance()->getWeightClass($this->request->get['weight_class_id']);
     }
     $this->getLoader()->model('localisation/language');
     $this->data['languages'] = $this->model_localisation_language->getLanguages();
     if (isset($this->request->post['weight_class_description'])) {
         $this->data['weight_class_description'] = $this->request->post['weight_class_description'];
     } elseif (isset($this->request->get['weight_class_id'])) {
         $this->data['weight_class_description'] = MeasureUnitDAO::getInstance()->getWeightClassDescriptions($this->request->get['weight_class_id']);
     } else {
         $this->data['weight_class_description'] = array();
     }
     if (isset($this->request->post['value'])) {
         $this->data['value'] = $this->request->post['value'];
     } elseif (isset($weight_class_info)) {
         $this->data['value'] = $weight_class_info['value'];
     } else {
         $this->data['value'] = '';
     }
     $this->template = 'localisation/weight_class_form.tpl';
     $this->children = array('common/header', 'common/footer');
     $this->getResponse()->setOutput($this->render());
 }
示例#6
0
 public function index()
 {
     $this->getLoader()->language('shipping/royal_mail');
     $this->document->setTitle($this->language->get('heading_title'));
     $this->getLoader()->model('setting/setting');
     if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate()) {
         $this->model_setting_setting->editSetting('royal_mail', $this->request->post);
         $this->session->data['success'] = $this->language->get('text_success');
         $this->redirect($this->url->link('extension/shipping', 'token=' . $this->session->data['token'], 'SSL'));
     }
     $this->data['heading_title'] = $this->language->get('heading_title');
     $this->data['text_enabled'] = $this->language->get('text_enabled');
     $this->data['text_disabled'] = $this->language->get('text_disabled');
     $this->data['text_all_zones'] = $this->language->get('text_all_zones');
     $this->data['text_none'] = $this->language->get('text_none');
     $this->data['text_yes'] = $this->language->get('text_yes');
     $this->data['text_no'] = $this->language->get('text_no');
     $this->data['entry_rate'] = $this->language->get('entry_rate');
     $this->data['entry_insurance'] = $this->language->get('entry_insurance');
     $this->data['entry_airmail_rate_1'] = $this->language->get('entry_airmail_rate_1');
     $this->data['entry_airmail_rate_2'] = $this->language->get('entry_airmail_rate_2');
     $this->data['entry_international_signed_rate_1'] = $this->language->get('entry_international_signed_rate_1');
     $this->data['entry_international_signed_insurance_1'] = $this->language->get('entry_international_signed_insurance_1');
     $this->data['entry_international_signed_rate_2'] = $this->language->get('entry_international_signed_rate_2');
     $this->data['entry_international_signed_insurance_2'] = $this->language->get('entry_international_signed_insurance_2');
     $this->data['entry_airsure_rate_1'] = $this->language->get('entry_airsure_rate_1');
     $this->data['entry_airsure_insurance_1'] = $this->language->get('entry_airsure_insurance_1');
     $this->data['entry_airsure_rate_2'] = $this->language->get('entry_airsure_rate_2');
     $this->data['entry_airsure_insurance_2'] = $this->language->get('entry_airsure_insurance_2');
     $this->data['entry_display_weight'] = $this->language->get('entry_display_weight');
     $this->data['entry_display_insurance'] = $this->language->get('entry_display_insurance');
     $this->data['entry_weight_class'] = $this->language->get('entry_weight_class');
     $this->data['entry_tax_class'] = $this->language->get('entry_tax_class');
     $this->data['entry_geo_zone'] = $this->language->get('entry_geo_zone');
     $this->data['entry_status'] = $this->language->get('entry_status');
     $this->data['entry_sort_order'] = $this->language->get('entry_sort_order');
     $this->data['button_save'] = $this->language->get('button_save');
     $this->data['button_cancel'] = $this->language->get('button_cancel');
     $this->data['tab_general'] = $this->language->get('tab_general');
     $this->data['tab_1st_class_standard'] = $this->language->get('tab_1st_class_standard');
     $this->data['tab_1st_class_recorded'] = $this->language->get('tab_1st_class_recorded');
     $this->data['tab_2nd_class_standard'] = $this->language->get('tab_2nd_class_standard');
     $this->data['tab_2nd_class_recorded'] = $this->language->get('tab_2nd_class_recorded');
     $this->data['tab_special_delivery_500'] = $this->language->get('tab_special_delivery_500');
     $this->data['tab_special_delivery_1000'] = $this->language->get('tab_special_delivery_1000');
     $this->data['tab_special_delivery_2500'] = $this->language->get('tab_special_delivery_2500');
     $this->data['tab_standard_parcels'] = $this->language->get('tab_standard_parcels');
     $this->data['tab_airmail'] = $this->language->get('tab_airmail');
     $this->data['tab_international_signed'] = $this->language->get('tab_international_signed');
     $this->data['tab_airsure'] = $this->language->get('tab_airsure');
     $this->data['tab_surface'] = $this->language->get('tab_surface');
     if (isset($this->error['warning'])) {
         $this->data['error_warning'] = $this->error['warning'];
     } else {
         $this->data['error_warning'] = '';
     }
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => false);
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_shipping'), 'href' => $this->url->link('extension/shipping', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => ' :: ');
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('shipping/royal_mail', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => ' :: ');
     $this->data['action'] = $this->url->link('shipping/royal_mail', 'token=' . $this->session->data['token'], 'SSL');
     $this->data['cancel'] = $this->url->link('extension/shipping', 'token=' . $this->session->data['token'], 'SSL');
     // 1st Class Standard
     if (isset($this->request->post['royal_mail_1st_class_standard_rate'])) {
         $this->data['royal_mail_1st_class_standard_rate'] = $this->request->post['royal_mail_1st_class_standard_rate'];
     } elseif ($this->getConfig()->has('royal_mail_1st_class_standard_rate')) {
         $this->data['royal_mail_1st_class_standard_rate'] = $this->getConfig()->get('royal_mail_1st_class_standard_rate');
     } else {
         $this->data['royal_mail_1st_class_standard_rate'] = '.1:1.58,.25:1.96,.5:2.48,.75:3.05,1:3.71,1.25:4.90,1.5:5.66,1.75:6.42,2:7.18,4:8.95,6:12.00,8:15.05,10:18.10';
     }
     if (isset($this->request->post['royal_mail_1st_class_standard_insurance'])) {
         $this->data['royal_mail_1st_class_standard_insurance'] = $this->request->post['royal_mail_1st_class_standard_insurance'];
     } elseif ($this->getConfig()->has('royal_mail_1st_class_standard_insurance')) {
         $this->data['royal_mail_1st_class_standard_insurance'] = $this->getConfig()->get('royal_mail_1st_class_standard_insurance');
     } else {
         $this->data['royal_mail_1st_class_standard_insurance'] = '39:0,100:1,250:2.25,500:3.5';
     }
     if (isset($this->request->post['royal_mail_1st_class_standard_status'])) {
         $this->data['royal_mail_1st_class_standard_status'] = $this->request->post['royal_mail_1st_class_standard_status'];
     } else {
         $this->data['royal_mail_1st_class_standard_status'] = $this->getConfig()->get('royal_mail_1st_class_standard_status');
     }
     // 1st Class Recorded
     if (isset($this->request->post['royal_mail_1st_class_recorded_rate'])) {
         $this->data['royal_mail_1st_class_recorded_rate'] = $this->request->post['royal_mail_1st_class_recorded_rate'];
     } elseif ($this->getConfig()->has('royal_mail_1st_class_recorded_rate')) {
         $this->data['royal_mail_1st_class_recorded_rate'] = $this->getConfig()->get('royal_mail_1st_class_recorded_rate');
     } else {
         $this->data['royal_mail_1st_class_recorded_rate'] = '.1:2.35,.25:2.73,.5:3.25,.75:3.82,1:4.86,1.25:5.67,1.5:6.43,1.75:7.19,2:7.95,4:9.72,6:12.77,8:15.82,10:18.87';
     }
     if (isset($this->request->post['royal_mail_1st_class_recorded_insurance'])) {
         $this->data['royal_mail_1st_class_recorded_insurance'] = $this->request->post['royal_mail_1st_class_recorded_insurance'];
     } elseif ($this->getConfig()->has('royal_mail_1st_class_recorded_insurance')) {
         $this->data['royal_mail_1st_class_recorded_insurance'] = $this->getConfig()->get('royal_mail_1st_class_recorded_insurance');
     } else {
         $this->data['royal_mail_1st_class_recorded_insurance'] = '39:46,100:46,250:46,500:46';
     }
     if (isset($this->request->post['royal_mail_1st_class_recorded_status'])) {
         $this->data['royal_mail_1st_class_recorded_status'] = $this->request->post['royal_mail_1st_class_recorded_status'];
     } else {
         $this->data['royal_mail_1st_class_recorded_status'] = $this->getConfig()->get('royal_mail_1st_class_recorded_status');
     }
     // 2nd Class Standard
     if (isset($this->request->post['royal_mail_2nd_class_standard_rate'])) {
         $this->data['royal_mail_2nd_class_standard_rate'] = $this->request->post['royal_mail_2nd_class_standard_rate'];
     } elseif ($this->getConfig()->has('royal_mail_2nd_class_standard_rate')) {
         $this->data['royal_mail_2nd_class_standard_rate'] = $this->getConfig()->get('royal_mail_2nd_class_standard_rate');
     } else {
         $this->data['royal_mail_2nd_class_standard_rate'] = '.1:1.33,.25:1.72,.5:2.16,.75:2.61,1:3.15';
     }
     if (isset($this->request->post['royal_mail_2nd_class_standard_status'])) {
         $this->data['royal_mail_2nd_class_standard_status'] = $this->request->post['royal_mail_2nd_class_standard_status'];
     } else {
         $this->data['royal_mail_2nd_class_standard_status'] = $this->getConfig()->get('royal_mail_2nd_class_standard_status');
     }
     // 2nd Class Recorded
     if (isset($this->request->post['royal_mail_2nd_class_recorded_rate'])) {
         $this->data['royal_mail_2nd_class_recorded_rate'] = $this->request->post['royal_mail_2nd_class_recorded_rate'];
     } elseif ($this->getConfig()->has('royal_mail_2nd_class_recorded_rate')) {
         $this->data['royal_mail_2nd_class_recorded_rate'] = $this->getConfig()->get('royal_mail_2nd_class_recorded_rate');
     } else {
         $this->data['royal_mail_2nd_class_recorded_rate'] = '.1:2.10,.25:2.49,.5:2.93,.75:3.38,1:3.92';
     }
     if (isset($this->request->post['royal_mail_2nd_class_recorded_insurance'])) {
         $this->data['royal_mail_2nd_class_recorded_insurance'] = $this->request->post['royal_mail_2nd_class_recorded_insurance'];
     } elseif ($this->getConfig()->has('royal_mail_2nd_class_recorded_insurance')) {
         $this->data['royal_mail_2nd_class_recorded_insurance'] = $this->getConfig()->get('royal_mail_2nd_class_recorded_insurance');
     } else {
         $this->data['royal_mail_2nd_class_recorded_insurance'] = '39:46,100:46,250:46,500:46';
     }
     if (isset($this->request->post['royal_mail_2nd_class_recorded_status'])) {
         $this->data['royal_mail_2nd_class_recorded_status'] = $this->request->post['royal_mail_2nd_class_recorded_status'];
     } else {
         $this->data['royal_mail_2nd_class_recorded_status'] = $this->getConfig()->get('royal_mail_2nd_class_recorded_status');
     }
     // Special Delivery < 500
     if (isset($this->request->post['royal_mail_special_delivery_500_rate'])) {
         $this->data['royal_mail_special_delivery_500_rate'] = $this->request->post['royal_mail_special_delivery_500_rate'];
     } elseif ($this->getConfig()->has('royal_mail_special_delivery_500_rate')) {
         $this->data['royal_mail_special_delivery_500_rate'] = $this->getConfig()->get('royal_mail_special_delivery_500_rate');
     } else {
         $this->data['royal_mail_special_delivery_500_rate'] = '.1:5.45,.5:5.90,1:7.00,2:9.05,10:22.70';
     }
     if (isset($this->request->post['royal_mail_special_delivery_500_insurance'])) {
         $this->data['royal_mail_special_delivery_500_insurance'] = $this->request->post['royal_mail_special_delivery_500_insurance'];
     } elseif ($this->getConfig()->has('royal_mail_special_delivery_500_insurance')) {
         $this->data['royal_mail_special_delivery_500_insurance'] = $this->getConfig()->get('royal_mail_special_delivery_500_insurance');
     } else {
         $this->data['royal_mail_special_delivery_500_insurance'] = '39:500,100:500,250:500,500:500';
     }
     if (isset($this->request->post['royal_mail_special_delivery_500_status'])) {
         $this->data['royal_mail_special_delivery_500_status'] = $this->request->post['royal_mail_special_delivery_500_status'];
     } else {
         $this->data['royal_mail_special_delivery_500_status'] = $this->getConfig()->get('royal_mail_special_delivery_500_status');
     }
     // Special Delivery < 1000
     if (isset($this->request->post['royal_mail_special_delivery_1000_rate'])) {
         $this->data['royal_mail_special_delivery_1000_rate'] = $this->request->post['royal_mail_special_delivery_1000_rate'];
     } elseif ($this->getConfig()->has('royal_mail_special_delivery_1000_rate')) {
         $this->data['royal_mail_special_delivery_1000_rate'] = $this->getConfig()->get('royal_mail_special_delivery_1000_rate');
     } else {
         $this->data['royal_mail_special_delivery_1000_rate'] = '.1:6.35,.5:6.80,1:7.90,2:9.95,10:23.60';
     }
     if (isset($this->request->post['royal_mail_special_delivery_1000_insurance'])) {
         $this->data['royal_mail_special_delivery_1000_insurance'] = $this->request->post['royal_mail_special_delivery_1000_insurance'];
     } elseif ($this->getConfig()->has('royal_mail_special_delivery_1000_insurance')) {
         $this->data['royal_mail_special_delivery_1000_insurance'] = $this->getConfig()->get('royal_mail_special_delivery_1000_insurance');
     } else {
         $this->data['royal_mail_special_delivery_1000_insurance'] = '39:1000,100:1000,250:1000,500:1000';
     }
     if (isset($this->request->post['royal_mail_special_delivery_1000_status'])) {
         $this->data['royal_mail_special_delivery_1000_status'] = $this->request->post['royal_mail_special_delivery_1000_status'];
     } else {
         $this->data['royal_mail_special_delivery_1000_status'] = $this->getConfig()->get('royal_mail_special_delivery_1000_status');
     }
     // Special Delivery < 2500
     if (isset($this->request->post['royal_mail_special_delivery_2500_rate'])) {
         $this->data['royal_mail_special_delivery_2500_rate'] = $this->request->post['royal_mail_special_delivery_2500_rate'];
     } elseif ($this->getConfig()->has('royal_mail_special_delivery_2500_rate')) {
         $this->data['royal_mail_special_delivery_2500_rate'] = $this->getConfig()->get('royal_mail_special_delivery_2500_rate');
     } else {
         $this->data['royal_mail_special_delivery_2500_rate'] = '.1:8.20,.5:8.65,1:9.75,2:11.80,10:25.45';
     }
     if (isset($this->request->post['royal_mail_special_delivery_2500_insurance'])) {
         $this->data['royal_mail_special_delivery_2500_insurance'] = $this->request->post['royal_mail_special_delivery_2500_insurance'];
     } elseif ($this->getConfig()->has('royal_mail_special_delivery_2500_insurance')) {
         $this->data['royal_mail_special_delivery_2500_insurance'] = $this->getConfig()->get('royal_mail_special_delivery_2500_insurance');
     } else {
         $this->data['royal_mail_special_delivery_2500_insurance'] = '39:2500,100:2500,250:2500,500:2500';
     }
     if (isset($this->request->post['royal_mail_special_delivery_2500_status'])) {
         $this->data['royal_mail_special_delivery_2500_status'] = $this->request->post['royal_mail_special_delivery_2500_status'];
     } else {
         $this->data['royal_mail_special_delivery_2500_status'] = $this->getConfig()->get('royal_mail_special_delivery_2500_status');
     }
     // Standard Parcels
     if (isset($this->request->post['royal_mail_standard_parcels_rate'])) {
         $this->data['royal_mail_standard_parcels_rate'] = $this->request->post['royal_mail_standard_parcels_rate'];
     } elseif ($this->getConfig()->has('royal_mail_standard_parcels_rate')) {
         $this->data['royal_mail_standard_parcels_rate'] = $this->getConfig()->get('royal_mail_standard_parcels_rate');
     } else {
         $this->data['royal_mail_standard_parcels_rate'] = '2:4.41,4:7.66,6:10.43,8:12.67,10:13.61,20:15.86';
     }
     if (isset($this->request->post['royal_mail_standard_parcels_insurance'])) {
         $this->data['royal_mail_standard_parcels_insurance'] = $this->request->post['royal_mail_standard_parcels_insurance'];
     } elseif ($this->getConfig()->has('royal_mail_standard_parcels_insurance')) {
         $this->data['royal_mail_standard_parcels_insurance'] = $this->getConfig()->get('royal_mail_standard_parcels_insurance');
     } else {
         $this->data['royal_mail_standard_parcels_insurance'] = '39:0,100:1,250:2.25,500:3.5';
     }
     if (isset($this->request->post['royal_mail_standard_parcels_status'])) {
         $this->data['royal_mail_standard_parcels_status'] = $this->request->post['royal_mail_standard_parcels_status'];
     } else {
         $this->data['royal_mail_standard_parcels_status'] = $this->getConfig()->get('royal_mail_standard_parcels_status');
     }
     // Airmail
     if (isset($this->request->post['royal_mail_airmail_rate_1'])) {
         $this->data['royal_mail_airmail_rate_1'] = $this->request->post['royal_mail_airmail_rate_1'];
     } elseif ($this->getConfig()->has('royal_mail_airmail_rate_1')) {
         $this->data['royal_mail_airmail_rate_1'] = $this->getConfig()->get('royal_mail_airmail_rate_1');
     } else {
         $this->data['royal_mail_airmail_rate_1'] = '0.01:1.49,0.02:1.49,0.04:1.49,0.06:1.49,0.08:1.49,0.1:1.49,0.12:1.61,0.14:1.79,0.16:1.93,0.18:2.11,0.2:2.19,0.22:2.29,0.24:2.39,0.26:2.49,0.28:2.56,0.30:2.61';
     }
     if (isset($this->request->post['royal_mail_airmail_rate_2'])) {
         $this->data['royal_mail_airmail_rate_2'] = $this->request->post['royal_mail_airmail_rate_2'];
     } elseif ($this->getConfig()->has('royal_mail_airmail_rate_2')) {
         $this->data['royal_mail_airmail_rate_2'] = $this->getConfig()->get('royal_mail_airmail_rate_2');
     } else {
         $this->data['royal_mail_airmail_rate_2'] = '0.02:2.07,0.02:2.07,0.04:2.07,0.06:2.07,0.08:2.07,0.1:2.07,0.12:2.32,0.14:2.60,0.16:2.90,0.18:3.20,0.2:3.50,0.22:3.80,0.24:3.96,0.26:4.06,0.28:4.16,0.30:4.26';
     }
     if (isset($this->request->post['royal_mail_airmail_status'])) {
         $this->data['royal_mail_airmail_status'] = $this->request->post['royal_mail_airmail_status'];
     } else {
         $this->data['royal_mail_airmail_status'] = $this->getConfig()->get('royal_mail_airmail_status');
     }
     // International Signed
     if (isset($this->request->post['royal_mail_international_signed_rate_1'])) {
         $this->data['royal_mail_international_signed_rate_1'] = $this->request->post['royal_mail_international_signed_rate_1'];
     } elseif ($this->getConfig()->has('royal_mail_international_signed_rate_1')) {
         $this->data['royal_mail_international_signed_rate_1'] = $this->getConfig()->get('royal_mail_international_signed_rate_1');
     } else {
         $this->data['royal_mail_international_signed_rate_1'] = '.1:6.44,.12:6.56,.14:6.74,.16:6.88,.18:7.06,.2:7.14,.22:7.24,.24:7.34,.26:7.44,.28:7.51,.3:7.56,.4:8.11,.5:8.66,.6:9.21,.7:9.76,.8:10.31,.9:10.86,1:11.41,1.2:12.51,1.4:13.61,1.6:14.71,1.8:15.81,2:16.91';
     }
     if (isset($this->request->post['royal_mail_international_signed_insurance_1'])) {
         $this->data['royal_mail_international_signed_insurance_1'] = $this->request->post['royal_mail_international_signed_insurance_1'];
     } elseif ($this->getConfig()->has('royal_mail_international_signed_insurance_1')) {
         $this->data['royal_mail_international_signed_insurance_1'] = $this->getConfig()->get('royal_mail_international_signed_insurance_1');
     } else {
         $this->data['royal_mail_international_signed_insurance_1'] = '39:0,250:2.20';
     }
     if (isset($this->request->post['royal_mail_international_signed_rate_2'])) {
         $this->data['royal_mail_international_signed_rate_2'] = $this->request->post['royal_mail_international_signed_rate_2'];
     } elseif ($this->getConfig()->has('royal_mail_international_signed_rate_2')) {
         $this->data['royal_mail_international_signed_rate_2'] = $this->getConfig()->get('royal_mail_international_signed_rate_2');
     } else {
         $this->data['royal_mail_international_signed_rate_2'] = '.1:7.37,.12:7.62,.14:7.90,.16:8.20,.18:8.50,.2:8.80,.22:9.10,.24:9.26,.26:9.36,.28:9.46,.3:9.56,.4:10.67,.5:11.78,.6:12.89,.7:14,.8:15.11,.9:16.22,1:17.33,1.2:19.55,1.4:21.77,1.6:23.99,1.8:26.21,2:28.43';
     }
     if (isset($this->request->post['royal_mail_international_signed_insurance_2'])) {
         $this->data['royal_mail_international_signed_insurance_2'] = $this->request->post['royal_mail_international_signed_insurance_2'];
     } elseif ($this->getConfig()->has('royal_mail_international_signed_insurance_2')) {
         $this->data['royal_mail_international_signed_insurance_2'] = $this->getConfig()->get('royal_mail_international_signed_insurance_2');
     } else {
         $this->data['royal_mail_international_signed_insurance_2'] = '39:0,250:2.20';
     }
     if (isset($this->request->post['royal_mail_international_signed_status'])) {
         $this->data['royal_mail_international_signed_status'] = $this->request->post['royal_mail_international_signed_status'];
     } else {
         $this->data['royal_mail_international_signed_status'] = $this->getConfig()->get('royal_mail_international_signed_status');
     }
     // Airsure
     if (isset($this->request->post['royal_mail_airsure_rate_1'])) {
         $this->data['royal_mail_airsure_rate_1'] = $this->request->post['royal_mail_airsure_rate_1'];
     } elseif ($this->getConfig()->has('royal_mail_airsure_rate_1')) {
         $this->data['royal_mail_airsure_rate_1'] = $this->getConfig()->get('royal_mail_airsure_rate_1');
     } else {
         $this->data['royal_mail_airsure_rate_1'] = '.1:6.79,.12:6.91,.14:7.09,.16:7.23,.18:7.41,.2:7.49,.22:7.59,.24:7.69,.26:7.79,.28:7.86,.3:7.91,.4:8.46,.5:9.01,.6:9.56,.7:10.11,.5:10.66,.7:11.21,.8:11.76,.9:12.31,1:12.86';
     }
     if (isset($this->request->post['royal_mail_airsure_insurance_1'])) {
         $this->data['royal_mail_airsure_insurance_1'] = $this->request->post['royal_mail_airsure_insurance_1'];
     } elseif ($this->getConfig()->has('royal_mail_airsure_insurance_1')) {
         $this->data['royal_mail_airsure_insurance_1'] = $this->getConfig()->get('royal_mail_airsure_insurance_1');
     } else {
         $this->data['royal_mail_airsure_insurance_1'] = '39:0,500:2.2';
     }
     if (isset($this->request->post['royal_mail_airsure_rate_2'])) {
         $this->data['royal_mail_airsure_rate_2'] = $this->request->post['royal_mail_airsure_rate_2'];
     } elseif ($this->getConfig()->has('royal_mail_airsure_rate_2')) {
         $this->data['royal_mail_airsure_rate_2'] = $this->getConfig()->get('royal_mail_airsure_rate_2');
     } else {
         $this->data['royal_mail_airsure_rate_2'] = '.1:7.37,.12:7.62,.14:7.90,.16:8.20,.18:8.5,.2:8.80,.22:9.10,.24:9.26,.26:9.36,.28:9.46,.3:9.56,.4:10.67,.5:11.78,.6:12.89,.7:14.00,.5:15.11,.7:16.22,.8:17.33,.9:18.44,1:19.55';
     }
     if (isset($this->request->post['royal_mail_airsure_insurance_2'])) {
         $this->data['royal_mail_airsure_insurance_2'] = $this->request->post['royal_mail_airsure_insurance_2'];
     } elseif ($this->getConfig()->has('royal_mail_airsure_insurance_2')) {
         $this->data['royal_mail_airsure_insurance_2'] = $this->getConfig()->get('royal_mail_airsure_insurance_2');
     } else {
         $this->data['royal_mail_airsure_insurance_2'] = '39:0,500:2.2';
     }
     if (isset($this->request->post['royal_mail_airsure_status'])) {
         $this->data['royal_mail_airsure_status'] = $this->request->post['royal_mail_airsure_status'];
     } else {
         $this->data['royal_mail_airsure_status'] = $this->getConfig()->get('royal_mail_airsure_status');
     }
     // Surface
     if (isset($this->request->post['royal_mail_surface_rate'])) {
         $this->data['royal_mail_surface_rate'] = $this->request->post['royal_mail_surface_rate'];
     } elseif ($this->getConfig()->has('royal_mail_surface_rate')) {
         $this->data['royal_mail_surface_rate'] = $this->getConfig()->get('royal_mail_surface_rate');
     } else {
         $this->data['royal_mail_surface_rate'] = '.1:0.91,.15:1.22,.2:1.53,.25:1.84,.3:2.14,.35:2.44,.4:2.76,.45:3.06,.5:3.36,.55:3.67,.6:3.98,.65:4.28,.7:4.59,.75:4.89,.8:5.2,.85:5.5,.9:5.81,1:6.42,1.1:7.03,1.2:7.65,1.3:8.25,1.4:8.87,1.5:9.48,1.6:10.09,1.7:10.61,1.8:11.13,1.9:11.65,2:12.17';
     }
     if (isset($this->request->post['royal_mail_surface_status'])) {
         $this->data['royal_mail_surface_status'] = $this->request->post['royal_mail_surface_status'];
     } else {
         $this->data['royal_mail_surface_status'] = $this->getConfig()->get('royal_mail_surface_status');
     }
     if (isset($this->request->post['royal_mail_display_weight'])) {
         $this->data['royal_mail_display_weight'] = $this->request->post['royal_mail_display_weight'];
     } else {
         $this->data['royal_mail_display_weight'] = $this->getConfig()->get('royal_mail_display_weight');
     }
     if (isset($this->request->post['royal_mail_display_insurance'])) {
         $this->data['royal_mail_display_insurance'] = $this->request->post['royal_mail_display_insurance'];
     } else {
         $this->data['royal_mail_display_insurance'] = $this->getConfig()->get('royal_mail_display_insurance');
     }
     if (isset($this->request->post['royal_mail_weight_class_id'])) {
         $this->data['royal_mail_weight_class_id'] = $this->request->post['royal_mail_weight_class_id'];
     } else {
         $this->data['royal_mail_weight_class_id'] = $this->getConfig()->get('royal_mail_weight_class_id');
     }
     //$this->getLoader()->model('localisation/weight_class');
     $this->data['weight_classes'] = MeasureUnitDAO::getInstance()->getWeightClasses();
     if (isset($this->request->post['royal_mail_tax_class_id'])) {
         $this->data['royal_mail_tax_class_id'] = $this->request->post['royal_mail_tax_class_id'];
     } else {
         $this->data['royal_mail_tax_class_id'] = $this->getConfig()->get('royal_mail_tax_class_id');
     }
     if (isset($this->request->post['royal_mail_geo_zone_id'])) {
         $this->data['royal_mail_geo_zone_id'] = $this->request->post['royal_mail_geo_zone_id'];
     } else {
         $this->data['royal_mail_geo_zone_id'] = $this->getConfig()->get('royal_mail_geo_zone_id');
     }
     if (isset($this->request->post['royal_mail_status'])) {
         $this->data['royal_mail_status'] = $this->request->post['royal_mail_status'];
     } else {
         $this->data['royal_mail_status'] = $this->getConfig()->get('royal_mail_status');
     }
     if (isset($this->request->post['royal_mail_sort_order'])) {
         $this->data['royal_mail_sort_order'] = $this->request->post['royal_mail_sort_order'];
     } else {
         $this->data['royal_mail_sort_order'] = $this->getConfig()->get('royal_mail_sort_order');
     }
     $this->getLoader()->model('localisation/tax_class');
     $this->data['tax_classes'] = $this->model_localisation_tax_class->getTaxClasses();
     $this->getLoader()->model('localisation/geo_zone');
     $this->data['geo_zones'] = $this->model_localisation_geo_zone->getGeoZones();
     $this->template = 'shipping/royal_mail.tpl';
     $this->children = array('common/header', 'common/footer');
     $this->getResponse()->setOutput($this->render());
 }