public function getPageContent()
 {
     $ship_rules = GiveItShipping::getShippingRules();
     $page_url = GiveIt::CURRENT_INDEX . Tools::getValue('token') . '&configure=' . Tools::getValue('configure') . '&menu=' . Tools::getValue('menu');
     if ($id_shipping = Tools::getValue('edit_rule')) {
         $page_url .= '&edit_rule=' . $id_shipping;
     }
     $default_language = new Language((int) Configuration::get('PS_LANG_DEFAULT'));
     $this->context->smarty->assign(array('shipping_rules' => $ship_rules, 'page_url' => $page_url, 'default_language_notice' => $default_language->iso_code));
     if (version_compare(_PS_VERSION_, '1.6', '>=')) {
         return $this->context->smarty->fetch(_GIVEIT_TPL_DIR_ . 'admin/shipping_prices_ps16.tpl');
     } else {
         return $this->context->smarty->fetch(_GIVEIT_TPL_DIR_ . 'admin/shipping_prices.tpl');
     }
 }
Esempio n. 2
0
 private function getShippingRules()
 {
     if (!self::$shipping_rules) {
         foreach (GiveItShipping::getShippingRules() as $rule) {
             self::$shipping_rules[] = array('id' => $rule['id_giveit_shipping'] . '_', 'name' => $rule['title'], 'iso_code' => $rule['iso_code'], 'price' => (int) (Tools::convertPrice($rule['price']) * 100), 'free_above' => (int) (Tools::convertPrice($rule['free_above']) * 100), 'tax_percent' => $rule['tax_percent']);
         }
     }
 }