コード例 #1
0
ファイル: public.php プロジェクト: magix-cms/ogone
 /**
  * @param $setParams
  * @return string
  */
 public function getData($setParams)
 {
     //Charge le fichier de traduction
     frontend_model_smarty::getInstance()->configLoad($this->modelSystem->base_path() . 'plugins/ogone/i18n/public_local_' . frontend_model_template::current_Language() . '.conf');
     $data = $this->setData();
     if ($data['formaction'] === 'test') {
         $urlOgone = Form::OGONE_TEST_URL;
     } elseif ($data['formaction'] === 'production') {
         $urlOgone = Form::OGONE_PRODUCTION_URL;
     }
     $url = magixcjquery_html_helpersHtml::getUrl() . '/' . frontend_model_template::current_Language() . '/';
     // Define form options
     // See Ogone_Form for list of supported options
     $options = array('sha1InPassPhrase' => $data['passphrase'], 'formAction' => $urlOgone, 'formSubmitType' => 'image', 'formSubmitImageUrl' => $setParams['formSubmitImageUrl'], 'formSubmitButtonName' => $this->template->getConfigVars('form_submit_button'), 'formSubmitButtonValue' => $this->template->getConfigVars('form_submit_button'), 'formSubmitButtonClass' => frontend_model_template::current_Language() . '_' . 'ogoneSubmitButton');
     $seturl = $this->setUrl();
     // https://github.com/jvandemo/Ogone
     // Define form parameters (see Ogone documentation for list)
     // Default parameter values can be set in Ogone_Form if required
     $params = array('PSPID' => $data['pspid'], 'orderID' => 'your_order_id / transaction ID', 'amount' => 100, 'currency' => 'EUR', 'language' => 'en_EN', 'COMPLUS' => 'custom data', 'OPERATION' => 'SAL', 'CN' => 'name of your client', 'EMAIL' => 'email of your client', 'accepturl' => $url . $setParams['plugin'] . $seturl['seturlok'], 'declineurl' => $url . $setParams['plugin'] . $seturl['seturlnook'], 'exceptionurl' => $url . $setParams['plugin'] . $seturl['seturlexception'], 'cancelurl' => $url . $setParams['plugin'] . $seturl['seturlcancel']);
     // Instantiate form
     $form = new Form($options, $params);
     // You can also add parameters after instantiation
     // with the addParam() method
     $form->addParam('CN', $setParams['lastname'] . ' ' . $setParams['firstname'])->addParam('EMAIL', $setParams['email'])->addParam('language', $setParams['language'])->addParam('orderID', $setParams['transaction'])->addParam('amount', $setParams['amount'])->addParam('COMPLUS', $setParams['COMPLUS'])->addParam('PARAMVAR', $setParams['PARAMVAR']);
     // Automatically generate HTML form with all params and SHA1Sign
     return $form->render();
 }
