Exemple #1
0
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     //parent::initContent();
     $so = new SCfields('API');
     $fields = $so->getFields();
     /* Build back the fields list for SoColissimo, gift infos are send using the JS */
     $inputs = array();
     foreach ($_GET as $key => $value) {
         if (in_array($key, $fields)) {
             $inputs[$key] = trim(Tools::getValue($key));
         }
     }
     /* for belgium number specific format */
     if (Tools::getValue('cePays') == 'BE') {
         if (isset($inputs['cePhoneNumber']) && strpos($inputs['cePhoneNumber'], '324') === 0) {
             $inputs['cePhoneNumber'] = '+324' . Tools::substr($inputs['cePhoneNumber'], 3);
         }
     }
     $param_plus = array(Tools::getValue('trParamPlus'), Tools::getValue('gift'), $so->replaceAccentedChars(Tools::getValue('gift_message')));
     $inputs['trParamPlus'] = implode('|', $param_plus);
     /* Add signature to get the gift and gift message in the trParamPlus */
     $inputs['signature'] = $so->generateKey($inputs);
     // automatic settings api protocol for ssl
     $protocol = 'http://';
     if (Configuration::get('PS_SSL_ENABLED')) {
         $protocol = 'https://';
     }
     $socolissimo_url = $protocol . Configuration::get('SOCOLISSIMO_URL_MOBILE');
     Context::getContext()->smarty->assign(array('inputs' => $inputs, 'socolissimo_url' => $socolissimo_url, 'logo' => Tools::getHttpHost(true) . __PS_BASE_URI__ . 'modules/socolissimo/logo.gif', 'loader' => Tools::getHttpHost(true) . __PS_BASE_URI__ . 'modules/socolissimo/img/ajax-loader.gif'));
     $this->setTemplate('redirect.tpl');
 }
Exemple #2
0
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 *
 *  @author Prestashop SA <*****@*****.**>
 *  @author Quadra Informatique <*****@*****.**>
 *  @copyright  2007-2014 PrestaShop SA / 1997-2013 Quadra Informatique
 *  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 *  International Registred Trademark & Property of PrestaShop SA
 */
require_once '../../config/config.inc.php';
require_once _PS_ROOT_DIR_ . '/init.php';
require_once dirname(__FILE__) . '/classes/SCFields.php';
require_once dirname(__FILE__) . '/backward_compatibility/backward.php';
$so = new SCfields('API');
$fields = $so->getFields();
/* Build back the fields list for SoColissimo, gift infos are send using the JS */
$inputs = array();
foreach ($_GET as $key => $value) {
    if (in_array($key, $fields)) {
        $inputs[$key] = Tools::getValue($key);
    }
}
$param_plus = array(Tools::getValue('trParamPlus'), Tools::getValue('gift'), $so->replaceAccentedChars(Tools::getValue('gift_message')));
$inputs['trParamPlus'] = implode('|', $param_plus);
/* Add signature to get the gift and gift message in the trParamPlus */
$inputs['signature'] = $so->generateKey($inputs);
$socolissimo_url = Configuration::get('SOCOLISSIMO_URL');
Context::getContext()->smarty->assign(array('inputs' => $inputs, 'socolissimo_url' => $socolissimo_url));
Context::getContext()->smarty->display(_PS_MODULE_DIR_ . 'socolissimo/views/templates/front/redirect.tpl');
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author Prestashop SA <*****@*****.**>
*  @copyright  2007-2010 Prestashop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registred Trademark & Property of PrestaShop SA
*/
require_once '../../config/config.inc.php';
require_once _PS_ROOT_DIR_ . '/init.php';
require_once dirname(__FILE__) . '/classes/SCFields.php';
$so = new SCfields('API');
$fields = $so->getFields();
// Build back the fields list for SoColissimo, gift infos are send using the JS
$inputs = array();
foreach ($_GET as $key => $value) {
    if (in_array($key, $fields)) {
        $inputs[$key] = Tools::getValue($key);
    }
}
$param_plus = array(Tools::getValue('trParamPlus'), Tools::getValue('gift'), Tools::getValue('gift_message'));
$inputs['trParamPlus'] = implode('|', $param_plus);
// Add signature to get the gift and gift message in the trParamPlus
$inputs['signature'] = $so->generateKey($inputs);
$onload_script = 'parent.$.fancybox.close();';
if (Tools::isSubmit('first_call')) {
    $onload_script = 'document.getElementById(\'socoForm\').submit();';