Example #1
0
 public function process()
 {
     parent::process();
     if (Module::isInstalled('agilesellershipping')) {
         include_once _PS_ROOT_DIR_ . "/modules/agilesellershipping/agilesellershipping.php";
         AgileSellerShipping::override_carriers();
     }
 }
 public static function appendMailTemplateVars($templateVars, $id_lang)
 {
     include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     if (!isset($templateVars['{order_name}'])) {
         return $templateVars;
     }
     $id_order = AgileSellerManager::get_order_id_from_maildata($templateVars);
     if (Module::isInstalled('agilesellershipping')) {
         include_once _PS_ROOT_DIR_ . "/modules/agilesellershipping/agilesellershipping.php";
         $module = new AgileSellerShipping();
         $id_cart = Order::getCartIdStatic($id_order);
         $theCart = new Cart($id_cart);
         $shipping_info = $module->displayInfoByCart($id_cart);
         $templateVars['{carrier}'] = $shipping_info;
         $templateVars['{total_shipping}'] = Tools::displayPrice($theCart->getOrderTotal(true, Cart::ONLY_SHIPPING));
         $templateVars['{total_paid}'] = Tools::displayPrice($theCart->getOrderTotal(true, Cart::BOTH));
     }
     $id_seller = intval(self::getObjectOwnerID('order', $id_order));
     $id_sellerinfo = SellerInfo::getIdBSellerId($id_seller);
     $sellerinfo = new SellerInfo($id_sellerinfo, $id_lang);
     if (!Validate::isLoadedObject($sellerinfo)) {
         return $templateVars;
     }
     $templateVars['{seller_logo}'] = Tools::getShopDomainSsl(true) . __PS_BASE_URI__ . 'img/as/' . $sellerinfo->id . '.jpg';
     $templateVars['{seller_address}'] = $sellerinfo->fulladdress($id_lang);
     $templateVars['{seller_name}'] = $sellerinfo->company;
     return $templateVars;
 }