コード例 #2
0
/**
* Smarty {widget_cart_session} function plugin
*
* Type:     function
* Name:     widget_cart_session
* Date:     21 september 2012
* Update:   06 january 2014
* Purpose:
* USAGE:
   {widget_cartpay_session}
* Output:   
* @link 	http://www.magix-dev.be
* @author   Gerits Aurelien
* @version  1.5
* @param array
* @param Smarty
* @return string
*/
function smarty_function_widget_cartpay_session($params, $template)
{
    //    plugins_Autoloader::register(); //chargement des function plugins
    $session = new frontend_model_session();
    $session->_start_session('lang');
    //if session key_cart
    if (isset($_SESSION['key_cart'])) {
        $token_cart = $_SESSION['key_cart'];
    } else {
        $token_cart = magixglobal_model_cryptrsa::tokenId();
    }
    $array_sess = array('key_cart' => $token_cart);
    $session->session_run($array_sess);
    //    $session->debug();
    //@todo créer dans l'api une fonction public applicable dans les widgets.
    $modelSystem = new magixglobal_model_system();
    if ($_GET['magixmod'] != 'cartpay') {
        frontend_model_smarty::getInstance()->configLoad($modelSystem->base_path() . 'plugins/cartpay/i18n/public_local_' . frontend_model_template::current_Language() . '.conf');
    }
}
コード例 #3
0
ファイル: public.php プロジェクト: magix-cms/hipay
 /**
 * @param $setParams
 * @return string
 *
     $hipay = new plugins_hipay_public();
     $hipayProcess = $hipay->getData(
    array(
        'plugin'        =>  'cartpay',
        'key'           =>  $session_key,
        'order'         =>  $id_cart,
        'amount'        =>  $amount_pay_with_tax,
        'shipping'      =>  $shipping,
        'locale'        =>  'BE',
        'customerEmail' => $data_cart['email_cart']
    )
     );
 */
 public function getData($setParams)
 {
     try {
         frontend_model_smarty::getInstance()->configLoad($this->modelSystem->base_path() . 'plugins/hipay/i18n/public_local_' . frontend_model_template::current_Language() . '.conf');
         // Chargement des données Hipay en base de données
         $data = $this->setData();
         $collection = $this->about->getData();
         if ($data != null) {
             if ($data['formaction'] === 'test') {
                 $urlOrder = 'https://test-ws.hipay.com/soap/payment-v2?wsdl';
                 $urlCategory = 'https://test-payment.hipay.com/order/list-categories/id/';
             } elseif ($data['formaction'] === 'production') {
                 $urlOrder = 'https://ws.hipay.com/soap/payment-v2?wsdl';
                 $urlCategory = 'https://payment.hipay.com/order/list-categories/id/';
             }
             $getCategory = $this->getCategory(array('url' => $urlCategory . $data['websiteId'], 'debug' => false));
             $urlwebsite = magixcjquery_html_helpersHtml::getUrl() . '/' . $data['iso'] . '/';
             // seturl pour les notifications et process
             $seturl = $this->setUrl();
             if ($getCategory) {
                 // STEP 1 : soap flow options
                 $options = array('compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP, 'cache_wsdl' => WSDL_CACHE_NONE, 'soap_version' => SOAP_1_1, 'encoding' => 'UTF-8', 'exceptions' => true);
                 // STEP 2 : Soap client initialization
                 $client = new SoapClient($urlOrder, $options);
                 //https://test-ws.hipay.com/soap/payment-v2?wsdl
                 // L'interface de paiement sera, par défaut, en français international
                 $setlocal = $data['iso'] . '_' . strtoupper($setParams['locale']);
                 $executionDate = date('c');
                 // STEP 3 : Soap call on confirm method of manual-capture webservice
                 $result = $client->generate(array('parameters' => array('wsLogin' => $data['wsLogin'], 'wsPassword' => $data['wsPassword'], 'websiteId' => $data['websiteId'], 'categoryId' => $getCategory, 'description' => $this->template->getConfigVars('order_on') . ' ' . $collection['name'], 'freeData' => array(array('key' => 'order', 'value' => $setParams['order']), array('key' => 'shipping', 'value' => $setParams['shipping'])), 'currency' => 'EUR', 'amount' => $setParams['amount'], 'rating' => 'ALL', 'locale' => $setlocal, 'customerIpAddress' => $data['customerIpAddress'], 'manualCapture' => '0', 'executionDate' => $executionDate, 'customerEmail' => $setParams['customerEmail'], 'urlCallback' => $urlwebsite . $setParams['plugin'] . $seturl['seturlack'], 'urlAccept' => $urlwebsite . $setParams['plugin'] . $seturl['seturlok'], 'urlCancel' => $urlwebsite . $setParams['plugin'] . $seturl['seturlcancel'], 'urlDecline' => $urlwebsite . $setParams['plugin'] . $seturl['seturlexception'])));
                 //print_r($result);
                 $forms_hipay = '<a href="' . $result->{'generateResult'}->{'redirectUrl'} . '"><img src="https://www.hipaydirect.com/images/i18n/' . $data['iso'] . '/bt_payment_8.png" /></a>';
                 return $forms_hipay;
             }
         }
     } catch (SoapFault $e) {
         magixglobal_model_system::magixlog("SOAP Fault: (faultcode: {$e->faultcode}, faultstring: {$e->faultstring})", $e);
     }
 }
コード例 #4
0
ファイル: template.php プロジェクト: magix-cms/magixcms-3
 /**
  * Ajoute un ou plusieurs dossier de configuration et charge les fichiers associés ainsi que les variables
  * @access public
  * @param array $addConfigDir
  * @param array $load_files
  * @param bool $debug
  * @throws Exception
  */
 public static function addConfigFile(array $addConfigDir, array $load_files, $debug = false)
 {
     if (is_array($addConfigDir)) {
         frontend_model_smarty::getInstance()->addConfigDir($addConfigDir);
     } else {
         throw new Exception('Error: addConfigDir is not array');
     }
     if (is_array($load_files)) {
         foreach ($load_files as $row => $val) {
             if (is_string($row)) {
                 if (array_key_exists($row, $load_files)) {
                     frontend_model_smarty::getInstance()->configLoad(self::pathConfigLoad($row), $val);
                 }
             } else {
                 frontend_model_smarty::getInstance()->configLoad(self::pathConfigLoad($load_files[$row]));
             }
         }
     } else {
         throw new Exception('Error: load_files is not array');
     }
     if ($debug != false) {
         $config_dir = frontend_model_smarty::getInstance()->getConfigDir();
         $firebug = new magixcjquery_debug_magixfire();
         $firebug->magixFireDump('Config Dir', $config_dir);
         $firebug->magixFireDump('Load Files in configdir', $load_files);
         $firebug->magixFireDump('Config vars', frontend_model_smarty::getInstance()->getConfigVars());
     }
 }
コード例 #5
0
ファイル: plugins.php プロジェクト: biggtfish/magixcms
 /**
  * @access public
  * Active le test de l'installation de smarty 3
  */
 public function testInstall()
 {
     frontend_model_smarty::getInstance()->testInstall();
 }
コード例 #6
0
ファイル: smarty.php プロジェクト: magix-cms/magixcms-3
 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new frontend_model_smarty();
     }
     return self::$instance;
 }
