public function __construct($id = null, $id_lang = null) { parent::__construct($id, $id_lang); $db = Db::getInstance(); $context = Context::getContext(); $controller = Tools::getValue('controller'); if ($controller == "orderdetail") { list($order) = $db->executeS('SELECT id_carrier, id_cart FROM `' . _DB_PREFIX_ . 'orders` WHERE id_order=' . (int) Tools::getValue('id_order')); $id_carrier = $order['id_carrier']; $id_cart = $order['id_cart']; } elseif (!in_array($controller, ["orderopc", "order"]) && $context && $context->cart) { $id_carrier = $context->cart->id_carrier; $id_cart = $context->cart->id; } else { $id_carrier = null; $id_cart = null; } $is_packetery_carrier = $db->getValue('SELECT 1 FROM `' . _DB_PREFIX_ . 'packetery_carrier` WHERE id_carrier=' . (int) $id_carrier) == 1; if ($is_packetery_carrier) { $selected_branch = $db->getValue('SELECT name_branch FROM `' . _DB_PREFIX_ . 'packetery_order` WHERE id_cart=' . (int) $id_cart); if ($selected_branch) { $this->name .= " ({$selected_branch})"; } } }
public function __construct($id = NULL, $id_lang = NULL) { parent::__construct($id, $id_lang); if (Module::isInstalled('agilemultipleseller') and intval($id) > 0) { $sql = 'SELECT IFNULL(is_default,0) AS is_default FROM ' . _DB_PREFIX_ . 'carrier_owner WHERE id_carrier=' . intval($id); $this->is_default = intval(Db::getInstance()->getValue($sql)); } }
public function __construct($id = null, $id_lang = null) { parent::__construct($id, $id_lang); /** * keep retrocompatibility SHIPPING_METHOD_DEFAULT * @deprecated 1.5.5 */ if ($this->shipping_method == Carrier::SHIPPING_METHOD_DEFAULT) $this->shipping_method = ((int)Configuration::get('PS_SHIPPING_METHOD') ? Carrier::SHIPPING_METHOD_WEIGHT : Carrier::SHIPPING_METHOD_PRICE); /** * keep retrocompatibility id_tax_rules_group * @deprecated 1.5.0 */ if ($this->id) $this->id_tax_rules_group = $this->getIdTaxRulesGroup(Context::getContext()); if ($this->name == '0') $this->name = Configuration::get('PS_SHOP_NAME'); $this->image_dir = _PS_SHIP_IMG_DIR_; }