コード例 #7
0
/**
* Smarty {widget_share_data} function plugin
*
* Type:     function
* Name:     widget_share_data
* Date:     24/03/2015
* Update:
* Output:
* @author   Gerits Aurélien (http://www.magix-cms.com)
* @version  1.0
* @param array
* @param Smarty
* @return string
* @example
*
   {widget_share_data
       assign="shareData"
   }
OR
   {widget_share_data
       exclude=["viadeo","linkedin"]
       assign="shareData"
   }
   <ul id="share-box" class="nav navbar-nav navbar-right">
       <li>
           <a href="#" class="dropdown-toggle" data-toggle="dropdown">
               <span class="glyphicon glyphicon-share">&nbsp;</span>
               <span class="dropdown-text">
               {#share#|ucfirst}
               </span>
           </a>
           <ul id="share-nav" class="dropdown-menu">
               {include file="section/loop/share.tpl" data=$shareData}
           </ul>
       </li>
   </ul>
* LOOP
{if is_array($data) && !empty($data)}
   {foreach $shareData as $item}
       <li>
           <a class="targetblank" href="{$item.url}" title="{#share_on#|ucfirst} {$item.name|ucfirst}">
               <img src="/skin/{template}/img/share/{$item.img}" alt="{$item.name|ucfirst}" /> {$item.name|ucfirst}
           </a>
       </li>
   {/foreach}
   {/if}
* OR
{if is_array($data) && !empty($data)}
   {foreach $shareData as $item}
       <li>
       <a class="targetblank" href="{$item.url}" title="{#share_on#|ucfirst} {$item.name|ucfirst}">
           <span class="fa fa-{$item.font}-square"></span>
       </a>
       </li>
   {/foreach}
{/if}
*/
function smarty_function_widget_share_data($params, $template)
{
    // *** Load active script var
    // ** Catch Domain var
    $url['root'] = magixcjquery_html_helpersHtml::getUrl();
    $url['relativ'] = $_SERVER["REQUEST_URI"];
    //strrpos récupère la dernière occurence de / et de .
    $url['share'] = $url['root'] . $url['relativ'];
    // ** Catch module's page name
    $smarty = frontend_model_smarty::getInstance();
    // ** find active module
    $script['fileName'] = substr($_SERVER['SCRIPT_NAME'], 1);
    $script['chartBeforeExt'] = strpos($script['fileName'], '.');
    $active_mod = substr($script['fileName'], 0, $script['chartBeforeExt']);
    // ** set active module name
    $name = null;
    switch ($active_mod) {
        case 'index':
            $name = $smarty->getTemplateVars('title');
            break;
        case 'catalog':
            if (isset($_GET['idproduct'])) {
                $productData = $smarty->getTemplateVars('product');
                $name = $productData['name'];
            } elseif (isset($_GET['idcls'])) {
                $subcatData = $smarty->getTemplateVars('subcat');
                $name = $subcatData['name'];
            } elseif (isset($_GET['idclc'])) {
                $catData = $smarty->getTemplateVars('cat');
                $name = $catData['name'];
            } else {
                $name = $smarty->getConfigVars('catalog_root_h1');
            }
            break;
        case 'cms':
            $name = $smarty->getTemplateVars('name_page');
            break;
        case 'news':
            if (isset($_GET['getnews'])) {
                $name = $smarty->getTemplateVars('name_news');
            } elseif (isset($_GET['tag'])) {
                $name = $smarty->getConfigVars('news_root_h1') . ': ' . $_GET['tag'];
            } else {
                $name = $smarty->getConfigVars('news_root_h1');
            }
            break;
        case 'plugin':
            $active_plugin = $_GET['magixmod'];
            switch ($active_plugin) {
                case 'contact':
                    $name = $smarty->getConfigVars('contact_root_h1');
                    break;
                default:
                    if (isset($_GET['pstring3'])) {
                        $name = ucfirst(str_replace('-', ' ', 'pstring3'));
                    } elseif (isset($_GET['pstring2'])) {
                        $name = ucfirst(str_replace('-', ' ', 'pstring2'));
                    } elseif (isset($_GET['pstring1'])) {
                        $name = ucfirst(str_replace('-', ' ', 'pstring1'));
                    } else {
                        $name = $smarty->getConfigVars($active_mod . '_root_h1');
                    }
            }
    }
    // *** Set share data
    $name = str_replace(' ', '%20', $name);
    // W3C validation require no ' ' in url
    $data_default = array('facebook' => array('name' => 'facebook', 'url' => 'http://www.facebook.com/share.php?u=' . $url['share'], 'img' => 'facebook.png', 'font' => 'facebook'), 'twitter' => array('name' => 'twitter', 'url' => 'https://twitter.com/intent/tweet?text=' . $name . '&amp;url=' . $url['share'], 'img' => 'twitter.png', 'font' => 'twitter'), 'viadeo' => array('name' => 'viadeo', 'url' => 'http://www.viadeo.com/shareit/share/?url=' . $url['share'] . '&amp;title=' . $name . '&amp;overview=' . $name, 'img' => 'viadeo.png', 'font' => ''), 'google' => array('name' => 'google', 'url' => 'https://plus.google.com/share?url=' . $url['share'], 'img' => 'google.png', 'font' => 'google-plus'), 'linkedin' => array('name' => 'linkedin', 'url' => 'http://www.linkedin.com/shareArticle?mini=true&url=' . $url['share'], 'img' => 'linkedin.png', 'font' => 'linkedin'));
    $exclude = isset($params['exclude']) ? $params['exclude'] : false;
    if ($exclude) {
        if (is_array($exclude)) {
            foreach ($exclude as $item) {
                unset($data_default[$item]);
            }
        }
    }
    $assign = isset($params['assign']) ? $params['assign'] : 'data';
    $template->assign($assign, $data_default);
}
コード例 #8
0
/**
* Smarty {widget_share_display} function plugin
*
* Type:     function
* Name:     widget_share_display
* Date:     04/01/2012
* Update:   12/01/2013
* Output:
* @author   Sire Sam (http://www.sire-sam.be)
* @author   Gerits Aurélien (http://www.magix-dev.be)
* @version  1.0
* @param array
* @param Smarty
* @return string
* <ul id="share-box" class="nav navbar-nav navbar-right">
   <li>
   <a href="#" class="dropdown-toggle" data-toggle="dropdown">
   <span class="glyphicon glyphicon-share">&nbsp;</span>
   <span class="dropdown-text">
   {#share#|ucfirst}
   </span>
   </a>
   {widget_share_display
   htmlStructure=[
   'container' => [
   'before' => '<ul id="share-nav" class="dropdown-menu">',
   'after' => '</ul>'
   ]
   ]
   }
   </li>
   </ul>
*/
function smarty_function_widget_share_display($params, $template)
{
    // *** Load active script var
    // ** Catch Domain var
    $url['root'] = magixcjquery_html_helpersHtml::getUrl();
    $url['relativ'] = $_SERVER["REQUEST_URI"];
    //strrpos récupère la dernière occurence de / et de .
    $url['share'] = $url['root'] . $url['relativ'];
    // ** Catch module's page name
    $smarty = frontend_model_smarty::getInstance();
    // ** find active module
    $script['fileName'] = substr($_SERVER['SCRIPT_NAME'], 1);
    $script['chartBeforeExt'] = strpos($script['fileName'], '.');
    $active_mod = substr($script['fileName'], 0, $script['chartBeforeExt']);
    // ** set active module name
    $name = null;
    switch ($active_mod) {
        case 'index':
            $name = $smarty->getTemplateVars('title');
            break;
        case 'catalog':
            if (isset($_GET['idproduct'])) {
                $productData = $smarty->getTemplateVars('product');
                $name = $productData['name'];
            } elseif (isset($_GET['idcls'])) {
                $subcatData = $smarty->getTemplateVars('subcat');
                $name = $subcatData['name'];
            } elseif (isset($_GET['idclc'])) {
                $catData = $smarty->getTemplateVars('cat');
                $name = $catData['name'];
            } else {
                $name = $smarty->getConfigVars('catalog_root_h1');
            }
            break;
        case 'cms':
            $name = $smarty->getTemplateVars('name_page');
            break;
        case 'news':
            if (isset($_GET['getnews'])) {
                $name = $smarty->getTemplateVars('name_news');
            } elseif (isset($_GET['tag'])) {
                $name = $smarty->getConfigVars('news_root_h1') . ': ' . $_GET['tag'];
            } else {
                $name = $smarty->getConfigVars('news_root_h1');
            }
            break;
        case 'plugin':
            $active_plugin = $_GET['magixmod'];
            switch ($active_plugin) {
                case 'contact':
                    $name = $smarty->getConfigVars('contact_root_h1');
                    break;
                default:
                    if (isset($_GET['pstring3'])) {
                        $name = ucfirst(str_replace('-', ' ', 'pstring3'));
                    } elseif (isset($_GET['pstring2'])) {
                        $name = ucfirst(str_replace('-', ' ', 'pstring2'));
                    } elseif (isset($_GET['pstring1'])) {
                        $name = ucfirst(str_replace('-', ' ', 'pstring1'));
                    } else {
                        $name = $smarty->getConfigVars($active_mod . '_root_h1');
                    }
            }
    }
    // *** Set share data
    $name = str_replace(' ', '%20', $name);
    // W3C validation require no ' ' in url
    $data_default = array('facebook' => array('name' => 'facebook', 'url' => 'http://www.facebook.com/share.php?u=' . $url['share'], 'img' => 'facebook.png'), 'twitter' => array('name' => 'twitter', 'url' => 'https://twitter.com/intent/tweet?text=' . $name . '&amp;url=' . $url['share'], 'img' => 'twitter.png'), 'viadeo' => array('name' => 'viadeo', 'url' => 'http://www.viadeo.com/shareit/share/?url=' . $url['share'] . '&amp;title=' . $name . '&amp;overview=' . $name, 'img' => 'viadeo.png'), 'google' => array('name' => 'google', 'url' => 'https://plus.google.com/share?url=' . $url['share'], 'onclick' => 'javascript:window.open(this.href,\'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;', 'img' => 'google.png'));
    // ** Select Data
    if (isset($params['dataSelect']['context'])) {
        $dataSelect = explode(',', $params['dataSelect']['context']);
        foreach ($dataSelect as $share) {
            if (array_key_exists($share, $data_default)) {
                $data[] = $data_default[$share];
            }
        }
    } else {
        $data = $data_default;
    }
    // *** Set default html structure
    $strucHtml_default = array('container' => array('before' => '<ul>', 'after' => '</ul>'), 'item' => array('before' => '<li>', 'after' => '</li>'), 'img' => array('before' => ' ', 'after' => ' '), 'name' => array('before' => ' ', 'after' => ' '), 'current' => array('class' => ' current'), 'last' => array('class' => ' last', 'col' => 1));
    // ** Set default elem to display
    $strucHtml_default['allow'] = array('', 'name', 'img');
    $strucHtml_default['display'] = array(1 => array('', 'img', 'name'));
    // ** Update html struct & item setting with custom var (params['htmlStructure'])
    $custom = $params['htmlStructure'] ? $params['htmlStructure'] : null;
    $default = $strucHtml_default;
    if (is_array($custom)) {
        $default['display'] = array();
        foreach ($custom as $k => $v) {
            foreach ($v as $sk => $sv) {
                if ($sv != null) {
                    $default[$k][$sk] = $sv;
                }
            }
            if (array_search($k, $default['allow'])) {
                $default['display'][1][] = $k;
            }
        }
    }
    // ** Update html struct with display params (params['htmlDisplay'])
    if (isset($params['htmlDisplay'])) {
        $default['display'] = $params['htmlDisplay'];
    }
    // * push null value on case[0] (allow array search on format function)
    foreach ($default['display'] as $k => $v) {
        array_unshift($default['display'][$k], null);
    }
    $strucHtml = $default;
    // ** in cas diplay is null, we take default value
    if ($strucHtml['display'][1] == null) {
        $strucHtml['display'][1] = $strucHtml_default['display'][1];
    }
    // *** Set translation var
    $t_share_on = frontend_model_template::getConfigVars('share_on');
    // *** format items loop (foreach item)
    $items = null;
    foreach ($data as $row) {
        // ** format item loop (foreach element)
        $elem = null;
        foreach ($strucHtml['display'][1] as $elem_type) {
            if (array_search($elem_type, $strucHtml['display'][1])) {
                switch ($elem_type) {
                    case 'name':
                        $elem .= ucfirst($row['name']);
                        break;
                    case 'img':
                        $elem .= '<img src="' . '/skin/' . frontend_model_template::frontendTheme()->themeSelected() . '/img/share/' . $row['img'] . '" alt="' . $row['name'] . '" />';
                }
            }
        }
        // ** item construct
        $items .= $strucHtml['item']['before'];
        $items .= '<a id="share-' . $row['name'] . '" class="targetblank" href="' . $row['url'] . '" title="' . ucfirst($t_share_on) . ': ' . $row['name'] . '">';
        $items .= $elem;
        $items .= '</a>';
        $items .= $strucHtml['item']['after'];
    }
    // *** container construct
    $output = $strucHtml['container']['before'];
    $output .= isset($params['htmlPrepend']) ? $params['htmlPrepend'] : null;
    $output .= $items;
    $output .= isset($params['htmlAppend']) ? $params['htmlAppend'] : null;
    $output .= $strucHtml['container']['after'];
    return $output;
}
コード例 #9
0
ファイル: public.php プロジェクト: magix-cms/cartpay
 /**
  *
  * Execute le plugin dans la partie public
  */
 public function run()
 {
     if (magixcjquery_filter_request::isSession('key_cart')) {
         $session_key = $_SESSION['key_cart'];
     } else {
         $session_key = null;
     }
     if (isset($this->module)) {
         $this->activeMods = $this->module->load_module(false);
     }
     //Chargement des données de traduction
     $this->_loadConfigVars();
     $create = frontend_controller_plugins::create();
     $header = new magixglobal_model_header();
     if (isset($this->mod) && isset($this->action)) {
         $cartMod = $this->activeMods[$this->mod];
         $params = array('params' => $_GET['params'], 'controller' => $this->template);
         call_user_func(array($cartMod, $this->action), $params);
     } elseif (isset($this->add_cart)) {
         $this->add_item_cart($_POST, $session_key);
     } elseif (isset($this->delete_item)) {
         $this->delete_item_cart($this->item_to_delete, $create);
     } elseif (isset($this->json_cart)) {
         $this->template->assign('getDataConfig', $this->getConfigData());
         $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
         $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
         $header->pragma();
         $header->cache_control("nocache");
         $header->getStatus('200');
         $header->html_header("UTF-8");
         //$this->load_cart_ajax($this->json_cart);
         $cartData = $this->getItemCartData($this->json_cart);
         $this->template->assign('getItemCartData', $cartData);
         if (!empty($cartData)) {
             $this->template->assign('getItemPriceData', $this->getItemPriceData($this->json_cart));
             $this->template->assign('setParamsData', array('remove' => 'true', 'editQuantity' => 'true'));
             $this->template->display('loop/cart.tpl');
         } else {
             return false;
         }
     } elseif (isset($this->get_nbr_items)) {
         $this->load_cart_nbr_item($session_key);
     } elseif (isset($this->get_price_items)) {
         $this->load_cart_price_item($session_key);
     } elseif (isset($this->get_amount_to_pay)) {
         $prices = $this->load_cart_amount($this->get_amount_to_pay);
         $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
         $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
         $header->pragma();
         $header->cache_control("nocache");
         $header->getStatus('200');
         $header->html_header("UTF-8");
         print $prices['amount_to_pay'];
     } elseif (isset($this->pstring1)) {
         $this->template->assign('getDataConfig', $this->getConfigData());
         if ($this->pstring2 == 'process') {
             $this->getProcessOrder($create);
         } elseif (isset($this->pstring2)) {
             if ($this->pstring2 == 'success') {
                 unset($_SESSION['key_cart']);
                 $this->getNotify('success', false);
             } elseif ($this->pstring2 == 'refused') {
                 unset($_SESSION['key_cart']);
                 $this->getNotify('refused', false);
             } elseif ($this->pstring2 == 'cancel') {
                 unset($_SESSION['key_cart']);
                 $this->getNotify('cancel', false);
             } elseif ($this->pstring2 == 'exception') {
                 unset($_SESSION['key_cart']);
                 $this->getNotify('exception', false);
             }
             $create->display('payment_statut.tpl');
         } else {
             if (isset($this->id_cart_to_send)) {
                 $this->validate_cart($this->id_cart_to_send, $create);
                 $this->load_cart_data($session_key, $create);
                 $create->assign('getItemCartData', $this->getItemCartData($this->id_cart_to_send));
                 $create->assign('getItemPriceData', $this->getItemPriceData($this->id_cart_to_send));
                 $create->assign('setParamsData', array('remove' => 'false', 'editQuantity' => 'false'));
                 $create->display('payment_resume.tpl');
             } else {
                 $this->load_cart_data($session_key, $create);
                 $create->assign('getItemCartData', $this->getItemCartData($this->id_cart_to_send));
                 $create->assign('getItemPriceData', $this->getItemPriceData($this->id_cart_to_send));
                 $create->assign('setParamsData', array('remove' => 'false', 'editQuantity' => 'false'));
                 $create->display('payment_resume.tpl');
             }
         }
     } else {
         if (magixcjquery_filter_request::isSession('key_cart')) {
             if (isset($this->devis_to_send)) {
                 //$this->validate_cart($this->id_cart_to_send,$create);
                 $dataCart = $this->getItemPriceData($this->id_cart_to_send);
                 parent::i_cart_order($this->id_cart_to_send, magixglobal_model_cryptrsa::uuid_generator(), $dataCart['amount_products'], $dataCart['shipping_ttc'], 'EUR', 'bank_wire');
                 $this->sendOrder($this->id_cart_to_send, $create, false);
                 parent::u_transmission_cart($this->id_cart_to_send, 1);
                 $this->getNotify('success', true);
                 //Supprime la session du panier après envoi du mail si le système de devis est activé
                 unset($_SESSION['key_cart']);
                 //return;
             } elseif (isset($this->quantity_qty)) {
                 $this->update_quantity_item();
             } elseif (isset($this->attr)) {
                 $this->update_attr_item();
             } elseif (isset($_GET['testmail'])) {
                 $cart = 1;
                 if (!empty($_GET['testmail'])) {
                     $testmail = intval($_GET['testmail']);
                     $cart = is_int($testmail) ? $testmail : 1;
                 }
                 $this->sendOrder($cart, $create, true);
             } else {
                 $this->modelSystem = new magixglobal_model_system();
                 frontend_model_template::addConfigFile(array($this->modelSystem->base_path() . 'plugins/cartpay/i18n/tools'), array('country_'), false);
                 $data_cart = parent::s_cart_session($session_key);
                 $id_cart = $data_cart['id_cart'];
                 $this->load_cart_data($session_key, $create);
                 $create->assign('getItemCartData', $this->getItemCartData($id_cart));
                 $create->assign('getItemPriceData', $this->getItemPriceData($id_cart));
                 $create->assign('setParamsData', array('remove' => 'true', 'editQuantity' => 'true'));
                 // getDataConfig
                 $getDataConfig = $this->getConfigData();
                 if ($getDataConfig['online_payment'] === '1') {
                     $create->assign('setPaymentType', 'secure');
                 } else {
                     $create->assign('setPaymentType', 'devis');
                 }
                 $this->template->assign('getDataConfig', $getDataConfig);
                 $this->template->assign('getItemsCountryData', $this->getItemsTvaData(array('fetch' => 'all', 'context' => 'country')));
                 $moduleJS = array();
                 $dynamicForm = false;
                 if (!empty($this->activeMods)) {
                     foreach ($this->activeMods as $name => $mod) {
                         if (property_exists($mod, 'js_impact')) {
                             if ($mod->js_impact) {
                                 $moduleJS[] = $name;
                             }
                         }
                         if ($name == 'profil' && $getDataConfig['profil'] || $name != 'profil') {
                             if (property_exists($mod, 'dynamicForm')) {
                                 if ($mod->dynamicForm) {
                                     $confdir = magixglobal_model_system::base_path() . 'plugins/' . $name . '/i18n/';
                                     $lang = frontend_model_template::getLanguage();
                                     if (file_exists($confdir)) {
                                         $translate = !empty($lang) ? $lang : 'fr';
                                         frontend_model_smarty::getInstance()->configLoad($confdir . 'public_local_' . $translate . '.conf', null);
                                         $dynamicForm = $this->template->fetch('forms/order.tpl', $name);
                                     }
                                 }
                             }
                         }
                     }
                 }
                 $this->template->assign('moduleJS', $moduleJS);
                 $this->template->assign('dynamicForm', $dynamicForm);
                 $create->display('index.tpl');
             }
         }
     }
 }