{l s='Ce produit a bien été ajouté au panier' mod='blockcartex'}
+{$product->name}
+{l s='Quantité' mod='blockcartex'} : {$quantity}
+{$price|replace:'.':','} € TTC
+diff --git a/modules/__socolissimo/CHANGELOG b/modules/__socolissimo/CHANGELOG new file mode 100644 index 00000000..984de602 --- /dev/null +++ b/modules/__socolissimo/CHANGELOG @@ -0,0 +1,7 @@ +Socolissimo + +2.3 : + +- Add Backward compatibility to use the module on 1.4 / 1.5 PrestaShop version. + (OPC and 5 steps process works) + diff --git a/modules/__socolissimo/ajax.php b/modules/__socolissimo/ajax.php new file mode 100644 index 00000000..cf2475d4 --- /dev/null +++ b/modules/__socolissimo/ajax.php @@ -0,0 +1,34 @@ + key +$result = array( + 'answer' => true, + 'msg' => '' +); + +// Check Token +if (Tools::getValue('token') != sha1('socolissimo'._COOKIE_KEY_.Context::getContext()->cart->id)) +{ + $result['answer'] = false; + $result['msg'] = $socolissimo->l('Invalid token'); +} + +// If no problem with token but no delivery available +if ($result['answer'] && !($result = $socolissimo->getDeliveryInfos(Context::getContext()->cart->id, Context::getContext()->customer->id))) +{ + $result['answer'] = false; + $result['msg'] = $socolissimo->l('No delivery information selected'); +} + +header('Content-type: application/json'); +echo json_encode($result); +exit(0); + +?> diff --git a/modules/__socolissimo/backward_compatibility/Context.php b/modules/__socolissimo/backward_compatibility/Context.php new file mode 100644 index 00000000..0a7b3727 --- /dev/null +++ b/modules/__socolissimo/backward_compatibility/Context.php @@ -0,0 +1,347 @@ + +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if ((bool)Configuration::get('PS_MOBILE_DEVICE')) + require_once(_PS_MODULE_DIR_ . '/mobile_theme/Mobile_Detect.php'); + +// Retro 1.3, 'class_exists' cause problem with autoload... +if (version_compare(_PS_VERSION_, '1.4', '<')) +{ + // Not exist for 1.3 + class Shop extends ObjectModel + { + public $id = 1; + public $id_shop_group = 1; + + public function __construct() + { + } + + + public static function getShops() + { + return array( + array('id_shop' => 1, 'name' => 'Default shop') + ); + } + + public static function getCurrentShop() + { + return 1; + } + } + + class Logger + { + public static function AddLog($message, $severity = 2) + { + $fp = fopen(dirname(__FILE__).'/../logs.txt', 'a+'); + fwrite($fp, '['.(int)$severity.'] '.Tools::safeOutput($message)); + fclose($fp); + } + } + +} + +// Not exist for 1.3 and 1.4 +class Context +{ + /** + * @var Context + */ + protected static $instance; + + /** + * @var Cart + */ + public $cart; + + /** + * @var Customer + */ + public $customer; + + /** + * @var Cookie + */ + public $cookie; + + /** + * @var Link + */ + public $link; + + /** + * @var Country + */ + public $country; + + /** + * @var Employee + */ + public $employee; + + /** + * @var Controller + */ + public $controller; + + /** + * @var Language + */ + public $language; + + /** + * @var Currency + */ + public $currency; + + /** + * @var AdminTab + */ + public $tab; + + /** + * @var Shop + */ + public $shop; + + /** + * @var Smarty + */ + public $smarty; + + /** + * @ var Mobile Detect + */ + public $mobile_detect; + + /** + * @var boolean|string mobile device of the customer + */ + protected $mobile_device; + + public function __construct() + { + global $cookie, $cart, $smarty, $link; + + $this->tab = null; + + $this->cookie = $cookie; + $this->cart = $cart; + $this->smarty = $smarty; + $this->link = $link; + + $this->controller = new ControllerBackwardModule(); + if (is_object($cookie)) + { + $this->currency = new Currency((int)$cookie->id_currency); + $this->language = new Language((int)$cookie->id_lang); + $this->country = new Country((int)$cookie->id_country); + $this->customer = new CustomerBackwardModule((int)$cookie->id_customer); + $this->employee = new Employee((int)$cookie->id_employee); + } + else + { + $this->currency = null; + $this->language = null; + $this->country = null; + $this->customer = null; + $this->employee = null; + } + + $this->shop = new ShopBackwardModule(); + + if ((bool)Configuration::get('PS_MOBILE_DEVICE')) + $this->mobile_detect = new Mobile_Detect(); + } + + public function getMobileDevice() + { + if (is_null($this->mobile_device)) + { + $this->mobile_device = false; + if ($this->checkMobileContext()) + { + switch ((int)Configuration::get('PS_MOBILE_DEVICE')) + { + case 0: // Only for mobile device + if ($this->mobile_detect->isMobile() && !$this->mobile_detect->isTablet()) + $this->mobile_device = true; + break; + case 1: // Only for touchpads + if ($this->mobile_detect->isTablet() && !$this->mobile_detect->isMobile()) + $this->mobile_device = true; + break; + case 2: // For touchpad or mobile devices + if ($this->mobile_detect->isMobile() || $this->mobile_detect->isTablet()) + $this->mobile_device = true; + break; + } + } + } + + return $this->mobile_device; + } + + protected function checkMobileContext() + { + return isset($_SERVER['HTTP_USER_AGENT']) + && (bool)Configuration::get('PS_MOBILE_DEVICE') + && !Context::getContext()->cookie->no_mobile; + } + + /** + * Get a singleton context + * + * @return Context + */ + public static function getContext() + { + if (!isset(self::$instance)) + self::$instance = new Context(); + return self::$instance; + } + + /** + * Clone current context + * + * @return Context + */ + public function cloneContext() + { + return clone($this); + } + + /** + * @return int Shop context type (Shop::CONTEXT_ALL, etc.) + */ + public static function shop() + { + if (!self::$instance->shop->getContextType()) + return ShopBackwardModule::CONTEXT_ALL; + return self::$instance->shop->getContextType(); + } +} + +/** + * Class Shop for Backward compatibility + */ +class ShopBackwardModule extends Shop +{ + const CONTEXT_ALL = 1; + + public $id = 1; + public $id_shop_group = 1; + + + public function getContextType() + { + return ShopBackwardModule::CONTEXT_ALL; + } + + // Simulate shop for 1.3 / 1.4 + public function getID() + { + return 1; + } + + /** + * Get shop theme name + * + * @return string + */ + public function getTheme() + { + return _THEME_NAME_; + } + + public function isFeatureActive() + { + return false; + } +} + +/** + * Class Controller for a Backward compatibility + * Allow to use method declared in 1.5 + */ +class ControllerBackwardModule +{ + /** + * @param $js_uri + * @return void + */ + public function addJS($js_uri) + { + Tools::addJS($js_uri); + } + + /** + * @param $css_uri + * @param string $css_media_type + * @return void + */ + public function addCSS($css_uri, $css_media_type = 'all') + { + Tools::addCSS($css_uri, $css_media_type); + } + + public function addJquery() + { + if (_PS_VERSION_ < '1.5') + $this->addJS(_PS_JS_DIR_.'jquery/jquery-1.4.4.min.js'); + elseif (_PS_VERSION_ >= '1.5') + $this->addJS(_PS_JS_DIR_.'jquery/jquery-1.7.2.min.js'); + } + +} + +/** + * Class Customer for a Backward compatibility + * Allow to use method declared in 1.5 + */ +class CustomerBackwardModule extends Customer +{ + public $logged = false; + /** + * Check customer informations and return customer validity + * + * @since 1.5.0 + * @param boolean $with_guest + * @return boolean customer validity + */ + public function isLogged($with_guest = false) + { + if (!$with_guest && $this->is_guest == 1) + return false; + + /* Customer is valid only if it can be load and if object password is the same as database one */ + if ($this->logged == 1 && $this->id && Validate::isUnsignedId($this->id) && Customer::checkPassword($this->id, $this->passwd)) + return true; + return false; + } +} diff --git a/modules/__socolissimo/backward_compatibility/Display.php b/modules/__socolissimo/backward_compatibility/Display.php new file mode 100644 index 00000000..3d0ae2db --- /dev/null +++ b/modules/__socolissimo/backward_compatibility/Display.php @@ -0,0 +1,24 @@ += '1.5') + parent::setTemplate($template); + else + $this->template = $template; + } + + // Overload displayContent for 1.4 + public function displayContent() + { + parent::displayContent(); + + echo Context::getContext()->smarty->fetch($this->template); + } +} \ No newline at end of file diff --git a/modules/__socolissimo/backward_compatibility/backward.ini b/modules/__socolissimo/backward_compatibility/backward.ini new file mode 100644 index 00000000..6520fb7a --- /dev/null +++ b/modules/__socolissimo/backward_compatibility/backward.ini @@ -0,0 +1 @@ +version = 0.4 \ No newline at end of file diff --git a/modules/__socolissimo/backward_compatibility/backward.php b/modules/__socolissimo/backward_compatibility/backward.php new file mode 100644 index 00000000..64ceb1f7 --- /dev/null +++ b/modules/__socolissimo/backward_compatibility/backward.php @@ -0,0 +1,55 @@ + +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/** + * Backward function compatibility + * Need to be called for each module in 1.4 + */ + +// Get out if the context is already defined +if (!in_array('Context', get_declared_classes())) + require_once(dirname(__FILE__).'/Context.php'); + +// Get out if the Display (BWDisplay to avoid any conflict)) is already defined +if (!in_array('BWDisplay', get_declared_classes())) + require_once(dirname(__FILE__).'/Display.php'); + +// If not under an object we don't have to set the context +if (!isset($this)) + return; +else if (isset($this->context)) +{ + // If we are under an 1.5 version and backoffice, we have to set some backward variable + if (_PS_VERSION_ >= '1.5' && isset($this->context->employee->id) && $this->context->employee->id) + { + global $currentIndex; + $currentIndex = AdminController::$currentIndex; + } + return; +} + +$this->context = Context::getContext(); +$this->smarty = $this->context->smarty; \ No newline at end of file diff --git a/modules/__socolissimo/backward_compatibility/index.php b/modules/__socolissimo/backward_compatibility/index.php new file mode 100644 index 00000000..319128b5 --- /dev/null +++ b/modules/__socolissimo/backward_compatibility/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; \ No newline at end of file diff --git a/modules/__socolissimo/classes/SCError.php b/modules/__socolissimo/classes/SCError.php new file mode 100644 index 00000000..6eeb627f --- /dev/null +++ b/modules/__socolissimo/classes/SCError.php @@ -0,0 +1,101 @@ +errors_list = array( + // Error code returned by the ECHEC URL request (Required) + SCError::REQUIRED => array( + '001' => $this->l('FO id missing'), + '002' => $this->l('Wrong FO id'), + '003' => $this->l('Client access denied'), + '004' => $this->l('Required fields missing'), + '006' => $this->l('Missing signature'), + '007' => $this->l('Wrong sign or number version'), + '008' => $this->l('Wrong zip code'), + '009' => $this->l('Wrong format of the Validation back url'), + '010' => $this->l('Wrong format of the Failed back url'), + '011' => $this->l('Invalid transaction number'), + '012' => $this->l('Wrong format of the fees'), + '015' => $this->l('App server unavailable'), + '016' => $this->l('SGBD unavailable') + ), + // Error code returned bu the Validation URL request (Warning) + SCError::WARNING => array( + '501' => $this->l('Mail field too long, trunked'), + '502' => $this->l('Phone field too long, trunked'), + '503' => $this->l('Name field too long, trunked'), + '504' => $this->l('First name field too long, trunked'), + '505' => $this->l('Social reason field too long, trunked'), + '506' => $this->l('Floor field too long, trunked'), + '507' => $this->l('Hall field too long, trunked'), + '508' => $this->l('Locality field too long'), + '509' => $this->l('Number and wording access field too long, trunked'), + '510' => $this->l('Town field too long, trunked'), + '511' => $this->l('Intercom field too long, trunked'), + '512' => $this->l('Further Information field too long, trunked'), + '513' => $this->l('Door code field too long, trunked'), + '514' => $this->l('Door code field too long, trunked'), + '515' => $this->l('Customer number too long, trunked'), + '516' => $this->l('Transaction order too long, trunked'), + '517' => $this->l('ParamPlus field too long, trunked'), + + '131' => $this->l('Invalid civility, field ignored'), + '132' => $this->l('Delay preparation is invalid, ignored'), + '133' => $this->l('Invalid weight field, ignored'), + + // Keep from previous dev (Personal error) + '998' => $this->l('Invalid regenerated sign'), + '999' => $this->l('Error occurred during shipping step.'), + ) + ); + } + + /** + * Return error type + * + * @param $number (integer or string) + * @param bool $type (SCError::REQUIRED or SCError::WARNING) + * @return mixed string|bool + */ + public function getError($number, $type = false) + { + $number = (string)trim($number); + + if ($type === false || !isset($this->errors_list[$type])) + $tab = $this->errors_list[SCError::REQUIRED] + $this->errors_list[SCError::WARNING]; + else + $tab = $this->errors_list[$type]; + + return isset($tab[$number]) ? $tab[$number] : false; + } + + /** + * Check the errors list. + * + * @param $errors + * @param bool $type + * @return bool + */ + public function checkErrors($errors, $type = false) + { + foreach($errors as $num) + if (($str = $this->getError($num, $type))) + return $str; + return false; + } +} \ No newline at end of file diff --git a/modules/__socolissimo/classes/SCFields.php b/modules/__socolissimo/classes/SCFields.php new file mode 100644 index 00000000..edc959df --- /dev/null +++ b/modules/__socolissimo/classes/SCFields.php @@ -0,0 +1,278 @@ + array('DOM', 'RDV'), + SCFields::RELAY_POINT => array('BPR', 'A2P', 'MRL', 'CIT', 'ACP', 'CDI'), + SCFields::API_REQUEST => array('API') + ); + + // By default, use the home delivery + public $delivery_mode = SCFields::HOME_DELIVERY; + + // Available returned fields for HOME_DELIVERY and RELAY POINT, fields ordered. + private $fields = array( + SCFields::HOME_DELIVERY => array( + 'PUDOFOID' => SCFields::REQUIRED, + 'CENAME' => SCFields::REQUIRED, + 'DYPREPARATIONTIME' => SCFields::REQUIRED, + 'DYFORWARDINGCHARGES'=> SCFields::REQUIRED, + 'TRCLIENTNUMBER' => SCFields::UNKNOWN, + 'TRORDERNUMBER' => SCFields::UNKNOWN, + 'ORDERID' => SCFields::REQUIRED, + 'CECIVILITY' => SCFields::REQUIRED, + 'CEFIRSTNAME' => SCFields::REQUIRED, + 'CECOMPANYNAME' => SCFields::NOT_REQUIRED, + 'CEADRESS1' => SCFields::UNKNOWN, + 'CEADRESS2' => SCFields::UNKNOWN, + 'CEADRESS3' => SCFields::REQUIRED, + 'CEADRESS4' => SCFields::UNKNOWN, + 'CEZIPCODE' => SCFields::REQUIRED, + 'CETOWN' => SCFields::REQUIRED, + 'DELIVERYMODE' => SCFields::REQUIRED, + 'CEDELIVERYINFORMATION' => SCFields::UNKNOWN, + 'CEEMAIL' => SCFields::REQUIRED, + 'CEPHONENUMBER' => SCFields::NOT_REQUIRED, + 'CEDOORCODE1' => SCFields::UNKNOWN, + 'CEDOORCODE2' => SCFields::UNKNOWN, + 'CEENTRYPHONE' => SCFields::UNKNOWN, + 'TRPARAMPLUS' => SCFields::UNKNOWN, + 'TRADERCOMPANYNAME' => SCFields::UNKNOWN, + 'ERRORCODE' => SCFields::UNKNOWN, + + // Error required if specific error exist (handle it has not required for now) + 'ERR_CENAME' => SCFields::NOT_REQUIRED, + 'ERR_CEFIRSTNAME' => SCFields::NOT_REQUIRED, + 'ERR_CECOMPANYNAME' => SCFields::NOT_REQUIRED, + 'ERR_CEADRESS1' => SCFields::NOT_REQUIRED, + 'ERR_CEADRESS2' => SCFields::NOT_REQUIRED, + 'ERR_CEADRESS3' => SCFields::NOT_REQUIRED, + 'ERR_CEADRESS4' => SCFields::NOT_REQUIRED, + 'ERR_CETOWN' => SCFields::NOT_REQUIRED, + 'ERR_CEDOORCODE1' => SCFields::NOT_REQUIRED, + 'ERR_CEDOORCODE2' => SCFields::NOT_REQUIRED, + 'ERR_CEENTRYPHONE' => SCFields::NOT_REQUIRED, + 'ERR_CEDELIVERYINFORMATION' => SCFields::NOT_REQUIRED, + 'ERR_CEEMAIL' => SCFields::NOT_REQUIRED, + 'ERR_CEPHONENUMBER' => SCFields::NOT_REQUIRED, + 'ERR_TRCLIENTNUMBER' => SCFields::NOT_REQUIRED, + 'ERR_TRORDERNUMBER' => SCFields::NOT_REQUIRED, + 'ERR_TRPARAMPLUS' => SCFields::NOT_REQUIRED, + 'ERR_CECIVILITY' => SCFields::NOT_REQUIRED, + 'ERR_DYWEIGHT' => SCFields::NOT_REQUIRED, + 'ERR_DYPREPARATIONTIME' => SCFields::NOT_REQUIRED, + 'TRRETURNURLKO' => SCFields::REQUIRED, + + 'SIGNATURE' => SCFields::IGNORED + ), + SCFields::RELAY_POINT => array( + 'PUDOFOID' => SCFields::REQUIRED, + 'CENAME' => SCFields::REQUIRED, + 'DYPREPARATIONTIME' => SCFields::REQUIRED, + 'DYFORWARDINGCHARGES' => SCFields::REQUIRED, + 'TRCLIENTNUMBER' => SCFields::UNKNOWN, + 'TRORDERNUMBER' => SCFields::UNKNOWN, + 'ORDERID' => SCFields::REQUIRED, + 'CECIVILITY' => SCFields::REQUIRED, + 'CEFIRSTNAME' => SCFields::REQUIRED, + 'CECOMPANYNAME' => SCFields::NOT_REQUIRED, + 'DELIVERYMODE' => SCFields::REQUIRED, + 'PRID' => SCFields::REQUIRED, + 'PRNAME' => SCFields::REQUIRED, + 'PRCOMPLADRESS' => SCFields::UNKNOWN, + 'PRADRESS1' => SCFields::REQUIRED, + 'PRADRESS2' => SCFields::UNKNOWN, + 'PRZIPCODE' => SCFields::REQUIRED, + 'PRTOWN' => SCFields::REQUIRED, + 'LOTACHEMINEMENT' => SCFields::UNKNOWN, + 'DISTRIBUTIONSORT' => SCFields::UNKNOWN, + 'VERSIONPLANTRI' => SCFields::UNKNOWN, + 'CEEMAIL' => SCFields::REQUIRED, + 'CEPHONENUMBER' => SCFields::REQUIRED, + 'TRPARAMPLUS' => SCFields::UNKNOWN, + 'TRADERCOMPANYNAME' => SCFields::UNKNOWN, + 'ERRORCODE' => SCFields::UNKNOWN, + + // Error required if specific error exist (handle it has not required for now) + 'ERR_CENAME' => SCFields::NOT_REQUIRED, + 'ERR_CEFIRSTNAME' => SCFields::NOT_REQUIRED, + 'ERR_CECOMPANYNAME' => SCFields::NOT_REQUIRED, + 'ERR_CEADRESS1' => SCFields::NOT_REQUIRED, + 'ERR_CEADRESS2' => SCFields::NOT_REQUIRED, + 'ERR_CEADRESS3' => SCFields::NOT_REQUIRED, + 'ERR_CEADRESS4' => SCFields::NOT_REQUIRED, + 'ERR_CETOWN' => SCFields::NOT_REQUIRED, + 'ERR_CEDOORCODE1' => SCFields::NOT_REQUIRED, + 'ERR_CEDOORCODE2' => SCFields::NOT_REQUIRED, + 'ERR_CEENTRYPHONE' => SCFields::NOT_REQUIRED, + 'ERR_CEDELIVERYINFORMATION' => SCFields::NOT_REQUIRED, + 'ERR_CEEMAIL' => SCFields::NOT_REQUIRED, + 'ERR_CEPHONENUMBER' => SCFields::NOT_REQUIRED, + 'ERR_TRCLIENTNUMBER' => SCFields::NOT_REQUIRED, + 'ERR_TRORDERNUMBER' => SCFields::NOT_REQUIRED, + 'ERR_TRPARAMPLUS' => SCFields::NOT_REQUIRED, + 'ERR_CECIVILITY' => SCFields::NOT_REQUIRED, + 'ERR_DYWEIGHT' => SCFields::NOT_REQUIRED, + 'ERR_DYPREPARATIONTIME' => SCFields::NOT_REQUIRED, + 'TRRETURNURLKO' => SCFields::REQUIRED, + + 'SIGNATURE' => SCFields::IGNORED + ), + SCFields::API_REQUEST => array( + 'pudoFOId' => SCFields::REQUIRED, + 'ceName' => SCFields::NOT_REQUIRED, + 'dyPreparationTime' => SCFields::NOT_REQUIRED, + 'dyForwardingCharges' => SCFields::REQUIRED, + 'trClientNumber' => SCFields::NOT_REQUIRED, + 'trOrderNumber' => SCFields::NOT_REQUIRED, + 'orderId' => SCFields::REQUIRED, + 'numVersion' => SCFields::REQUIRED, + 'ceCivility' => SCFields::NOT_REQUIRED, + 'ceFirstName' => SCFields::NOT_REQUIRED, + 'ceCompanyName' => SCFields::NOT_REQUIRED, + 'ceAdress1' => SCFields::NOT_REQUIRED, + 'ceAdress2' => SCFields::NOT_REQUIRED, + 'ceAdress3' => SCFields::NOT_REQUIRED, + 'ceAdress4' => SCFields::NOT_REQUIRED, + 'ceZipCode' => SCFields::NOT_REQUIRED, + 'ceTown' => SCFields::NOT_REQUIRED, + 'ceEntryPhone' => SCFields::NOT_REQUIRED, + 'ceDeliveryInformation' => SCFields::NOT_REQUIRED, + 'ceEmail' => SCFields::NOT_REQUIRED, + 'cePhoneNumber' => SCFields::NOT_REQUIRED, + 'ceDoorCode1' => SCFields::NOT_REQUIRED, + 'ceDoorCode2' => SCFields::NOT_REQUIRED, + 'dyWeight' => SCFields::NOT_REQUIRED, + 'trFirstOrder' => SCFields::NOT_REQUIRED, + 'trParamPlus' => SCFields::NOT_REQUIRED, + 'trReturnUrlKo' => SCFields::REQUIRED, + 'trReturnUrlOk' => SCFields::NOT_REQUIRED + ) + + ); + + public function __construct($delivery = 'DOM') + { + parent::__construct(); + + include(dirname(__FILE__).'/../backward_compatibility/backward.php'); + + $this->setDeliveryMode($delivery); + } + + /** + * Check if the field exist for Socolissimp + * + * @param $name + * @return bool + */ + public function isAvailableFields($name) + { + return array_key_exists(strtoupper(trim($name)), $this->fields[$this->delivery_mode]); + } + + /** + * Get field for a given restriction + * + * @param int $type + * @return mixed + */ + public function getFields($restriction = SCFields::ALL) + { + $tab = array(); + + if (in_array($restriction, $this->restriction_list)) + { + foreach($this->fields[$this->delivery_mode] as $key => $value) + if ($value == $restriction || $restriction == SCFields::ALL) + $tab[] = $key; + } + + return $tab; + } + + /** + * Check if the fields is required + * + * @param $name + * @return bool + */ + public function isRequireField($name) + { + return (in_array(strtoupper($name), $this->fields[$this->delivery_mode]) && + $this->fields[$this->delivery_mode] == SCFields::REQUIRED); + } + + + /** + * Set delivery mode + * + * @param $delivery + * @return bool + */ + public function setDeliveryMode($delivery) + { + if ($delivery) + { + foreach($this->delivery_list as $delivery_mode => $list) + { + if (in_array($delivery, $list)) + { + $this->delivery_mode = $delivery_mode; + return true; + } + } + } + return false; + } + + /** + * Check if the returned key is proper to the generated one. + * + * @param $key + * @param $params + * @return bool + */ + public function isCorrectSignKey($sign, $params) + { + $tab = array(); + foreach($this->fields[$this->delivery_mode] as $key => $value) + { + if ($value == SCFields::IGNORED) + continue; + + $key = trim($key); + if (isset($params[$key])) + $tab[$key] = $params[$key]; + } + return ($sign == $this->generateKey($tab)); + } +} \ No newline at end of file diff --git a/modules/__socolissimo/cron.php b/modules/__socolissimo/cron.php new file mode 100755 index 00000000..d40b1072 --- /dev/null +++ b/modules/__socolissimo/cron.php @@ -0,0 +1,27 @@ + array( + 'timeout' => 5 + ) +)); + +$status = trim((string) file_get_contents('http://ws.colissimo.fr/supervision-pudo/supervision.jsp', 0, $context)); + +if(empty($status) || $status == '[KO]') { + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'carrier` + SET `active` = 1 + WHERE `name` = "'.pSQL(Configuration::get('SOCOLISSIMO_FALLBACK')).'" + AND `deleted` = 0 + '); +} else { + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'carrier` + SET `active` = 0 + WHERE `name` = "'.pSQL(Configuration::get('SOCOLISSIMO_FALLBACK')).'" + AND `deleted` = 0 + '); +} diff --git a/modules/__socolissimo/de.php b/modules/__socolissimo/de.php new file mode 100644 index 00000000..ea9ea6df --- /dev/null +++ b/modules/__socolissimo/de.php @@ -0,0 +1,92 @@ +ajax_607e1d854783c8229998ac2b5b6923d3'] = 'Token ungültig'; +$_MODULE['<{socolissimo}prestashop>socolissimo_42ab10dea7d96b9c353e0f5bae43ec20'] = 'So Colissimo'; +$_MODULE['<{socolissimo}prestashop>socolissimo_9e13e80360ceb625672531275f01ec1f'] = 'Bieten Sie Ihren Kunden unterschiedliche Liefermethoden mit LaPoste an.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f8e355b97fa1be7a8d8c206aa66f0077'] = '\'Versandzone(n)\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_690c1c6abf905b88281a7cd324af9942'] = '\'Versandgruppe\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_a18ef2e8b3730915798057a50ecbf2cd'] = '\'bester Versanddients\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_59f26c70c0230e4ec5e4acdfed0e270c'] = '\'Versandpreis\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_798547c41ec3e64e2322df678e939344'] = '\'Id FO\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_ac08649aa09ff3b879525627bf086dd1'] = '\'Schlüssel\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_a3a53f075adf77334cc34d0f7497ff44'] = '\'URL So\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_4d470fde8487e755a50e9235e3dc13ab'] = 'muss konfiguriert sein, um dieses Modul richtig zu nutzen'; +$_MODULE['<{socolissimo}prestashop>socolissimo_94c614a9df45ea1fcd27b15b7d6f3e67'] = 'Ungültiger Schlüssel'; +$_MODULE['<{socolissimo}prestashop>socolissimo_90a5cb3d07bb39bbd4b76f7f9a0d7947'] = 'Ein Fehler ist beim Abschnitt Versand aufgetreten'; +$_MODULE['<{socolissimo}prestashop>socolissimo_70b2e65f0f2aabf3e2c58d70cf1e1e9a'] = 'Login FO fehlt'; +$_MODULE['<{socolissimo}prestashop>socolissimo_2b639b851983a24bc12358523861c7ff'] = 'Login FO falsch'; +$_MODULE['<{socolissimo}prestashop>socolissimo_7ca12228b5ad636c637425a086fe0092'] = 'Kunden unberechtigt'; +$_MODULE['<{socolissimo}prestashop>socolissimo_0b1d0c0a00cc2727fcd77902867e3641'] = 'Pflichtfeld fehlt'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fa419073252af9d022afe65dccbb34a2'] = 'Fehlende Signatur'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fca3fbced675f75182786525bf4706dc'] = 'Ungültige Signatur'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d14afc3f67d2457d29f0aa0db98e2c9d'] = 'Postleitzahl ungültig'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f9733e52e8841f1e45d015d5af5e8655'] = 'Falsches URL-Format zurück Bestätigung'; +$_MODULE['<{socolissimo}prestashop>socolissimo_417434a4e55adbc67c9c391902cea7f3'] = 'Falsches URL-Format zurück Fehler'; +$_MODULE['<{socolissimo}prestashop>socolissimo_140c34f0b21b932e34d11575509d093b'] = 'Ungültige Transaktions-ID'; +$_MODULE['<{socolissimo}prestashop>socolissimo_28ee1015b475a3a70613ea9c98d712b6'] = 'Format falsch Versandkosten'; +$_MODULE['<{socolissimo}prestashop>socolissimo_afa50e8b2fc14bf578331b2b8e98179d'] = 'Socolissimo Server nicht verfügbar'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Beschreibung'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d0b34d3e1cb0cc1150ae6bf650e9b569'] = 'SoColissimo ist ein Service von La Poste, der Ihren Käufern 5 Zustellungsarten anbietet'; +$_MODULE['<{socolissimo}prestashop>socolissimo_6cefaa978ccec960693d10cefeb2c2bf'] = 'Nach Hause'; +$_MODULE['<{socolissimo}prestashop>socolissimo_46b7627e5f130e33f007ae9d430efe84'] = 'Nach Hause nach Terminvereinbarung'; +$_MODULE['<{socolissimo}prestashop>socolissimo_36b6babbab9524441a49cc7c6e2bbbfa'] = 'zum Cityssimo Abholstützpunkt'; +$_MODULE['<{socolissimo}prestashop>socolissimo_deaaece9e88f4cfdf1f72c6df6b0a52a'] = 'In ihr Büro'; +$_MODULE['<{socolissimo}prestashop>socolissimo_2bb98ed92a6546e5adfee27046c2c0df'] = 'Zu ihrem Händler'; +$_MODULE['<{socolissimo}prestashop>socolissimo_9fbff0971c06ee404f638e9abcbd9446'] = 'Dieses Modul ist kostenlos und ermöglicht Ihnen das Aktivieren dieses Angebot in Ihrem Shop.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_5b6cf869265c13af8566f192b4ab3d2a'] = 'Dokumentation'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{socolissimo}prestashop>socolissimo_0ab984d91ab0a037bdf692bf0e73c349'] = 'Wichtig'; +$_MODULE['<{socolissimo}prestashop>socolissimo_58f73ae759adc826a9e15e26280cdaa4'] = 'Um Ihr SoColissimo-Konto zu eröffnen, kontaktieren Sie bitte \"La Poste\" unter dieser Rufnummer: 3634 (Französische Telefonnummer)'; +$_MODULE['<{socolissimo}prestashop>socolissimo_9c85d4c2bae6ab548fe23e57bd89ddc4'] = 'ID So'; +$_MODULE['<{socolissimo}prestashop>socolissimo_7b95472e0575adc1e3d90a2d7b51e496'] = 'Benutzer-Id für das SoColissimo Backoffice.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_897356954c2cd3d41b221e3f24f99bba'] = 'Schlüssel'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fe78e0a947bf1e0c9e0d9485f40e69cb'] = 'Sicherheitsschlüssel für das SoColissimo Backoffice.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_64979b52d796defbdf05356df9e37d57'] = 'Vorbereitungszeit'; +$_MODULE['<{socolissimo}prestashop>socolissimo_c76660d589be9a49e8846e51b71744ae'] = 'Tag (e)'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b503bab0c9a43c25045cb102487724af'] = 'Durchschnittliche Zeit der Sendungsvorbereitung.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b1076b08727c4e252184a390e16668d7'] = 'Die durchschnittliche Zeit muss die gleiche sein im ColiPoste Back Office.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_a25eac9fbba5c5aace5aa74ac02fabae'] = 'Mehraufwendungen'; +$_MODULE['<{socolissimo}prestashop>socolissimo_0dbced3ca25b864482dd16e405c0d762'] = 'Zusätzliche Kosten bei Terminvereinbarungen.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_da3291084cc788d52c68d1dd5cc98718'] = 'Zusätzliche Kosten müssen die gleichen im ColiPoste Back Office sein.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_3d9f139daab1faaf99dd7bd5b5c966de'] = 'Seien Sie SEHR VORSICHTIG mit diesen Einstellungen, Änderungen können zu einer Fehlfunktion des Moduls führen'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b0b2896e75025245cbb05e96bd1466d6'] = 'Url So'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ce88aabea3b363c753b02ddcb2fbafff'] = 'URL des SoColissimo Backoffice.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_45313bad96da16bf04f88c1fb39419b7'] = 'Fancybox'; +$_MODULE['<{socolissimo}prestashop>socolissimo_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; +$_MODULE['<{socolissimo}prestashop>socolissimo_678f3f992afdb9f6e90cd36497ea76a1'] = 'Wenn Sie diese Option wählen, wird socolissimo in einer fancybox angezeigt.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_85068ddf0b9bcbb6913008356fe328a0'] = 'Kontrolle'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fdd526b84abc0b8fc17060e62d022b84'] = 'Verfügbarkeit von Service SoColissimo erlauben oder nicht erlauben'; +$_MODULE['<{socolissimo}prestashop>socolissimo_32996bdf4214d6cb8bf7fa02273813c8'] = 'URL Kontrolle'; +$_MODULE['<{socolissimo}prestashop>socolissimo_af688489282270bcd9e3399db85e30df'] = 'Die Überwachung der URL wird für die Verfügbarkeit des socolissimo Service benötigt. Es ist nicht ratsam diese zu deaktivieren.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{socolissimo}prestashop>socolissimo_a82be0f551b8708bc08eb33cd9ded0cf'] = 'Information'; +$_MODULE['<{socolissimo}prestashop>socolissimo_3e387f5ebd657c6372f0594c8226863e'] = 'Hier sind zwei Adressen, die Sie in Ihrem Back Office SoColissimo ausfüllen müssen'; +$_MODULE['<{socolissimo}prestashop>socolissimo_49977cbb6772deeac9ceb89f069e491c'] = 'Bestätigungs-URL'; +$_MODULE['<{socolissimo}prestashop>socolissimo_06dc3f24f73027164d2b19556118624e'] = 'Rückgabe-URL'; +$_MODULE['<{socolissimo}prestashop>socolissimo_82c440defe28e2099cba1af1f0761807'] = 'ID SO nicht angegeben'; +$_MODULE['<{socolissimo}prestashop>socolissimo_826361881cfc18b8b75405d398f633b5'] = 'Key SO nicht angegeben'; +$_MODULE['<{socolissimo}prestashop>socolissimo_0bf6a620e5f22d8b46e3903a993f7741'] = 'Vorbereitungszeit nicht angegeben'; +$_MODULE['<{socolissimo}prestashop>socolissimo_228485c5faff886fa4520323dc5b2c76'] = 'Ungültige Vorbereitungszeit'; +$_MODULE['<{socolissimo}prestashop>socolissimo_82b66af7b110e9bc75fd65479786e313'] = 'Mehraufwendungen nicht angegeben'; +$_MODULE['<{socolissimo}prestashop>socolissimo_5b2bf2a7c883ffae1b7b412d65a41984'] = 'Ungültige Mehraufwendungen'; +$_MODULE['<{socolissimo}prestashop>socolissimo_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Konfiguration aktualisiert'; +$_MODULE['<{socolissimo}prestashop>socolissimo_126d781eae70fa41e9e848f3013e1799'] = 'Kann Einstellungen nicht speichern'; +$_MODULE['<{socolissimo}prestashop>socolissimo_898d22b4259367825dbbbc174f049197'] = 'Versandmodus auswählen'; +$_MODULE['<{socolissimo}prestashop>socolissimo_6e55ec92b403f0ab31c29f62c837834a'] = 'Versadmodus bearbeiten'; +$_MODULE['<{socolissimo}prestashop>socolissimo_7ea4eac85d1d1967562869cf1e14b1d0'] = 'Klicken Sie auf eine Liefermethode, um SoColissimo auszuwählen'; +$_MODULE['<{socolissimo}prestashop>socolissimo_201bdb87f8e278b943d07ae924d5de6e'] = 'Versandmodus'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ce26601dac0dea138b7295f02b7620a7'] = 'Kunde'; +$_MODULE['<{socolissimo}prestashop>socolissimo_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Firma'; +$_MODULE['<{socolissimo}prestashop>socolissimo_8b5dd64ab8d0b8158906796b53a200e2'] = 'E-Mail-Adresse'; +$_MODULE['<{socolissimo}prestashop>socolissimo_bcc254b55c4a1babdf1dcb82c207506b'] = 'Tel'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e19726b466603bc3e444dd26fbcde074'] = 'Kundenadresse'; +$_MODULE['<{socolissimo}prestashop>socolissimo_6311ae17c1ee52b36e68aaf4ad066387'] = 'Andere'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d676596f71fd0f73f735da4bb4225151'] = 'Tür-Nr.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ea7d9b60cc8654d2c6e8813529a2f3e8'] = 'Liefer-Informationen'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e937c6393ce858786bd31a279b50572d'] = 'Stützpunkt-ID'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f109a88feec5ad3aeb82580c7a20ec31'] = 'Abholstützpunkt'; +$_MODULE['<{socolissimo}prestashop>socolissimo_021944549c2795a6e4db23b92f198a5e'] = 'Adresse Abholstützpunkt'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-Mail'; diff --git a/modules/__socolissimo/en.php b/modules/__socolissimo/en.php new file mode 100644 index 00000000..9839c82f --- /dev/null +++ b/modules/__socolissimo/en.php @@ -0,0 +1,4 @@ + + {l s='Socolissimo errors list:' mod='socolissimo'} +
+ + | +
Hi {name}, | +
{customer} has sent you a link to a product that (s)he thinks may interest you. | +
+ Click here to view this item: {product} + | +
+ {shop_name} powered with PrestaShop™ + | +
+ + | +
Hi {name}, | +
{customer} has sent you a link to a sale that (s)he thinks may interest you. | +
+ Click here to view this item: {sale} + | +
+ {shop_name} powered with PrestaShop™ + | +
{l s='Send this page to a friend who might be interested in the item below' mod='advsendtoafriend'}.
+{/if} + +{include file="$tpl_dir./errors.tpl"} + +{if isset($smarty.get.submited)} +{l s='Your email has been sent successfully' mod='advsendtoafriend'}
+{else} + +{/if} + + diff --git a/modules/ant_refund/ant_refund.php b/modules/ant_refund/ant_refund.php new file mode 100755 index 00000000..7737480d --- /dev/null +++ b/modules/ant_refund/ant_refund.php @@ -0,0 +1,65 @@ +name = 'ant_refund'; + $this->tab = 'administration'; + $this->author = 'Antadis'; + $this->version = '1.0'; + $this->need_instance = 0; + + parent::__construct(); + + $this->displayName = $this->l('Refund for non fraud order'); + $this->description = $this->l('Creating refund when order status is changing to non fraud'); + } + + public function install() + { + # Register hooks + if(!(parent::install() && $this->registerHook('afterChangeStatus'))) { + return false; + } + return true; + } + + public function hookafterChangeStatus($params) + { + if (!$params['newOrderState']) { + return false; + } + + $orderState = (int) $params['newOrderState']; + if ($orderState == 15 + || $orderState == 16) { + $order = new Order((int) $params['order']['id']); + if (Validate::isLoadedObject($order) ) { + $customer = new Customer((int)($order->id_customer)); + + /* PRODUITS REMBOURSES */ + $full_quantity_list = array(); + $full_product_list = array(); + foreach(Db::getInstance()->ExecuteS(' + SELECT d.`id_order_detail`, d.`product_quantity` + FROM `'._DB_PREFIX_.'order_detail` d + LEFT JOIN `'._DB_PREFIX_.'orders` o ON d.`id_order` = o.`id_order` + WHERE d.`id_order` = '.(int) $params['id_order'].' + ') as $row) { + $full_quantity_list[$row['id_order_detail']] = $row['product_quantity']; + $full_product_list[$row['id_order_detail']] = $row['id_order_detail']; + } + + if (!OrderSlip::createOrderSlip($order, $full_product_list, $full_quantity_list, true)) { + $this->_errors[] = Tools::displayError('Cannot generate credit slip'); + } else { + Module::hookExec('orderSlip', array('order' => $order, 'productList' => $full_product_list, 'qtyList' => $full_quantity_list)); + } + } + } + } + +} diff --git a/modules/ant_refund/fr.php b/modules/ant_refund/fr.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/ant_refund/index.php b/modules/ant_refund/index.php new file mode 100755 index 00000000..2b4249b5 --- /dev/null +++ b/modules/ant_refund/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 7233 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; \ No newline at end of file diff --git a/modules/atos_cyberplus/atos_cyberplus.php b/modules/atos_cyberplus/atos_cyberplus.php new file mode 100644 index 00000000..e4fa4b8b --- /dev/null +++ b/modules/atos_cyberplus/atos_cyberplus.php @@ -0,0 +1,103 @@ +name = 'atos_cyberplus'; + $this->tab = 'payments_gateways'; + $this->version = 1.0; + + /* The parent construct is required for translations */ + parent::__construct(); + + $this->page = basename(__FILE__, '.php'); + $this->displayName = $this->l('Atos'); + $this->description = $this->l('This payment module for banks using ATOS allows your customers to pay by Credit Card'); + } + + public function install() + { + Configuration::updateValue('ATOS_MERCHANT_ID', '038862749811111'); + + parent::install(); + $this->registerHook('payment'); + } + + public function uninstall() + { + Configuration::deleteByName('ATOS_MERCHANT_ID'); + parent::uninstall(); + } + + public function _displayForm() + { + if (!isset($_POST['submit'])) + $_POST['merchant_id'] = Configuration::get('ATOS_MERCHANT_ID'); + $this->_html .= + ''; + } + + private function _postProcess() + { + Configuration::updateValue('ATOS_MERCHANT_ID', $_POST['merchant_id']); + } + + private function _postValidation() + { + if(!isset($_POST['merchant_id']) OR empty($_POST['merchant_id'])) + $this->_postErrors[] = 'You must enter a merchant ID.'; + elseif (!is_numeric($_POST['merchant_id'])) + $this->_postErrors[] = 'Your merchant ID is not valid.'; + + } + + function getContent() + { + $this->_html .= ''.$this->l('Pay with Atos Cyberplus').' '.$this->l('Choose you card type:').'
'.str_replace(array('', '+ + {if $isFailed == 1} +
{l s='Error, please verify the card information' mod='authorizeaim'}
+ {/if} + + + + \ No newline at end of file diff --git a/modules/authorizeaim/cards/ax.gif b/modules/authorizeaim/cards/ax.gif new file mode 100755 index 00000000..b39ff9cd Binary files /dev/null and b/modules/authorizeaim/cards/ax.gif differ diff --git a/modules/authorizeaim/cards/discover.gif b/modules/authorizeaim/cards/discover.gif new file mode 100755 index 00000000..b42b05cc Binary files /dev/null and b/modules/authorizeaim/cards/discover.gif differ diff --git a/modules/authorizeaim/cards/index.php b/modules/authorizeaim/cards/index.php new file mode 100755 index 00000000..b559f985 --- /dev/null +++ b/modules/authorizeaim/cards/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 7233 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; \ No newline at end of file diff --git a/modules/authorizeaim/cards/mastercard.gif b/modules/authorizeaim/cards/mastercard.gif new file mode 100755 index 00000000..2a869a1f Binary files /dev/null and b/modules/authorizeaim/cards/mastercard.gif differ diff --git a/modules/authorizeaim/cards/visa.gif b/modules/authorizeaim/cards/visa.gif new file mode 100755 index 00000000..6f367c56 Binary files /dev/null and b/modules/authorizeaim/cards/visa.gif differ diff --git a/modules/authorizeaim/cvv.png b/modules/authorizeaim/cvv.png new file mode 100755 index 00000000..5d4282c2 Binary files /dev/null and b/modules/authorizeaim/cvv.png differ diff --git a/modules/authorizeaim/de.php b/modules/authorizeaim/de.php new file mode 100755 index 00000000..96db9138 --- /dev/null +++ b/modules/authorizeaim/de.php @@ -0,0 +1,44 @@ +authorizeaim_f745351b1387473d3d2de5bfe18d3562'] = 'Fehler, bitte Kreditkarteninformationen überprüfen'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1814fc250eea61e13aa95e81b61bf72a'] = 'Bezahlen Sie mit authorizeaim'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_442155d68aea78b4ef707796d76ca48c'] = 'Visa-Logo'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f65943f43529e119969e533dc6f691f9'] = 'Master Card-Logo'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_2937b5dab08029b1055b37c98a98d740'] = 'Discover-Logo'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_3b8a6fa58a71e7448c264c9dc61e6904'] = 'American Express Logo'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1edaf23879c3b52a8df80069d2af3cef'] = 'Sichere Kreditkartenzahlung mit Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f11b368cddfe37c47af9b9d91c6ba4f0'] = 'Vollständiger Name'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_379c80c789f0f3e0165b5e6d5df839ca'] = 'Karten-Typ'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_a44217022190f5734b2f72ba1e4f8a79'] = 'Kartennummer'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_8c1279db4db86553e4b9682f78cf500e'] = 'Verfallsdatum'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_60a104dc50579d60cbc90158fada1dcf'] = 'CVV'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_6149e52c36edb9ee4494d5412e42eef2'] = 'die letzten drei Ziffern auf der Rückseite Ihrer Kreditkarte'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_40566b26dcc126bce704f2c1d622a6a3'] = 'Bestellung bestätigen'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_5dfe4041e37dfb15cdbdfe8b977950f5'] = 'Bitte überprüfen Sie Ihre Kreditkarteninformationen (Kreditkarten-Typ, Kreditkarten-Nr. und Verfallsdatum)'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_90c9737c99792791c8fe7c9e469bae9c'] = 'Bitte geben Sie den kompletten Namen an'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_cb313e911b15b21b57f4fc7b53058e4f'] = 'Zahlung mit Authorize.net erhalten'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_9d5b40ff49295ac0b4a5a13a88ccd285'] = 'cURL muss aktiviert sein, um dieses Modul nutzen zu können.'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Konfiguration aktualisiert'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Hilfe'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_11a4b229c0e206b831f729572618553f'] = 'In Ihrem PrestaShop Admin-Panel'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_bc6781f2b59d4e973bd0075baab62a40'] = 'Füllen Sie das Login-ID-Feld mit der von Authorize.net vorgesehenen Kennung aus'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_95eb440b753d6505aad5c3f72b50eec9'] = 'Füllen Sie das Schlüsselfeld mit dem Transaktionsschlüssel von Authorize.net aus'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_a7180ba675bb293f415aab47e52a1732'] = 'Hinweis: Ihre Webseite muss ein SSL-Zertifikat besitzen, um Authorize.net AIM verwenden zu können. Sie selbst sind für die sichere Aufbewahrung und Übermittlung der von Ihren Kunden an Sie übermittelten personenbezogenen Daten wie z.B. die Bankdaten verantwortlich. Prestashop entzieht sich jeder Verantwortung falls die Daten gestohlen werden.'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f3ef34226d51e9ca88eaa2f20d7ffb91'] = 'Login-ID'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_897356954c2cd3d41b221e3f24f99bba'] = 'Schlüssel'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1ee1c44c2dc81681f961235604247b81'] = 'Modus:'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_756d97bb256b8580d4d71ee0c547804e'] = 'Produktion'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_291cdb0a8abb42484f5d44dc20540ce6'] = 'Karten:'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aktualisierungseinstellungen'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Ihre Bestellung vom'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = ' ist abgeschlossen.'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Ihre Bestellung wird so schnell wie möglich zugeschickt.'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Bei Fragen oder für weitere Informationen, kontaktieren Sie bitte unseren'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Kunden-Support'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Bei Ihrer Bestellung ist ein Fehler aufgetreten. Bitte wenden Sie sich an unseren'; + +?> \ No newline at end of file diff --git a/modules/authorizeaim/en.php b/modules/authorizeaim/en.php new file mode 100755 index 00000000..601358d4 --- /dev/null +++ b/modules/authorizeaim/en.php @@ -0,0 +1,4 @@ +authorizeaim_cb313e911b15b21b57f4fc7b53058e4f'] = 'Recibir pagos con Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_9d5b40ff49295ac0b4a5a13a88ccd285'] = 'La extención cURL debe estar habilitada en su servidor para habilitar este modulo. '; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuración actualizada'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Ayuda'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_11a4b229c0e206b831f729572618553f'] = 'En su panel de PrestaShop admin'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_bc6781f2b59d4e973bd0075baab62a40'] = 'Rellene el ID de campo con el proporcionado por Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_95eb440b753d6505aad5c3f72b50eec9'] = 'Rellene el campo clave con la clave de operación facilitada por Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_a7180ba675bb293f415aab47e52a1732'] = 'Atención: Su sitio web debe poseer un certificado SSL para utilizar el módulo Authorize.net AIM. Usted es responsable de la seguridad de los datos bancarios de sus clientes. PrestaShop no podrá ser responsable en caso de problemas de seguridad en su sitio web.'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f4f70727dc34561dfde1a3c529b6205c'] = 'Parámetros'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f3ef34226d51e9ca88eaa2f20d7ffb91'] = 'Nombre de usuario'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_897356954c2cd3d41b221e3f24f99bba'] = 'Clave'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1ee1c44c2dc81681f961235604247b81'] = 'Modo:'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_756d97bb256b8580d4d71ee0c547804e'] = 'Producción'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_0cbc6611f5540bd0809a388dc95a615b'] = 'Prueba'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_291cdb0a8abb42484f5d44dc20540ce6'] = 'Tarjetas:'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_b17f3f4dcf653a5776792498a9b44d6a'] = 'Actualizar la configuración'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f745351b1387473d3d2de5bfe18d3562'] = 'Error, por favor compruebe sus datos bancarios'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1814fc250eea61e13aa95e81b61bf72a'] = 'Pagar con authorizeaim'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_442155d68aea78b4ef707796d76ca48c'] = 'visa logo'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f65943f43529e119969e533dc6f691f9'] = 'logotipo de MasterCard'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_2937b5dab08029b1055b37c98a98d740'] = 'descubrir logotipo'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_3b8a6fa58a71e7448c264c9dc61e6904'] = 'Logo American Express '; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1edaf23879c3b52a8df80069d2af3cef'] = 'Pago seguro con Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f11b368cddfe37c47af9b9d91c6ba4f0'] = 'Nombre y apellidos'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_379c80c789f0f3e0165b5e6d5df839ca'] = 'Tipo de tarjeta'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_a44217022190f5734b2f72ba1e4f8a79'] = 'Número de tarjeta'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_8c1279db4db86553e4b9682f78cf500e'] = 'Fecha de caducidad'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_60a104dc50579d60cbc90158fada1dcf'] = 'CVV'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_6149e52c36edb9ee4494d5412e42eef2'] = 'los 3 últimos dígitos de la parte posterior de su tarjeta de crédito'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_5dfe4041e37dfb15cdbdfe8b977950f5'] = 'Por favor verifique le información de su tarjeta de crédito (tipo de tarjeta, fecha de expiración)'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_90c9737c99792791c8fe7c9e469bae9c'] = 'Por favor ponga su nombre completo'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Su pedido de'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'se ha completado.'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Su pedido será enviado tan pronto como sea posible.'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Para cualquier duda o para más información, póngase en contacto con nuestro servicio de'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'atención al cliente'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Hemos constatado un problema con su pedido. Si usted piensa que esto es un error, puede contactar con nuestro'; diff --git a/modules/authorizeaim/fr.php b/modules/authorizeaim/fr.php new file mode 100755 index 00000000..8caa19f8 --- /dev/null +++ b/modules/authorizeaim/fr.php @@ -0,0 +1,42 @@ +authorizeaim_cb313e911b15b21b57f4fc7b53058e4f'] = 'Recevoir des paiements avec Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_9d5b40ff49295ac0b4a5a13a88ccd285'] = 'L\'extension cURL doit être activée sur votre serveur pour utiliser ce module.'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuration mise à jour'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aide'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_11a4b229c0e206b831f729572618553f'] = 'Dans votre panneau d\'aministration PrestaShop'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_bc6781f2b59d4e973bd0075baab62a40'] = 'Indiquez le login fourni par Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_95eb440b753d6505aad5c3f72b50eec9'] = 'Indiquez la clé de transaction fournie par Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_a7180ba675bb293f415aab47e52a1732'] = 'Attention: votre site doit posséder un certificat SSL pour utiliser le module Authorize.net AIM. Vous êtes responsable de la sécurité des informations bancaires de vos clients. PrestaShop ne peut être tenu responsable en cas de problème de sécurité sur votre site.'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f3ef34226d51e9ca88eaa2f20d7ffb91'] = 'Login'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_897356954c2cd3d41b221e3f24f99bba'] = 'Clé'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1ee1c44c2dc81681f961235604247b81'] = 'Mode'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_756d97bb256b8580d4d71ee0c547804e'] = 'Production'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_291cdb0a8abb42484f5d44dc20540ce6'] = 'Cartes'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour la configuration'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f745351b1387473d3d2de5bfe18d3562'] = 'Erreur, veuillez verifier vos informations bancaires'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1814fc250eea61e13aa95e81b61bf72a'] = 'Payer avec AuthorizeAIM'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_442155d68aea78b4ef707796d76ca48c'] = 'Logo Visa'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f65943f43529e119969e533dc6f691f9'] = 'Logo Mastercard'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_2937b5dab08029b1055b37c98a98d740'] = 'Logo Discover'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_3b8a6fa58a71e7448c264c9dc61e6904'] = 'Logo American Express'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1edaf23879c3b52a8df80069d2af3cef'] = 'Paiement sécurisé avec Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f11b368cddfe37c47af9b9d91c6ba4f0'] = 'Nom complet'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_379c80c789f0f3e0165b5e6d5df839ca'] = 'Type de carte'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_a44217022190f5734b2f72ba1e4f8a79'] = 'Numéro de carte'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_8c1279db4db86553e4b9682f78cf500e'] = 'Date d\'expiration'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_60a104dc50579d60cbc90158fada1dcf'] = 'Code CVV'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_6149e52c36edb9ee4494d5412e42eef2'] = 'les 3 derniers chiffres au dos de votre carte'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_3cfd82f426314baac679a85da388c8b7'] = 'Valider le paiement'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_5dfe4041e37dfb15cdbdfe8b977950f5'] = 'Veuillez vérifier vos informations bancaires (type de carte de crédit, numéro et date d\'expiration)'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_90c9737c99792791c8fe7c9e469bae9c'] = 'Merci de spécifier votre nom complet'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Votre commande sur'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'est reussie'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Votre commande vous sera expediée le plus rapidement possible'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Pour toute question, contactez notre'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Service client'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Nous avons remarqué une erreur avec votre commande. Si vous pensez que c\'est une erreur, vous pouvez contacter notre'; diff --git a/modules/authorizeaim/help.png b/modules/authorizeaim/help.png new file mode 100755 index 00000000..87f94c8f Binary files /dev/null and b/modules/authorizeaim/help.png differ diff --git a/modules/authorizeaim/hookorderconfirmation.tpl b/modules/authorizeaim/hookorderconfirmation.tpl new file mode 100755 index 00000000..efd90c78 --- /dev/null +++ b/modules/authorizeaim/hookorderconfirmation.tpl @@ -0,0 +1,11 @@ +{if $status == 'ok'} +{l s='Your order on' mod='authorizeaim'} {$shop_name} {l s='is complete.' mod='authorizeaim'}
+
{l s='Your order will be sent as soon as possible.' mod='authorizeaim'}
+
{l s='For any questions or for further information, please contact our' mod='authorizeaim'} {l s='customer support' mod='authorizeaim'}.
+
+ {l s='We noticed a problem with your order. If you think this is an error, you can contact our' mod='authorizeaim'} + {l s='customer support' mod='authorizeaim'}. +
+{/if} \ No newline at end of file diff --git a/modules/authorizeaim/index.php b/modules/authorizeaim/index.php new file mode 100755 index 00000000..b559f985 --- /dev/null +++ b/modules/authorizeaim/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 7233 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; \ No newline at end of file diff --git a/modules/authorizeaim/it.php b/modules/authorizeaim/it.php new file mode 100755 index 00000000..5d6bb036 --- /dev/null +++ b/modules/authorizeaim/it.php @@ -0,0 +1,44 @@ +authorizeaim_f745351b1387473d3d2de5bfe18d3562'] = 'Errore, vi preghiamo di verificare le informazioni della carta'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1814fc250eea61e13aa95e81b61bf72a'] = 'Paga con authorizeaim'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_442155d68aea78b4ef707796d76ca48c'] = 'logo visa'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f65943f43529e119969e533dc6f691f9'] = 'logo mastercard'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_2937b5dab08029b1055b37c98a98d740'] = 'logo discover'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_3b8a6fa58a71e7448c264c9dc61e6904'] = 'logo american express'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1edaf23879c3b52a8df80069d2af3cef'] = 'Pagamento sicuro con carta di credito con Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f11b368cddfe37c47af9b9d91c6ba4f0'] = 'Nome completo'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_379c80c789f0f3e0165b5e6d5df839ca'] = 'Tipo di carta'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_a44217022190f5734b2f72ba1e4f8a79'] = 'Numero di carta'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_8c1279db4db86553e4b9682f78cf500e'] = 'Data di scadenza'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_60a104dc50579d60cbc90158fada1dcf'] = 'CVV'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_6149e52c36edb9ee4494d5412e42eef2'] = 'le ultime 3 cifre sul retro della vostra carta di credito'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_40566b26dcc126bce704f2c1d622a6a3'] = 'Convalida ordine'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_5dfe4041e37dfb15cdbdfe8b977950f5'] = 'Per favore verifica le informazione della tua carta (Tipo di carta, numero e data)'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_90c9737c99792791c8fe7c9e469bae9c'] = 'Inserisci il tuo nome completo'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_cb313e911b15b21b57f4fc7b53058e4f'] = 'Ricevi il pagamento con Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_9d5b40ff49295ac0b4a5a13a88ccd285'] = 'estensione cURL deve essere abilitato sul server per utilizzare questo modulo.'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configurazione aggiornata'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aiuto'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_11a4b229c0e206b831f729572618553f'] = 'Nel tuo pannello admin PrestaShop'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_bc6781f2b59d4e973bd0075baab62a40'] = 'Riempi il campo ID Login con quello fornito da Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_95eb440b753d6505aad5c3f72b50eec9'] = 'Riempire il campo chiave con la chiave di transazione fornita da Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_a7180ba675bb293f415aab47e52a1732'] = 'Attenzione: Il tuo sito web deve possedere un certificato SSL per utilizzare il sistema AIM Authorize.net pagamento. L\'utente è responsabile per la sicurezza dei dati bancari dei vostri clienti \'. PrestaShop non possono essere incolpati per qualsiasi problema di sicurezza nel tuo sito web.'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f3ef34226d51e9ca88eaa2f20d7ffb91'] = 'ID Login '; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_897356954c2cd3d41b221e3f24f99bba'] = 'Chiave'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1ee1c44c2dc81681f961235604247b81'] = 'Modalità:'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_756d97bb256b8580d4d71ee0c547804e'] = 'Produzione'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_291cdb0a8abb42484f5d44dc20540ce6'] = 'Carte di credito:'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Il tuo ordine'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'è completo.'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Il tuo ordine verrà inviato al più presto.'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Per eventuali domande o per ulteriori informazioni, contatta la nostra'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'assistenza clienti'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Abbiamo notato un problema con il tuo ordine. Se pensi che questo sia un errore, contatta la nostra'; + +?> \ No newline at end of file diff --git a/modules/authorizeaim/logo.gif b/modules/authorizeaim/logo.gif new file mode 100755 index 00000000..fcf31ce4 Binary files /dev/null and b/modules/authorizeaim/logo.gif differ diff --git a/modules/authorizeaim/logo_authorize.png b/modules/authorizeaim/logo_authorize.png new file mode 100755 index 00000000..d6f2b65f Binary files /dev/null and b/modules/authorizeaim/logo_authorize.png differ diff --git a/modules/authorizeaim/logoa.gif b/modules/authorizeaim/logoa.gif new file mode 100755 index 00000000..b5fc4529 Binary files /dev/null and b/modules/authorizeaim/logoa.gif differ diff --git a/modules/authorizeaim/secure.png b/modules/authorizeaim/secure.png new file mode 100755 index 00000000..206a133b Binary files /dev/null and b/modules/authorizeaim/secure.png differ diff --git a/modules/authorizeaim/validation.php b/modules/authorizeaim/validation.php new file mode 100755 index 00000000..e17c3410 --- /dev/null +++ b/modules/authorizeaim/validation.php @@ -0,0 +1,102 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 10540 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__). '/../../config/config.inc.php'); +include(dirname(__FILE__). '/../../init.php'); +include(dirname(__FILE__). '/authorizeaim.php'); + +/* Transform the POST from the template to a GET for the CURL */ +if (isset($_POST['x_exp_date_m']) && isset($_POST['x_exp_date_y'])) +{ + $_POST['x_exp_date'] = $_POST['x_exp_date_m'].$_POST['x_exp_date_y']; + unset($_POST['x_exp_date_m']); + unset($_POST['x_exp_date_y']); +} +$postString = ''; +foreach ($_POST as $key => $value) + $postString .= $key.'='.urlencode($value).'&'; + +$postString = trim($postString, '&'); + +$url = 'https://secure.authorize.net/gateway/transact.dll'; +if (Configuration::get('AUTHORIZE_AIM_DEMO')) +{ + $postString .= '&x_test_request=TRUE'; + $url = 'https://test.authorize.net/gateway/transact.dll'; +} + +/* Do the CURL request ro Authorize.net */ +$request = curl_init($url); +curl_setopt($request, CURLOPT_HEADER, 0); +curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); +curl_setopt($request, CURLOPT_POSTFIELDS, $postString); +curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); +$postResponse = curl_exec($request); +curl_close($request); + +$response = explode('|', $postResponse); +if (!isset($response[7]) OR !isset($response[3]) OR !isset($response[9])) +{ + Logger::addLog('Authorize.net returned a malformed response for cart '.$response[7], 4); + die('Authorize.net returned a malformed response, aborted.'); +} + +if ($response[0] != 1) +{ + if (!isset($_SERVER['HTTP_REFERER']) || strstr($_SERVER['HTTP_REFERER'], 'order.php')) + Tools::redirect('order.php?step=3&cgv=1&aimerror=1'); + elseif (strstr($_SERVER['HTTP_REFERER'], '?')) + Tools::redirect($_SERVER['HTTP_REFERER'].'&aimerror=1', ''); + else + Tools::redirect($_SERVER['HTTP_REFERER'].'?aimerror=1', ''); +} +else +{ + /* Does the cart exist and is valid? */ + $cart = new Cart((int)$response[7]); + if (!Validate::isLoadedObject($cart)) + { + Logger::addLog('Cart loading failed for cart '.$response[7], 4); + exit; + } + + $customer = new Customer((int)$cart->id_customer); + + /* Loading the object */ + $authorizeaim = new authorizeaim(); + $message = $response[3]; + if ($response[0] == 1) + { + $authorizeaim->setTransactionDetail($response); + $authorizeaim->validateOrder((int)$cart->id, Configuration::get('PS_OS_PAYMENT'), (float)$response[9], $authorizeaim->displayName, $message, NULL, NULL, false, $customer->secure_key); + } + else + $authorizeaim->validateOrder((int)$cart->id, Configuration::get('PS_OS_ERROR'), (float)$response[9], $authorizeaim->displayName, $message, NULL, NULL, false, $customer->secure_key); + + Tools::redirect('order-confirmation.php?id_module='.(int)$authorizeaim->id.'&id_cart='.(int)$cart->id.'&key='.$customer->secure_key); +} + diff --git a/modules/autoupgrade/AdminPreferences.php b/modules/autoupgrade/AdminPreferences.php new file mode 100755 index 00000000..a559e736 --- /dev/null +++ b/modules/autoupgrade/AdminPreferences.php @@ -0,0 +1,510 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 9145 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +// @since 1.4.5.0 +// add the following comment in a module file to skip it in translations +// IGNORE_THIS_FILE_FOR_TRANSLATION + +class AdminPreferences extends AdminTab +{ + public function __construct() + { + global $cookie; + + $this->className = 'Configuration'; + $this->table = 'configuration'; + + $timezones = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT name FROM '._DB_PREFIX_.'timezone'); + $taxes[] = array('id' => 0, 'name' => $this->l('None')); +/* foreach (Tax::getTaxes((int)($cookie->id_lang)) as $tax) + $taxes[] = array('id' => $tax['id_tax'], 'name' => $tax['name']); +*/ + $order_process_type = array( + array( + 'value' => PS_ORDER_PROCESS_STANDARD, + 'name' => $this->l('Standard (5 steps)') + ), + array( + 'value' => PS_ORDER_PROCESS_OPC, + 'name' => $this->l('One page checkout') + ) + ); + + $round_mode = array( + array( + 'value' => PS_ROUND_UP, + 'name' => $this->l('superior') + ), + array( + 'value' => PS_ROUND_DOWN, + 'name' => $this->l('inferior') + ), + array( + 'value' => PS_ROUND_HALF, + 'name' => $this->l('classical') + ) + ); + + $cms_tab = array(0 => + array( + 'id' => 0, + 'name' => $this->l('None') + ) + ); + foreach (CMS::listCms($cookie->id_lang) as $cms_file) + $cms_tab[] = array('id' => $cms_file['id_cms'], 'name' => $cms_file['meta_title']); + $this->_fieldsGeneral = array( + 'PS_SHOP_ENABLE' => array('title' => $this->l('Enable Shop'), 'desc' => $this->l('Activate or deactivate your shop. Deactivate your shop while you perform maintenance on it. Please note that the webservice will not be disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), + 'PS_MAINTENANCE_IP' => array('title' => $this->l('Maintenance IP'), 'desc' => $this->l('IP addresses allowed to access the Front Office even if shop is disabled. Use a comma to separate them (e.g., 42.24.4.2,127.0.0.1,99.98.97.96)'), 'validation' => 'isGenericName', 'type' => 'maintenance_ip', 'size' => 30, 'default' => ''), + 'PS_SSL_ENABLED' => array('title' => $this->l('Enable SSL'), 'desc' => $this->l('If your hosting provider allows SSL, you can activate SSL encryption (https://) for customer account identification and order processing'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), + 'PS_COOKIE_CHECKIP' => array('title' => $this->l('Check IP on the cookie'), 'desc' => $this->l('Check the IP address of the cookie in order to avoid your cookie being stolen'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), + 'PS_COOKIE_LIFETIME_FO' => array('title' => $this->l('Lifetime of the Front Office cookie'), 'desc' => $this->l('Indicate the number of hours'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '480'), + 'PS_COOKIE_LIFETIME_BO' => array('title' => $this->l('Lifetime of the Back Office cookie'), 'desc' => $this->l('Indicate the number of hours'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '480'), + 'PS_TOKEN_ENABLE' => array('title' => $this->l('Increase Front Office security'), 'desc' => $this->l('Enable or disable token on the Front Office in order to improve PrestaShop security'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), + 'PS_HELPBOX' => array('title' => $this->l('Back Office help boxes'), 'desc' => $this->l('Enable yellow help boxes which are displayed under form fields in the Back Office'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), + 'PS_ORDER_PROCESS_TYPE' => array('title' => $this->l('Order process type'), 'desc' => $this->l('You can choose the order process type as either standard (5 steps) or One Page Checkout'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $order_process_type, 'identifier' => 'value'), + 'PS_GUEST_CHECKOUT_ENABLED' => array('title' => $this->l('Enable guest checkout'), 'desc' => $this->l('Your guest can make an order without registering'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), + 'PS_CONDITIONS' => array('title' => $this->l('Terms of service'), 'desc' => $this->l('Require customers to accept or decline terms of service before processing the order'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'js' => array('on' => 'onchange="changeCMSActivationAuthorization()"', 'off' => 'onchange="changeCMSActivationAuthorization()"')), + 'PS_CONDITIONS_CMS_ID' => array('title' => $this->l('Conditions of use CMS page'), 'desc' => $this->l('Choose the Conditions of use CMS page'), 'validation' => 'isInt', 'type' => 'select', 'list' => $cms_tab, 'identifier' => 'id', 'cast' => 'intval'), + 'PS_GIFT_WRAPPING' => array('title' => $this->l('Offer gift-wrapping'), 'desc' => $this->l('Suggest gift-wrapping to customer and possibility of leaving a message'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), + 'PS_GIFT_WRAPPING_PRICE' => array('title' => $this->l('Gift-wrapping price'), 'desc' => $this->l('Set a price for gift-wrapping'), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'price'), + 'PS_GIFT_WRAPPING_TAX' => array('title' => $this->l('Gift-wrapping tax'), 'desc' => $this->l('Set a tax for gift-wrapping'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $taxes, 'identifier' => 'id'), + 'PS_ATTACHMENT_MAXIMUM_SIZE' => array('title' => $this->l('Attachment maximum size'), 'desc' => $this->l('Set the maximum size of attachment files (in MegaBytes)'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text'), + 'PS_RECYCLABLE_PACK' => array('title' => $this->l('Offer recycled packaging'), 'desc' => $this->l('Suggest recycled packaging to customer'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), + 'PS_CART_FOLLOWING' => array('title' => $this->l('Cart re-display at login'), 'desc' => $this->l('After customer logs in, recall and display contents of his/her last shopping cart'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), + 'PS_PRICE_ROUND_MODE' => array('title' => $this->l('Round mode'), 'desc' => $this->l('You can choose how to round prices: always round superior; always round inferior, or classic rounding'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $round_mode, 'identifier' => 'value'), + 'PRESTASTORE_LIVE' => array('title' => $this->l('Automatically check for module updates'), 'desc' => $this->l('New modules and updates are displayed on the modules page'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), + 'PS_HIDE_OPTIMIZATION_TIPS' => array('title' => $this->l('Hide optimization tips'), 'desc' => $this->l('Hide optimization tips on the back office homepage'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), + 'PS_DISPLAY_SUPPLIERS' => array('title' => $this->l('Display suppliers and manufacturers'), 'desc' => $this->l('Display manufacturers and suppliers list even if corresponding blocks are disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), + 'PS_FORCE_SMARTY_2' => array('title' => $this->l('Use Smarty 2 instead of 3'), 'desc' => $this->l('Enable if your theme is incompatible with Smarty 3 (you should update your theme, since Smarty 2 will be unsupported from PrestaShop v1.5)'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), + ); + if (function_exists('date_default_timezone_set')) + $this->_fieldsGeneral['PS_TIMEZONE'] = array('title' => $this->l('Time Zone:'), 'validation' => 'isAnything', 'type' => 'select', 'list' => $timezones, 'identifier' => 'name'); + + // No HTTPS activation if you haven't already. + if (empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) == 'off') + { + $this->_fieldsGeneral['PS_SSL_ENABLED']['type'] = 'disabled'; + $this->_fieldsGeneral['PS_SSL_ENABLED']['disabled'] = ''.$this->l('Please click here to use HTTPS protocol before enabling SSL.').''; + } + + parent::__construct(); + } + + public function display() + { + $this->_displayForm('general', $this->_fieldsGeneral, $this->l('General'), '', 'tab-preferences'); + } + + public function postProcess() + { + global $currentIndex; + + if (isset($_POST['submitGeneral'.$this->table])) + { + Module::hookExec('categoryUpdate'); // We call this hook, for regenerate cache of categories + if (Tools14::getValue('PS_CONDITIONS') == true AND (Tools14::getValue('PS_CONDITIONS_CMS_ID') == 0 OR !Db::getInstance()->getValue(' + SELECT `id_cms` FROM `'._DB_PREFIX_.'cms` + WHERE id_cms = '.(int)(Tools14::getValue('PS_CONDITIONS_CMS_ID'))))) + $this->_errors[] = Tools14::displayError('Assign a valid CMS page if you want it to be read.'); + if ($this->tabAccess['edit'] === '1') + $this->_postConfig($this->_fieldsGeneral); + else + $this->_errors[] = Tools14::displayError('You do not have permission to edit here.'); + } + elseif (isset($_POST['submitShop'.$this->table])) + { + if ($this->tabAccess['edit'] === '1') + $this->_postConfig($this->_fieldsShop); + else + $this->_errors[] = Tools14::displayError('You do not have permission to edit here.'); + } + elseif (isset($_POST['submitAppearance'.$this->table])) + { + if ($this->tabAccess['edit'] === '1') + $this->_postConfig($this->_fieldsAppearance); + else + $this->_errors[] = Tools14::displayError('You do not have permission to edit here.'); + } + elseif (isset($_POST['submitThemes'.$this->table])) + { + if ($this->tabAccess['edit'] === '1') + { + if ($val = Tools14::getValue('PS_THEME')) + { + if (rewriteSettingsFile(NULL, $val, NULL)) + Tools14::redirectAdmin($currentIndex.'&conf=6'.'&token='.$this->token); + else + $this->_errors[] = Tools14::displayError('Cannot access settings file.'); + } + else + $this->_errors[] = Tools14::displayError('You must choose a graphical theme.'); + } + else + $this->_errors[] = Tools14::displayError('You do not have permission to edit here.'); + } + parent::postProcess(); + } + + /** + * Update settings in database and configuration files + * + * @params array $fields Fields settings + * + * @global string $currentIndex Current URL in order to keep current Tab + */ + protected function _postConfig($fields) + { + global $currentIndex, $smarty; + + $languages = Language::getLanguages(false); + Tools14::clearCache($smarty); + + /* Check required fields */ + foreach ($fields AS $field => $values) + if (isset($values['required']) AND $values['required']) + if (isset($values['type']) AND $values['type'] == 'textLang') + { + foreach ($languages as $language) + if (($value = Tools14::getValue($field.'_'.$language['id_lang'])) == false AND (string)$value != '0') + $this->_errors[] = Tools14::displayError('field').' '.$values['title'].' '.Tools14::displayError('is required.'); + } + elseif (($value = Tools14::getValue($field)) == false AND (string)$value != '0') + $this->_errors[] = Tools14::displayError('field').' '.$values['title'].' '.Tools14::displayError('is required.'); + + /* Check fields validity */ + foreach ($fields AS $field => $values) + if (isset($values['type']) AND $values['type'] == 'textLang') + { + foreach ($languages as $language) + if (Tools14::getValue($field.'_'.$language['id_lang']) AND isset($values['validation'])) + if (!Validate::$values['validation'](Tools14::getValue($field.'_'.$language['id_lang']))) + $this->_errors[] = Tools14::displayError('field').' '.$values['title'].' '.Tools14::displayError('is invalid.'); + } + elseif (Tools14::getValue($field) AND isset($values['validation'])) + if (!Validate::$values['validation'](Tools14::getValue($field))) + $this->_errors[] = Tools14::displayError('field').' '.$values['title'].' '.Tools14::displayError('is invalid.'); + + /* Default value if null */ + foreach ($fields AS $field => $values) + if (!Tools14::getValue($field) AND isset($values['default'])) + $_POST[$field] = $values['default']; + + /* Save process */ + if (!sizeof($this->_errors)) + { + if (Tools14::isSubmit('submitAppearanceconfiguration')) + { + if (isset($_FILES['PS_LOGO']['tmp_name']) AND $_FILES['PS_LOGO']['tmp_name']) + { + if ($error = checkImage($_FILES['PS_LOGO'], 300000)) + $this->_errors[] = $error; + if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES['PS_LOGO']['tmp_name'], $tmpName)) + return false; + elseif (!@imageResize($tmpName, _PS_IMG_DIR_.'logo.jpg')) + $this->_errors[] = 'an error occurred during logo copy'; + unlink($tmpName); + } + if (isset($_FILES['PS_LOGO_MAIL']['tmp_name']) AND $_FILES['PS_LOGO_MAIL']['tmp_name']) + { + if ($error = checkImage($_FILES['PS_LOGO_MAIL'], 300000)) + $this->_errors[] = $error; + if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS_MAIL') OR !move_uploaded_file($_FILES['PS_LOGO_MAIL']['tmp_name'], $tmpName)) + return false; + elseif (!@imageResize($tmpName, _PS_IMG_DIR_.'logo_mail.jpg')) + $this->_errors[] = 'an error occurred during logo copy'; + unlink($tmpName); + } + if (isset($_FILES['PS_LOGO_INVOICE']['tmp_name']) AND $_FILES['PS_LOGO_INVOICE']['tmp_name']) + { + if ($error = checkImage($_FILES['PS_LOGO_INVOICE'], 300000)) + $this->_errors[] = $error; + if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS_INVOICE') OR !move_uploaded_file($_FILES['PS_LOGO_INVOICE']['tmp_name'], $tmpName)) + return false; + elseif (!@imageResize($tmpName, _PS_IMG_DIR_.'logo_invoice.jpg')) + $this->_errors[] = 'an error occurred during logo copy'; + unlink($tmpName); + } + if (isset($_FILES['PS_STORES_ICON']['tmp_name']) AND $_FILES['PS_STORES_ICON']['tmp_name']) + { + if ($error = checkImage($_FILES['PS_STORES_ICON'], 300000)) + $this->_errors[] = $error; + if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS_STORES_ICON') OR !move_uploaded_file($_FILES['PS_STORES_ICON']['tmp_name'], $tmpName)) + return false; + elseif (!@imageResize($tmpName, _PS_IMG_DIR_.'logo_stores.gif')) + $this->_errors[] = 'an error occurred during logo copy'; + unlink($tmpName); + } + $this->uploadIco('PS_FAVICON', _PS_IMG_DIR_.'favicon.ico'); + } + + /* Update settings in database */ + if (!sizeof($this->_errors)) + { + foreach ($fields AS $field => $values) + { + unset($val); + if (isset($values['type']) AND $values['type'] == 'textLang') + foreach ($languages as $language) + $val[$language['id_lang']] = isset($values['cast']) ? $values['cast'](Tools14::getValue($field.'_'.$language['id_lang'])) : Tools14::getValue($field.'_'.$language['id_lang']); + else + $val = isset($values['cast']) ? $values['cast'](Tools14::getValue($field)) : Tools14::getValue($field); + + Configuration::updateValue($field, $val); + } + Tools14::redirectAdmin($currentIndex.'&conf=6'.'&token='.$this->token); + } + } + } + + private function getVal($conf, $key) + { + return Tools14::getValue($key, (isset($conf[$key]) ? $conf[$key] : '')); + } + + private function getConf($fields, $languages) + { + foreach ($fields AS $key => $field) + { + if ($field['type'] == 'textLang') + foreach ($languages as $language) + $tab[$key.'_'.$language['id_lang']] = Tools14::getValue($key.'_'.$language['id_lang'], Configuration::get($key, $language['id_lang'])); + else + $tab[$key] = Tools14::getValue($key, Configuration::get($key)); + } + $tab['__PS_BASE_URI__'] = __PS_BASE_URI__; + $tab['_MEDIA_SERVER_1_'] = _MEDIA_SERVER_1_; + $tab['_MEDIA_SERVER_2_'] = _MEDIA_SERVER_2_; + $tab['_MEDIA_SERVER_3_'] = _MEDIA_SERVER_3_; + $tab['PS_THEME'] = _THEME_NAME_; + $tab['db_type'] = _DB_TYPE_; + $tab['db_server'] = _DB_SERVER_; + $tab['db_name'] = _DB_NAME_; + $tab['db_prefix'] = _DB_PREFIX_; + $tab['db_user'] = _DB_USER_; + $tab['db_passwd'] = ''; + + return $tab; + } + + private function getDivLang($fields) + { + $tab = array(); + foreach ($fields AS $key => $field) + if ($field['type'] == 'textLang' || $field['type'] == 'selectLang') + $tab[] = $key; + return implode('¤', $tab); + } + + /** + * Display configuration form + * + * @params string $name Form name + * @params array $fields Fields settings + * + * @global string $currentIndex Current URL in order to keep current Tab + */ + protected function _displayForm($name, $fields, $tabname, $size, $icon) + { + global $currentIndex; + + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + $languages = Language::getLanguages(false); + $confValues = $this->getConf($fields, $languages); + $divLangName = $this->getDivLang($fields); + $required = false; + + echo ' + + '; + + if (get_class($this) == 'AdminPreferences') + echo ''; + } +} + diff --git a/modules/autoupgrade/AdminSelfTab.php b/modules/autoupgrade/AdminSelfTab.php new file mode 100755 index 00000000..23287c44 --- /dev/null +++ b/modules/autoupgrade/AdminSelfTab.php @@ -0,0 +1,2269 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 9145 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +// @since 1.4.5.0 +// add the following comment in a module file to skip it in translations +// IGNORE_THIS_FILE_FOR_TRANSLATION +abstract class AdminSelfTab +{ + /** @var integer Tab id */ + public $id = -1; + + /** @var string Associated table name */ + public $table; + + /** @var string Object identifier inside the associated table */ + protected $identifier = false; + + /** @var string Tab name */ + public $name; + + /** @var string Security token */ + public $token; + + /** @var boolean Automatically join language table if true */ + public $lang = false; + + /** @var boolean Tab Automatically displays edit/delete icons if true */ + public $edit = false; + + /** @var boolean Tab Automatically displays view icon if true */ + public $view = false; + + /** @var boolean Tab Automatically displays delete icon if true */ + public $delete = false; + + /** @var boolean Table records are not deleted but marked as deleted */ + public $deleted = false; + + /** @var boolean Tab Automatically displays duplicate icon if true */ + public $duplicate = false; + + /** @var boolean Content line is clickable if true */ + public $noLink = false; + + /** @var boolean select other required fields */ + public $requiredDatabase = false; + + /** @var boolean Tab Automatically displays '$color' as background color on listing if true */ + public $colorOnBackground = false; + + /** @var string Add fields into data query to display list */ + protected $_select; + + /** @var string Join tables into data query to display list */ + protected $_join; + + /** @var string Add conditions into data query to display list */ + protected $_where; + + /** @var string Group rows into data query to display list */ + protected $_group; + + /** @var string Having rows into data query to display list */ + protected $_having; + + /** @var array Name and directory where class image are located */ + public $fieldImageSettings = array(); + + /** @var string Image type */ + public $imageType = 'jpg'; + + /** @var array Fields to display in list */ + public $fieldsDisplay = array(); + + /** @var array Cache for query results */ + protected $_list = array(); + + /** @var integer Number of results in list */ + protected $_listTotal = 0; + + /** @var array WHERE clause determined by filter fields */ + protected $_filter; + + /** @var array Temporary SQL table WHERE clause determinated by filter fields */ + protected $_tmpTableFilter = ''; + + /** @var array Number of results in list per page (used in select field) */ + protected $_pagination = array(20, 50, 100, 300); + + /** @var string ORDER BY clause determined by field/arrows in list header */ + protected $_orderBy; + + /** @var string Default ORDER BY clause when $_orderBy is not defined */ + protected $_defaultOrderBy = false; + + /** @var string Order way (ASC, DESC) determined by arrows in list header */ + protected $_orderWay; + + /** @var integer Max image size for upload */ + protected $maxImageSize = 2000000; + + /** @var array Errors displayed after post processing */ + public $_errors = array(); + + /** @var array Confirmations displayed after post processing */ + protected $_conf; + + /** @var object Object corresponding to the tab */ + protected $_object = false; + + /** @var array tabAccess */ + public $tabAccess; + + /** @var string specificConfirmDelete */ + public $specificConfirmDelete = NULL; + + protected $identifiersDnd = array('id_product' => 'id_product', 'id_category' => 'id_category_to_move','id_cms_category' => 'id_cms_category_to_move', 'id_cms' => 'id_cms'); + + /** @var bool Redirect or not ater a creation */ + protected $_redirect = true; + + protected $_languages = NULL; + protected $_defaultFormLanguage = NULL; + + protected $_includeObj = array(); + protected $_includeVars = false; + protected $_includeContainer = true; + + public $ajax = false; + + public static $tabParenting = array( + 'AdminProducts' => 'AdminCatalog', + 'AdminCategories' => 'AdminCatalog', + 'AdminCMS' => 'AdminCMSContent', + 'AdminCMSCategories' => 'AdminCMSContent', + 'AdminOrdersStates' => 'AdminStatuses', + 'AdminAttributeGenerator' => 'AdminProducts', + 'AdminAttributes' => 'AdminAttributesGroups', + 'AdminFeaturesValues' => 'AdminFeatures', + 'AdminReturnStates' => 'AdminStatuses', + 'AdminStatsTab' => 'AdminStats' + ); + + public function __construct() + { + global $cookie; + $this->id = Tab::getCurrentTabId(); + $this->_conf = array( + 1 => $this->l('Deletion successful'), 2 => $this->l('Selection successfully deleted'), + 3 => $this->l('Creation successful'), 4 => $this->l('Update successful'), + 5 => $this->l('Status update successful'), 6 => $this->l('Settings update successful'), + 7 => $this->l('Image successfully deleted'), 8 => $this->l('Module downloaded successfully'), + 9 => $this->l('Thumbnails successfully regenerated'), 10 => $this->l('Message sent to the customer'), + 11 => $this->l('Comment added'), 12 => $this->l('Module installed successfully'), + 13 => $this->l('Module uninstalled successfully'), 14 => $this->l('Language successfully copied'), + 15 => $this->l('Translations successfully added'), 16 => $this->l('Module transplanted successfully to hook'), + 17 => $this->l('Module removed successfully from hook'), 18 => $this->l('Upload successful'), + 19 => $this->l('Duplication completed successfully'), 20 => $this->l('Translation added successfully but the language has not been created'), + 21 => $this->l('Module reset successfully'), 22 => $this->l('Module deleted successfully'), + 23 => $this->l('Localization pack imported successfully'), 24 => $this->l('Refund Successful'), + 25 => $this->l('Images successfully moved')); + if (!$this->identifier) $this->identifier = 'id_'.$this->table; + if (!$this->_defaultOrderBy) $this->_defaultOrderBy = $this->identifier; + $className = get_class($this); + if ($className == 'AdminCategories' OR $className == 'AdminProducts') + $className = 'AdminCatalog'; + $this->token = Tools14::getAdminToken($className.(int)$this->id.(int)$cookie->id_employee); + + } + + + private function getConf($fields, $languages) + { + foreach ($fields AS $key => $field) + { + if ($field['type'] == 'textLang') + foreach ($languages as $language) + $tab[$key.'_'.$language['id_lang']] = Tools14::getValue($key.'_'.$language['id_lang'], Configuration::get($key, $language['id_lang'])); + else + $tab[$key] = Tools14::getValue($key, Configuration::get($key)); + } + $tab['__PS_BASE_URI__'] = __PS_BASE_URI__; + $tab['_MEDIA_SERVER_1_'] = defined('_MEDIA_SERVER_1_')?_MEDIA_SERVER_1_:''; + $tab['_MEDIA_SERVER_2_'] = defined('_MEDIA_SERVER_2_')?_MEDIA_SERVER_2_:''; + $tab['_MEDIA_SERVER_3_'] = defined('_MEDIA_SERVER_3_')?_MEDIA_SERVER_3_:''; + $tab['PS_THEME'] = _THEME_NAME_; + $tab['db_type'] = _DB_TYPE_; + $tab['db_server'] = _DB_SERVER_; + $tab['db_name'] = _DB_NAME_; + $tab['db_prefix'] = _DB_PREFIX_; + $tab['db_user'] = _DB_USER_; + $tab['db_passwd'] = ''; + + return $tab; + } + private function getDivLang($fields) + { + $tab = array(); + foreach ($fields AS $key => $field) + if ($field['type'] == 'textLang' || $field['type'] == 'selectLang') + $tab[] = $key; + return implode('¤', $tab); + } + + private function getVal($conf, $key) + { + return Tools14::getValue($key, (isset($conf[$key]) ? $conf[$key] : '')); + } + + protected function _displayForm($name, $fields, $tabname, $size, $icon) + { + global $currentIndex; + + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + $languages = Language::getLanguages(false); + $confValues = $this->getConf($fields, $languages); + $divLangName = $this->getDivLang($fields); + $required = false; + + echo ' + + '; + + if (get_class($this) == 'AdminPreferences') + echo ''; + } + + /** + * use translations files to replace english expression. + * + * @param mixed $string term or expression in english + * @param string $class + * @param boolan $addslashes if set to true, the return value will pass through addslashes(). Otherwise, stripslashes(). + * @param boolean $htmlentities if set to true(default), the return value will pass through htmlentities($string, ENT_QUOTES, 'utf-8') + * @return string the translation if available, or the english default text. + */ + protected function l($string, $class = 'AdminTab', $addslashes = FALSE, $htmlentities = TRUE) + { + global $_LANGADM; + if(empty($_LANGADM)) + $_LANGADM = array(); + // if the class is extended by a module, use modules/[module_name]/xx.php lang file + $currentClass = get_class($this); + if (class_exists('Module') AND method_exists('Module','getModuleNameFromClass')) + if (Module::getModuleNameFromClass($currentClass)) + { + $string = str_replace('\'', '\\\'', $string); + return Module::findTranslation(Module::$classInModule[$currentClass], $string, $currentClass); + } + + if ($class == __CLASS__) + $class = 'AdminTab'; + + $key = md5(str_replace('\'', '\\\'', $string)); + $str = (key_exists(get_class($this).$key, $_LANGADM)) ? $_LANGADM[get_class($this).$key] : ((key_exists($class.$key, $_LANGADM)) ? $_LANGADM[$class.$key] : $string); + $str = $htmlentities ? htmlentities($str, ENT_QUOTES, 'utf-8') : $str; + return str_replace('"', '"', ($addslashes ? addslashes($str) : stripslashes($str))); + } + + /** + * ajaxDisplay is the default ajax return sytem + * + * @return void + */ + public function displayAjax() + { + } + /** + * Manage page display (form, list...) + * + * @global string $currentIndex Current URL in order to keep current Tab + */ + public function display() + { + global $currentIndex, $cookie; + + // Include other tab in current tab + if ($this->includeSubTab('display', array('submitAdd2', 'add', 'update', 'view'))){} + + // Include current tab + elseif ((Tools::getValue('submitAdd'.$this->table) AND sizeof($this->_errors)) OR isset($_GET['add'.$this->table])) + { + if ($this->tabAccess['add'] === '1') + { + $this->displayForm(); + if ($this->tabAccess['view']) + echo ''.$this->l('Set required fields for this section').'
+ '; + } + + public function includeSubTab($methodname, $actions = array()) + { + if (!isset($this->_includeTab) OR !is_array($this->_includeTab)) + return false; + $key = 0; + $inc = false; + foreach ($this->_includeTab as $subtab => $extraVars) + { + /* New tab loading */ + $classname = 'Admin'.$subtab; + if ($module = Db::getInstance()->getValue('SELECT `module` FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \''.pSQL($classname).'\'') AND file_exists(_PS_MODULE_DIR_.'/'.$module.'/'.$classname.'.php')) + include_once(_PS_MODULE_DIR_.'/'.$module.'/'.$classname.'.php'); + elseif (file_exists(PS_ADMIN_DIR.'/tabs/'.$classname.'.php')) + include_once('tabs/'.$classname.'.php'); + if (!isset($this->_includeObj[$key])) + $this->_includeObj[$key] = new $classname; + $adminTab = $this->_includeObj[$key]; + $adminTab->token = $this->token; + + /* Extra variables addition */ + if (!empty($extraVars) AND is_array($extraVars)) + foreach ($extraVars AS $varKey => $varValue) + $adminTab->$varKey = $varValue; + + /* Actions management */ + foreach ($actions as $action) + { + switch ($action) + { + + case 'submitAdd1': + if (Tools::getValue('submitAdd'.$adminTab->table)) + $ok_inc = true; + break; + case 'submitAdd2': + if (Tools::getValue('submitAdd'.$adminTab->table) AND sizeof($adminTab->_errors)) + $ok_inc = true; + break; + case 'submitDel': + if (Tools::getValue('submitDel'.$adminTab->table)) + $ok_inc = true; + break; + case 'submitFilter': + if (Tools::isSubmit('submitFilter'.$adminTab->table)) + $ok_inc = true; + case 'submitReset': + if (Tools::isSubmit('submitReset'.$adminTab->table)) + $ok_inc = true; + default: + if (isset($_GET[$action.$adminTab->table])) + $ok_inc = true; + } + } + $inc = false; + if ((isset($ok_inc) AND $ok_inc) OR !sizeof($actions)) + { + if (!$adminTab->viewAccess()) + { + echo Tools::displayError('Access denied'); + return false; + } + if (!sizeof($actions)) + if (($methodname == 'displayErrors' AND sizeof($adminTab->_errors)) OR $methodname != 'displayErrors') + echo (isset($this->_includeTabTitle[$key]) ? ''.$this->l('File size').' '.(filesize($image) / 1000).'kb
+ + '.$this->l('Delete').' +'.$this->l('Your current configuration indicate you want to upgrade your system from the unstable development branch, with no version number. If you upgrade, you will not be able to follow the official release process anymore').'.
+'.$this->l('upgrade complete. Please check your front-office theme is functionnal (try to make an order, check theme)').'
") + .show("slow") + .append("'.$this->l('activate your shop here').'"); + $("#dbCreateResultCheck") + .hide("slow"); + $("#infoStep").html("t |
+ | '.$blockcms->getL('ID').' | +'.$blockcms->getL('Name').' | +||||||
---|---|---|---|---|---|---|---|---|
$cms_category['id_cms_category'], 'is_category' => 1), $cms_selected) ? 'checked="checked"' : '').'> | +'.$cms_category['id_cms_category'].' | +'.$cms_category['name'].' | +||||||
$cms_page['id_cms'], 'is_category' => 0), $cms_selected) ? 'checked="checked"' : '').'> | +'.$cms_page['id_cms'].' | +'.$cms_page['meta_title'].' | +||||||
+ | '.$categories['id_cms_category'].' | +'; + for ($i = 1; $i < $categories['level_depth']; $i++) + $this->_html .= ''; + $this->_html .= ' + | +||||||
+ | '.$cms['id_cms'].' | +'; + for ($i = 0; $i < $categories['level_depth']; $i++) + $this->_html .= ''; + $this->_html .= ' + | +
'.$this->l('ID').' | +'.$this->l('Text').' | +'.$this->l('URL').' | +'.$this->l('Actions').' | +
---|---|---|---|
'.$this->l('There are no links.').' | +|||
'.$link['id'].' | +'.$link['text_'.$cookie->id_lang].' | +'.$link['url'].' | ++ + + | +
'.$this->l('ID').' | +'.$this->l('Text').' | +'.$this->l('URL').' | +'.$this->l('Actions').' | +
---|---|---|---|
'.$this->l('There are no links.').' | +|||
'.$link['id'].' | +'.$link['text_'.$cookie->id_lang].' | +'.$link['url'].' | ++ + + | +
'.$this->l('ID').' | +'.$this->l('Text').' | +'.$this->l('URL').' | +'.$this->l('Actions').' | +
---|---|---|---|
'.$this->l('There are no links.').' | +|||
'.$link['id'].' | +'.$link['text_'.$cookie->id_lang].' | +'.$link['url'].' | ++ + + | +
'.$this->l('ID').' | +'.$this->l('Text').' | +'.$this->l('URL').' | +'.$this->l('Actions').' | +
---|---|---|---|
'.$this->l('There are no links.').' | +|||
'.$link['id'].' | +'.$link['text_'.$cookie->id_lang].' | +'.$link['url'].' | ++ + + | +
'.$this->l('ID').' | +'.$this->l('Text').' | +'.$this->l('URL').' | +'.$this->l('Actions').' | +
---|---|---|---|
'.$this->l('There are no links.').' | +|||
'.$link['id'].' | +'.$link['text_'.$cookie->id_lang].' | +'.$link['url'].' | ++ + + | +
'.$this->l('ID').' | +'.$this->l('Text').' | +'.$this->l('URL').' | +'.$this->l('Actions').' | +
---|---|---|---|
'.$this->l('There are no links.').' | +|||
'.$link['id'].' | +'.$link['text_'.$cookie->id_lang].' | +'.$link['url'].' | ++ + + | +
'.$this->l('ID').' | +'.$this->l('Text').' | +'.$this->l('URL').' | +'.$this->l('Actions').' | +
---|---|---|---|
'.$this->l('There are no links yet').' | +|||
'.$link['id'].' | +'.$link['text_'.$cookie->id_lang].' | +'.$link['url_'.$cookie->id_lang].' | ++ + + | +
'.$this->l('ID').' | +'.$this->l('Text').' | +'.$this->l('URL').' | +'.$this->l('Actions').' | +
---|---|---|---|
'.$this->l('There are no links yet').' | +|||
'.$link['id'].' | +'.$link['text_'.$cookie->id_lang].' | +'.$link['url_'.$cookie->id_lang].' | ++ + + | +
{l s='No manufacturer' mod='blockmanufacturer'}
+{/if} +{l s='All new products' mod='blocknewproducts'}
+ {else} +{l s='No new products at this time' mod='blocknewproducts'}
+ {/if} ++ + | +
Hi, | +
Newsletter subscription | +
+ Regarding your newsletter subscription, we have the pleasure to offer you the following voucher: {discount} + | +
+ {shop_name} powered by PrestaShop™ + | +
+ {l s='All specials' mod='blockspecials'} +
+{else} +{l s='No specials at this time' mod='blockspecials'}
+{/if} +{l s='No supplier' mod='blocksupplier'}
+{/if} +{l s='Text 1' mod='blocktext'}
+{l s='Text 2' mod='blocktext'}
+{l s='Text 3' mod='blocktext'}
+{l s='Text 1' mod='blocktext2'}
+{l s='Text 2' mod='blocktext2'}
+{l s='Text 3' mod='blocktext2'}
++ {l s='Welcome' mod='blockuserinfo'}, + {if $cookie->isLogged()} + {$cookie->customer_firstname} {$cookie->customer_lastname} + ({l s='Log out' mod='blockuserinfo'}) + {l s='Credit slips' mod='blockuserinfo'} + {else} + {l s='Log in' mod='blockuserinfo'} + {/if} +
+ +{$viewedProduct->description_short|strip_tags:'UTF-8'|truncate:44}
+'.$this->l('Product').' | +'.$this->l('Quantity').' | +'.$this->l('Priority').' | +
---|---|---|
+
+ '.$product['name'];
+ if (isset($product['attributes_small']))
+ $this->_html .= ' '.htmlentities($product['attributes_small'], ENT_COMPAT, 'UTF-8').''; + $this->_html .= ' + |
+ '.(int)($product['quantity']).' | +'.$priority[(int)($product['priority']) % 3].' | +
+ {if $wishlists} + + {/if} + {l s='My wishlists' mod='blockwishlist'} +
++ + | +
Hi, | +
Message from {shop_name} | +
+ {shop_name} invites you to send this link to your friends, so they can see your wishlist {wishlist} :
+ + {message} + |
+
+ {shop_name} realised with PrestaShop™ + | +
+ + | +
Hi, | +
Message from {shop_name} | +
+ {firstname} {lastname} indicated you may want to see his/her wishlist {wishlist} :
+ + {wishlist} + |
+
+ {shop_name} Powered by PrestaShop™ + | +
{l s='Name' mod='blockwishlist'} | +{l s='Qty' mod='blockwishlist'} | +{l s='Viewed' mod='blockwishlist'} | +{l s='Created' mod='blockwishlist'} | +{l s='Direct Link' mod='blockwishlist'} | +{l s='Delete' mod='blockwishlist'} | +
---|---|---|---|---|---|
{$wishlists[i].name|truncate:30:'...'|escape:'htmlall':'UTF-8'} | ++ {assign var=n value=0} + {foreach from=$nbProducts item=nb name=i} + {if $nb.id_wishlist eq $wishlists[i].id_wishlist} + {assign var=n value=$nb.nbProducts|intval} + {/if} + {/foreach} + {if $n} + {$n|intval} + {else} + 0 + {/if} + | +{$wishlists[i].counter|intval} | +{$wishlists[i].date_add|date_format:"%Y-%m-%d"} | +{l s='View' mod='blockwishlist'} | ++ + | +
+ {l s='Other wishlists of' mod='blockwishlist'} {$current_wishlist.firstname} {$current_wishlist.lastname}: + {foreach from=$wishlists item=wishlist name=i} + {if $wishlist.id_wishlist != $current_wishlist.id_wishlist} + {$wishlist.name} + {if !$smarty.foreach.i.last} + / + {/if} + {/if} + {/foreach} +
+{/if} +{if $products} +Description :
+Dimensions :
+Poids :
++ |
+ Scientificité : collaboration avec le monde médical + |
+
+ |
+ Expérience : dialogue permanent avec les parents + |
+
+ |
+ Connaissance : observation permanente de l'enfant et de son monde + |
+
+ |
+ Responsabilité : parce que le bonheur des enfants est une chose sérieuse + |
+
'.$this->l('Invalid attribute ID for this product ID on line').' '.$i.'
'; + continue; + } + } + + if($line[2] != '') { + $qty = (int) $line[2]; + $old_qty = Product::getQuantity((int) $line[0], (int) $line[1] == 0? NULL: (int) $line[1]); + + if($process == 0) { + $product->addStockMvt($qty, 5, (int) $line[1]); + } else { + if($qty > $old_qty) { + $product->addStockMvt($qty - $old_qty, 5, (int) $line[1]); + } else { + $product->addStockMvt(-($old_qty - $qty), 5, (int) $line[1]); + } + } + } + + if(isset($line[4]) && $line[4] != '' && Validate::isEan13($line[4])) { + if((int) $line[1] != 0) { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product_attribute` + SET `ean13` = "'.pSQL($line[4]).'" + WHERE `id_product` = '.(int) $line[0].' + AND `id_product_attribute` = '.(int) $line[1].' + LIMIT 1 + '); + } else { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product` + SET `ean13` = "'.pSQL($line[4]).'" + WHERE `id_product` = '.(int) $line[0].' + LIMIT 1 + '); + } + + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'order_detail` + SET `product_ean13` = "'.pSQL($line[4]).'" + WHERE `product_id` = '.(int) $line[0].' + AND `product_attribute_id` = '.(int) $line[1].' + '); + } + + + if(isset($line[5]) && $line[5] != '' && Validate::isReference($line[5])) { + if((int) $line[1] != 0) { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product_attribute` + SET `location` = "'.pSQL($line[5]).'" + WHERE `id_product` = '.(int) $line[0].' + AND `id_product_attribute` = '.(int) $line[1].' + LIMIT 1 + '); + } else { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product` + SET `location` = "'.pSQL($line[5]).'" + WHERE `id_product` = '.(int) $line[0].' + LIMIT 1 + '); + } + } + } else { + $output .= ''.$this->l('Product #').(int) $line[0].' '.$this->l('not found').'
'; + } + } + fclose($f); + $output .= ''.$this->l('Products updated').'
'; + } + } elseif(Tools::isSubmit('submitUploadCategories')) { + $f = fopen($_FILES['csvfile']['tmp_name'], 'r'); + fgetcsv($f, 0, ';'); + + $products = array(); + $defaults = array(); + $positions = array(); + + while($line = fgetcsv($f, 0, ';')) { + if(empty($line[0])) { + continue; + } + + if(!isset($line[1])) { + continue; + } + + if(isset($line[2]) && !empty($line[2]) && (int) $line[2] != 0) { + $defaults[(int) $line[0]] = (int) $line[2]; + } + + $categories = array_map('intval', explode(',', $line[1])); + $products[(int) $line[0]] = $categories; + foreach($categories as $id_category) { + $positions[(int) $id_category] = 1; + } + } + + fclose($f); + + if(Tools::getValue('category_process') == 1) { + Db::getInstance()->ExecuteS(' + DELETE FROM `'._DB_PREFIX_.'category_product` + WHERE `id_product` IN ('.implode(', ', array_keys($products)).') + '); + } + + foreach(Db::getInstance()->ExecuteS(' + SELECT `id_category`, MAX(`position`) AS `position` + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_category` IN ('.implode(', ', array_keys($positions)).') + GROUP BY `id_category` + ') as $row) { + $positions[(int) $row['id_category']] = (int) $row['position']; + } + + foreach($products as $id_product => $id_categories) { + foreach($id_categories as $id_category) { + Db::getInstance()->ExecuteS(' + INSERT INTO `'._DB_PREFIX_.'category_product` VALUES ( + '.(int) $id_category.', + '.(int) $id_product.', + '.(int) ++$positions[(int) $id_category].' + ) + '); + } + } + + foreach($defaults as $id_product => $id_category_default) { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product` + SET `id_category_default` = '.(int) $id_category_default.' + WHERE `id_product` = '.(int) $id_product.' + LIMIT 1 + '); + + if(!$row = Db::getInstance()->getRow(' + SELECT `id_product` + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_product` = '.(int) $id_product.' + AND `id_category` = '.(int) $id_category_default.' + ')) { + $pos = (int) Db::getInstance()->getValue(' + SELECT MAX(`position`) + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_category` = '.(int) $id_category_default.' + ') + 1; + Db::getInstance()->ExecuteS(' + INSERT INTO `'._DB_PREFIX_.'category_product` VALUES ( + '.(int) $id_category_default.', + '.(int) $id_product.', + '.(int) $pos.' + ) + '); + } + } + + $output .= ''.$this->l('Products updated').'
'; + } elseif(Tools::isSubmit('submitUploadAccessories')) { + $f = fopen($_FILES['csvfile']['tmp_name'], 'r'); + fgetcsv($f, 0, ';'); + + $products = array(); + + while($line = fgetcsv($f, 0, ';')) { + if(empty($line[0]) || empty($line[1])) { + continue; + } + + if(!isset($products[(int) $line[0]])) { + $products[(int) $line[0]] = array(); + } + $products[(int) $line[0]][] = (int) $line[1]; + } + + fclose($f); + + if(Tools::getValue('access_process') == 1) { + Db::getInstance()->ExecuteS(' + DELETE FROM `'._DB_PREFIX_.'accessory` + WHERE `id_product_1` IN ('.implode(', ', array_keys($products)).') + '); + } + + foreach($products as $id_product_1 => $id_products_2) { + foreach($id_products_2 as $id_product_2) { + Db::getInstance()->ExecuteS(' + INSERT INTO `'._DB_PREFIX_.'accessory` VALUES ( + '.(int) $id_product_1.', + '.(int) $id_product_2.' + ) + '); + } + } + + $output .= ''.$this->l('Products updated').'
'; + }elseif(Tools::isSubmit('submitUploadImages')) { + $f = fopen($_FILES['csvfile']['tmp_name'], 'r'); + fgetcsv($f, 0, ';'); + + $products = array(); + $products_a = array(); + $products_a_ids = array(); + + while($line = fgetcsv($f, 0, ';')) { + if(empty($line[0])) { + continue; + } + + if(!isset($line[1]) + || empty($line[1])) { + continue; + } + + if(isset($line[2]) && !empty($line[2])) { + if(!isset($products_a[(int) $line[0]])) { + $products_a[(int) $line[0]] = array(array(), array()); + } + + $products_a[(int) $line[0]][0] = array_merge($products_a[(int) $line[0]][0], array_map('trim', explode(',', $line[1]))); + $products_a[(int) $line[0]][1][(int) $line[2]] = array_map('trim', explode(',', $line[1])); + $products_a_ids[] = (int) $line[2]; + } else { + $products[(int) $line[0]] = array_map('trim', explode(',', $line[1])); + } + } + + fclose($f); + + if(Tools::getValue('image_process') == 1) { + if(count($products) > 0) { + foreach(Db::getInstance()->ExecuteS(' + SELECT `id_image` + FROM `'._DB_PREFIX_.'image` + WHERE `id_product` IN ('.implode(', ', array_keys($products)).') + ') as $row) { + $i = new Image((int) $row['id_image']); + $i->delete(); + } + } + + if(count($products_a_ids) > 0) { + foreach(Db::getInstance()->ExecuteS(' + SELECT DISTINCT i.`id_image` + FROM `'._DB_PREFIX_.'image` i + LEFT JOIN `'._DB_PREFIX_.'product_attribute` a + ON i.`id_product` = a.`id_product` + WHERE a.`id_product_attribute` IN ('.implode(', ', $products_a_ids).') + ') as $row) { + $i = new Image((int) $row['id_image']); + $i->delete(); + } + } + } + + foreach($products as $id_product => $urls) { + foreach($urls as $url) { + $image = new Image(); + $image->id_product = $id_product; + $image->position = Image::getHighestPosition($id_product) + 1; + $image->cover = FALSE; + $image->legend = self::createMultiLangField(Db::getInstance()->getValue(' + SELECT `name` + FROM `'._DB_PREFIX_.'product_lang` + WHERE `id_product` = '.(int) $id_product.' + AND `id_lang` = 2 + ')); + $image->add(); + self::copyImg($id_product, $image->id, $url, 'products'); + } + } + $_id_products = array(); + + foreach($products_a as $id_product => $data) { + $_id_products[] = $id_product; + foreach(array_unique($data[0]) as $url) { + $image = new Image(); + $image->id_product = $id_product; + $image->position = Image::getHighestPosition($id_product) + 1; + $image->cover = FALSE; + $image->legend = self::createMultiLangField(Db::getInstance()->getValue(' + SELECT `name` + FROM `'._DB_PREFIX_.'product_lang` + WHERE `id_product` = '.(int) $id_product.' + AND `id_lang` = 2 + ')); + $image->add(); + self::copyImg($id_product, $image->id, $url, 'products'); + foreach($data[1] as $id_product_attribute => $urls) { + if(in_array($url, $urls)) { + Db::getInstance()->ExecuteS(' + INSERT INTO `'._DB_PREFIX_.'product_attribute_image` + VALUES ( + '.(int) $id_product_attribute.', + '.(int) $image->id.' + ) + '); + } + } + } + } + + $covers = array(); + foreach(Db::getInstance()->ExecuteS(' + SELECT `id_product` + FROM `'._DB_PREFIX_.'image` + WHERE `id_product` IN ('.implode(', ', array_merge($_id_products, array_keys($products))).') + AND `cover` = 1 + ') as $row) { + $covers[] = (int) $row['id_product']; + } + + $to_cover = array_diff(array_merge($_id_products, array_keys($products)), $covers); + + foreach($to_cover as $id_product) { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'image` + SET `cover` = 1 + WHERE `id_product` = '.(int) $id_product.' + LIMIT 1 + '); + } + + $output .= ''.$this->l('Products updated').'
'; + } elseif(Tools::isSubmit('submitUploadStatus')) { + $f = fopen($_FILES['csvfile']['tmp_name'], 'r'); + fgetcsv($f, 0, ';'); + + $products_0 = array(); + $products_1 = array(); + + while($line = fgetcsv($f, 0, ';')) { + if(empty($line[0]) || !isset($line[1])) { + continue; + } + + if((int) $line[1] == 0) { + $products_0[] = (int) $line[0]; + } else { + $products_1[] = (int) $line[0]; + } + } + + fclose($f); + + if(count($products_0) > 0) { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product` + SET `active` = 0 + WHERE `id_product` IN ('.implode(', ', $products_0).') + '); + } + + if(count($products_1) > 0) { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product` + SET `active` = 1 + WHERE `id_product` IN ('.implode(', ', $products_1).') + '); + } + + $output .= ''.$this->l('Products updated').'
'; + } elseif(Tools::isSubmit('submitUploadPrices')) { + $f = fopen($_FILES['csvfile']['tmp_name'], 'r'); + fgetcsv($f, 0, ';'); + + $products = array(); + $prices = array(); + + if(Tools::getValue('price_process') == 2) { + while($line = fgetcsv($f, 0, ';')) { + if(empty($line[0])) { + continue; + } + + $products[] = (int) $line[0]; + } + } elseif(Tools::getValue('price_process') == 3 + || Tools::getValue('price_process') == 4){ + while($line = fgetcsv($f, 0, ';')) { + if(empty($line[0])) { + continue; + } + + $prices[] = array( + (int) $line[0], + $line[1] + ); + } + }else { + while($line = fgetcsv($f, 0, ';')) { + if(empty($line[0])) { + continue; + } + + if(!isset($line[1])) { + continue; + } + + $products[] = (int) $line[0]; + $prices[] = array( + (int) $line[0], + (float) $line[1] > 1? (float) $line[1] / 100: (float) $line[1] + ); + + } + } + + fclose($f); + + if(Tools::getValue('price_process') == 1 + || Tools::getValue('price_process') == 2) { + Db::getInstance()->ExecuteS(' + DELETE FROM `'._DB_PREFIX_.'specific_price` + WHERE `id_product` IN ('.implode(', ', $products).') + '); + } + + if(Tools::getValue('price_process') == 1) { + foreach($prices as $price) { + if((int) $price[0] != 0) { + Db::getInstance()->ExecuteS(' + INSERT INTO `'._DB_PREFIX_.'specific_price` VALUES ( + DEFAULT, + '.(int) $price[0].', + 1, + 0, + 0, + 0, + 0.0, + 1, + '.(float) $price[1].', + "percentage", + "0000-00-00 00:00:00", + "0000-00-00 00:00:00" + ) + '); + } else { + $output .= 'ID produit à 0, ligne non traitée : '.serialize($price).'
'; + } + } + } + if(Tools::getValue('price_process') == 3) { + foreach($prices as $price) { + if((int) $price[0] != 0){ + $price[1] = str_replace(',', '.', $price[1]); + $price_ht = floatval($price[1]); + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product` + SET wholesale_price = '. (float)$price_ht .' + WHERE id_product ='. (int)$price[0]); + }else{ + $output .= 'ID produit à 0, ligne non traitée : '.serialize($price).'
'; + } + } + } + if(Tools::getValue('price_process') == 4) { + foreach($prices as $price) { + if((int) $price[0] != 0){ + $price[1] = str_replace(',', '.', $price[1]); + $price_ht = floatval($price[1] / 1.20); + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product` + SET price = '. (float)$price_ht .' + WHERE id_product ='. (int)$price[0]); + }else{ + $output .= 'ID produit à 0, ligne non traitée : '.serialize($price).'
'; + } + } + } + + $output .= ''.$this->l('Products updated').'
'; + } elseif(Tools::isSubmit('submitUploadCombinations')) { + $f = fopen($_FILES['csvfile']['tmp_name'], 'r'); + fgetcsv($f, 0, ';'); + + $products = array(); + + while($line = fgetcsv($f, 0, ';')) { + if(empty($line[0])) { + continue; + } + + $products[] = (int) $line[0]; + } + + Db::getInstance()->ExecuteS(' + DELETE FROM `'._DB_PREFIX_.'product_attribute_combination` + WHERE `id_product_attribute` IN ( + SELECT `id_product_attribute` + FROM `'._DB_PREFIX_.'product_attribute` + WHERE `id_product` IN ('.implode(', ', $products).') + ) + '); + + Db::getInstance()->ExecuteS(' + DELETE FROM `'._DB_PREFIX_.'product_attribute` + WHERE `id_product` IN ('.implode(', ', $products).') + '); + + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product` + SET `quantity` = 0 + WHERE `id_product` IN ('.implode(', ', $products).') + '); + + fclose($f); + + $output .= ''.$this->l('Products updated').'
'; + } elseif(Tools::isSubmit('submitExport')) { + set_time_limit(300); + $id_lang = Tools::getValue('id_lang', $cookie->id_lang); + if($id_category = (int) Tools::getValue('category')) { + $c = new Category($id_category, $cookie->id_lang); + $children = $c->recurseLiteCategTree(5, 0, $id_lang); + $ids = $this->_recurse_array(array($children)); + $products = array(); + foreach($c->getProductsWs() as $p) { + $products[] = $p['id']; + } + foreach($ids as $id) { + $sc = new Category($id, $id_lang); + foreach($sc->getProductsWs() as $p) { + $products[] = $p['id']; + } + } + $products = array_unique($products); + foreach(glob(dirname(__FILE__).'/*.csv') as $filename) { + unlink($filename); + } + $fname = Tools::passwdGen(10).'.csv'; + $f = fopen(dirname(__FILE__).'/'.$fname, 'w'); + + // uft8 sans bom pour accent + $BOM = "\xEF\xBB\xBF"; // UTF-8 BOM + fwrite($f, $BOM); // NEW LINE + + fputcsv($f, array( + 'supplier_reference', + 'id_product', + 'id_product_attribute', + 'position', + 'poids', + 'quantity', + 'product_name', + 'combination', + 'ean13', + 'location', + 'brand', + 'quantity_sold', + 'public_price_wt', + 'price_wt', + 'wholesale_price', + 'id_TVA', + 'active', + 'description_short', + 'description', + 'images', + 'nb_images', + 'categories', + 'categories_title', + ), ';', '"'); + foreach($products as $product) { + $p = new Product((int) $product, $id_lang); + if(!Validate::isLoadedObject($p)) { + $output .= 'Erreur produit: '.serialize($product).' ce produit ne figure pas dans l\'export
'; + } else { + $position = Db::getInstance()->getValue(' + SELECT `position` + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_category` = '.(int) $id_category.' + AND id_product = '. (int) $p->id . ' + '); + $p->position = $position; + + $categories = array(); + foreach(Db::getInstance()->ExecuteS(' + SELECT `id_category` + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_product` = '.(int) $p->id.' + ') as $cat) { + $categories[] = (int) $cat['id_category']; + } + + $categories_title = array(); + foreach ($categories as $category) { + $title = Db::getInstance()->getValue(' + SELECT `name` + FROM `'._DB_PREFIX_.'category_lang` + WHERE `id_category` = '.(int) $category.' + AND id_lang = '. $id_lang . ' + '); + $categories_title[] = $title; + } + + $combinations = array(); + foreach($p->getAttributeCombinaisons($id_lang) as $combi) { + if(!isset($combinations[$combi['id_product_attribute']])) { + $combinations[$combi['id_product_attribute']] = array( + 'qty' => $combi['quantity'], + 'name' => array($combi['attribute_name']), + 'ean13' => $combi['ean13'], + 'location' => empty($combi['location'])? $p->location: $combi['location'], + 'brand' => $p->manufacturer_name, + 'supplier_reference' => empty($combi['supplier_reference'])? $p->supplier_reference: $combi['supplier_reference'], + ); + } else { + $combinations[$combi['id_product_attribute']]['name'][] = $combi['attribute_name']; + } + } + + $images = array(); + foreach(Db::getInstance()->ExecuteS(' + SELECT i.`id_image`, l.`legend` + FROM `'._DB_PREFIX_.'image` i + LEFT JOIN `'._DB_PREFIX_.'image_lang` l + ON l.`id_image` = i.`id_image` + WHERE l.`id_lang` = '.(int) $id_lang.' + AND i.`id_product` = '.(int) $p->id.' + ') as $img) { + $link_image = str_split($img['id_image']); + $images[] = 'http://static.bebeboutik.com/img/p/'.implode('/', $link_image) .'/'. $img['id_image'].'.jpg'; + } + + if(count($combinations) > 0) { + foreach($combinations as $k => $v) { + $c_images = array(); + foreach(Db::getInstance()->ExecuteS(' + SELECT i.`id_image`, l.`legend` + FROM `'._DB_PREFIX_.'image` i + LEFT JOIN `'._DB_PREFIX_.'image_lang` l + ON l.`id_image` = i.`id_image` + LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` a + ON a.`id_image` = i.`id_image` + WHERE l.`id_lang` = '.(int) $id_lang.' + AND a.`id_product_attribute` = '.(int) $k.' + ') as $img) { + $link_image = str_split($img['id_image']); + $c_images[] = 'http://static.bebeboutik.com/img/p/'.implode('/', $link_image) .'/'. $img['id_image'].'.jpg'; + // $c_images[] = 'http://static.bebeboutik.com/'.(int) $p->id.'-'.$img['id_image'].'.jpg'; + } + + $names = array_unique($v['name']); + sort($names, SORT_STRING); + fputcsv($f, array( + $v['supplier_reference'], + $p->id, + $k, + $p->position, + $p->weight, + $v['qty'], + $p->name[$id_lang], + implode(' - ', $names), + $v['ean13'], + $v['location'], + $v['brand'], + (int) Db::getInstance()->getValue(' + SELECT SUM(d.`product_quantity`) + FROM `'._DB_PREFIX_.'order_detail` d + LEFT JOIN `'._DB_PREFIX_.'orders` o + ON o.`id_order` = d.`id_order` + LEFT JOIN `'._DB_PREFIX_.'order_history` h + ON h.`id_order` = d.`id_order` + WHERE d.`product_id` = '.(int) $p->id.' + AND d.`product_attribute_id` = '.(int) $k.' + AND h.`id_order_state` = 2 + '), + $p->getPrice(TRUE, (int) $k, 2, NULL, FALSE, FALSE), + $p->getPrice(TRUE, (int) $k, 2), + Tools::ps_round($p->wholesale_price, 2), + $p->id_tax_rules_group, + $p->active, + $p->description_short[$id_lang], + $p->description[$id_lang], + count($c_images) > 0? implode(', ', $c_images): implode(', ', $images), + count($c_images) > 0? count($c_images): count($images), + implode(', ', $categories), + implode(', ', $categories_title), + ), ';', '"'); + } + } else { + fputcsv($f, array( + $p->supplier_reference, + $p->id, + 0, + $p->position, + $p->weight, + $p->quantity, + $p->name[$id_lang], + '', + $p->ean13, + $p->location, + $p->manufacturer_name, + (int) Db::getInstance()->getValue(' + SELECT SUM(d.`product_quantity`) + FROM `'._DB_PREFIX_.'order_detail` d + LEFT JOIN `'._DB_PREFIX_.'orders` o + ON o.`id_order` = d.`id_order` + LEFT JOIN `'._DB_PREFIX_.'order_history` h + ON h.`id_order` = d.`id_order` + WHERE d.`product_id` = '.(int) $p->id.' + AND h.`id_order_state` = 2 + '), + $p->getPrice(TRUE, NULL, 2, NULL, FALSE, FALSE), + $p->getPrice(TRUE, NULL, 2), + Tools::ps_round($p->wholesale_price, 2), + $p->id_tax_rules_group, + $p->active, + $p->description_short[$id_lang], + $p->description[$id_lang], + implode(', ', $images), + count($images), + implode(', ', $categories), + implode(', ', $categories_title), + ), ';', '"'); + } + } + } + fclose($f); + $output .= ''.$this->l('Export complete.').' '.$this->l('Click here to download the file').'
'; + } elseif (Tools::getValue('date_start') && Tools::getValue('date_end')) { + $date_start = Tools::getValue('date_start'); + $date_end = Tools::getValue('date_end'); + + + $ids = Db::getInstance()->ExecuteS(' + SELECT c.id_category + FROM `'._DB_PREFIX_.'privatesale` p + LEFT JOIN `'._DB_PREFIX_.'privatesale_category` c ON c.id_sale = p.id_sale + WHERE date_start BETWEEN "'. $date_start .' 00:00:00" AND "'. $date_end .' 00:00:00" + ORDER BY c.id_sale DESC + '); + + $products = array(); + foreach($ids as $id) { + $id_category = $id['id_category']; + $sc = new Category($id_category, $id_lang); + foreach($sc->getProductsWs() as $p) { + $products[] = $p['id']; + } + } + $products = array_unique($products); + + if(count($products) > 20000){ + echo $output .= 'Choisir une plage moins grande.
Export > 20000 produits
Erreur produit: '.serialize($product).' ce produit ne figure pas dans l\'export
'; + } else { + $position = Db::getInstance()->getValue(' + SELECT `position` + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_category` = '.(int) $p->id_category_default.' + AND id_product = '. (int) $p->id . ' + '); + $p->position = $position; + + $categories = array(); + foreach(Db::getInstance()->ExecuteS(' + SELECT `id_category` + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_product` = '.(int) $p->id.' + ') as $cat) { + $categories[] = (int) $cat['id_category']; + } + + $categories_title = array(); + foreach ($categories as $category) { + $title = Db::getInstance()->getValue(' + SELECT `name` + FROM `'._DB_PREFIX_.'category_lang` + WHERE `id_category` = '.(int) $category.' + AND id_lang = '. $id_lang . ' + '); + $categories_title[] = $title; + } + + $combinations = array(); + foreach($p->getAttributeCombinaisons($id_lang) as $combi) { + if(!isset($combinations[$combi['id_product_attribute']])) { + $combinations[$combi['id_product_attribute']] = array( + 'qty' => $combi['quantity'], + 'name' => array($combi['attribute_name']), + 'ean13' => $combi['ean13'], + 'location' => empty($combi['location'])? $p->location: $combi['location'], + 'brand' => $p->manufacturer_name, + 'supplier_reference' => empty($combi['supplier_reference'])? $p->supplier_reference: $combi['supplier_reference'], + ); + } else { + $combinations[$combi['id_product_attribute']]['name'][] = $combi['attribute_name']; + } + } + + $images = array(); + foreach(Db::getInstance()->ExecuteS(' + SELECT i.`id_image`, l.`legend` + FROM `'._DB_PREFIX_.'image` i + LEFT JOIN `'._DB_PREFIX_.'image_lang` l + ON l.`id_image` = i.`id_image` + WHERE l.`id_lang` = '.(int) $id_lang.' + AND i.`id_product` = '.(int) $p->id.' + ') as $img) { + $link_image = str_split($img['id_image']); + $images[] = 'http://static.bebeboutik.com/img/p/'.implode('/', $link_image) .'/'. $img['id_image'].'.jpg'; + } + + if(count($combinations) > 0) { + foreach($combinations as $k => $v) { + $c_images = array(); + foreach(Db::getInstance()->ExecuteS(' + SELECT i.`id_image`, l.`legend` + FROM `'._DB_PREFIX_.'image` i + LEFT JOIN `'._DB_PREFIX_.'image_lang` l + ON l.`id_image` = i.`id_image` + LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` a + ON a.`id_image` = i.`id_image` + WHERE l.`id_lang` = '.(int) $id_lang.' + AND a.`id_product_attribute` = '.(int) $k.' + ') as $img) { + $link_image = str_split($img['id_image']); + $c_images[] = 'http://static.bebeboutik.com/img/p/'.implode('/', $link_image) .'/'. $img['id_image'].'.jpg'; + // $c_images[] = 'http://static.bebeboutik.com/'.(int) $p->id.'-'.$img['id_image'].'.jpg'; + } + + $names = array_unique($v['name']); + sort($names, SORT_STRING); + fputcsv($f, array( + $v['supplier_reference'], + $p->id, + $k, + $p->position, + $p->weight, + $v['qty'], + $p->name[$id_lang], + implode(' - ', $names), + $v['ean13'], + $v['location'], + $v['brand'], + (int) Db::getInstance()->getValue(' + SELECT SUM(d.`product_quantity`) + FROM `'._DB_PREFIX_.'order_detail` d + LEFT JOIN `'._DB_PREFIX_.'orders` o + ON o.`id_order` = d.`id_order` + LEFT JOIN `'._DB_PREFIX_.'order_history` h + ON h.`id_order` = d.`id_order` + WHERE d.`product_id` = '.(int) $p->id.' + AND d.`product_attribute_id` = '.(int) $k.' + AND h.`id_order_state` = 2 + '), + $p->getPrice(TRUE, (int) $k, 2, NULL, FALSE, FALSE), + $p->getPrice(TRUE, (int) $k, 2), + Tools::ps_round($p->wholesale_price, 2), + $p->active, + $p->description_short[$id_lang], + $p->description[$id_lang], + count($c_images) > 0? implode(', ', $c_images): implode(', ', $images), + implode(', ', $categories), + implode(', ', $categories_title), + ), ';', '"'); + } + } else { + fputcsv($f, array( + $p->supplier_reference, + $p->id, + 0, + $p->position, + $p->weight, + $p->quantity, + $p->name[$id_lang], + '', + $p->ean13, + $p->location, + $p->manufacturer_name, + (int) Db::getInstance()->getValue(' + SELECT SUM(d.`product_quantity`) + FROM `'._DB_PREFIX_.'order_detail` d + LEFT JOIN `'._DB_PREFIX_.'orders` o + ON o.`id_order` = d.`id_order` + LEFT JOIN `'._DB_PREFIX_.'order_history` h + ON h.`id_order` = d.`id_order` + WHERE d.`product_id` = '.(int) $p->id.' + AND h.`id_order_state` = 2 + '), + $p->getPrice(TRUE, NULL, 2, NULL, FALSE, FALSE), + $p->getPrice(TRUE, NULL, 2), + Tools::ps_round($p->wholesale_price, 2), + $p->active, + $p->description_short[$id_lang], + $p->description[$id_lang], + implode(', ', $images), + implode(', ', $categories), + implode(', ', $categories_title), + ), ';', '"'); + } + } + } + fclose($f); + $output .= ''.$this->l('Export complete.').' '.$this->l('Click here to download the file').'
'; + } + } elseif(Tools::isSubmit('submitExportPositions')) { + set_time_limit(300); + if($id_category = (int) Tools::getValue('category')) { + foreach(glob(dirname(__FILE__).'/*.csv') as $filename) { + unlink($filename); + } + $fname = Tools::passwdGen(10).'.csv'; + $f = fopen(dirname(__FILE__).'/'.$fname, 'w'); + fputcsv($f, array( + 'id_category', + 'id_product', + 'position', + 'name', + ), ';', '"'); + foreach(Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'category_product` cp + LEFT JOIN `'._DB_PREFIX_.'product_lang` l + ON cp.`id_product` = l.`id_product` + WHERE cp.`id_category` = '.(int) $id_category.' + AND l.`id_lang` = 2 + ') as $row) { + fputcsv($f, array( + (int) $row['id_category'], + (int) $row['id_product'], + (int) $row['position'], + $row['name'], + ), ';', '"'); + } + fclose($f); + $output .= ''.$this->l('Export complete.').' '.$this->l('Click here to download the file').'
'; + } + } + elseif(Tools::isSubmit('submitUploadPositions')) { + set_time_limit(300); + $f = fopen($_FILES['csvfile']['tmp_name'], 'r'); + fgetcsv($f, 0, ';'); + + $products = array(); + + while($line = fgetcsv($f, 0, ';')) { + if($line[0] == '' || $line[1] == '' || $line[2] == '') { + continue; + } + + $products[] = $line; + } + + foreach($products as $line) { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'category_product` + SET `position` = '.(int) $line[2].' + WHERE `id_product` = '.(int) $line[1].' + AND `id_category` = '.(int) $line[0].' + '); + } + + fclose($f); + $output .= ''.$this->l('Products updated').'
'; + } + + echo $output; + + } + + public function display(){ + global $cookie; + + $output = 'Descripción:
+Precio por pañal: 0,28 €
";"-
";"http://static.bebeboutik.com/img/p/4/6/3/1/2/4/463124.jpg, http://static.bebeboutik.com/img/p/4/6/3/1/2/5/463125.jpg";2;"8714996, 8715096";"Pampers, New Baby" +57-000023;303527;318533;1;3.5;31;"3 Packs de 45 pañales Pampers NEW BABY - T.1 / 2-5 Kg";"T.1 (2-5 kg)";;;;20;38.45;38.45;24.3;1;0;"Descripción:
+Precio por pañal: 0,28 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/2/6/463126.jpg;1;"8714996, 8715096";"Pampers, New Baby" +34-000359;303528;318534;2;7;0;"Pack de 240 pañales Pampers NEW BABY - T2 / 3-6 Kg";"T.2 (3-6 kg)";;;;5;70.95;70.95;43.2;1;0;"Descripción:
+Precio por pañal: 0,30 €
";"-
";"http://static.bebeboutik.com/img/p/4/6/3/1/2/7/463127.jpg, http://static.bebeboutik.com/img/p/4/6/3/1/2/8/463128.jpg, http://static.bebeboutik.com/img/p/4/6/3/1/2/9/463129.jpg";3;"8714996, 8715096";"Pampers, New Baby" +34-000361;303529;318535;3;5.5;16;"2 Packs de 80 pañales Pampers NEW BABY - T2 / 3-6 Kg";"T.2 (3-6 kg)";;;;14;47.95;47.95;28.8;1;0;"Descripción:
+Precio por pañal: 0,30 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/3/0/463130.jpg;1;"8714996, 8715096";"Pampers, New Baby" +57-000031;303530;318537;4;4;88;"2 Packs de 100 pañales Pampers NEW BABY - T.2 / 3-6 Kg";"T.2 (3-6 kg)";;;;12;59.95;59.95;36;1;0;"Descripción:
+Precio por pañal: 0,30 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/3/1/463131.jpg;1;"8714996, 8715096";"Pampers, New Baby" +57-000041;303531;318538;5;5.2;89;"Pack de 144 pañales Pampers NEW BABY - T2 / 3-6 Kg";"T.2 (3-6 kg)";;;;11;43.25;43.25;25.92;1;0;"Descripción:
+Precio por pañal: 0,30 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/3/2/463132.jpg;1;"8714996, 8715096";"Pampers, New Baby" +36-000247;303532;318536;6;2.5;41;"2 Packs de 44 pañales Pampers BABY DRY - T.2 / 3-6 Kg";"T.2 (3-6 kg)";;;;9;26.45;26.45;17.6;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,30 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/3/3/463133.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +34-000338;303533;318539;7;3;49;"2 Packs de 52 pañales Pampers BABY DRY - T.3 / 4-9 Kg";"T.3 (4-9 kg)";;;;1;34.35;34.35;21.84;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/3/4/463134.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +34-000342;303534;318540;8;2.5;23;"Pack de 90 pañales Pampers BABY DRY - T.3 / 4-9 Kg";"T.3 (4-9 kg)";;;;7;29.95;29.95;18.9;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/3/5/463135.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +34-000351;303535;318542;9;5.8;43;"Pack de 198 pañales Pampers BABY DRY - T3 / 4-9 Kg";"T.3 (4-9 kg)";;;;7;65.35;65.35;41.58;1;0;"Lo más destacado:Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/3/6/463136.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +34-000356;303536;318545;10;3;28;"4 Packs de 36 pañales Pampers BABY DRY - T3 / 4-9 Kg";"T.3 (4-9 kg)";;;;2;47.95;47.95;30.24;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/3/7/463137.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +57-000032;303537;318546;11;3.5;45;"Pack de 132 pañales Pampers BABY DRY - T.3 / 4-9 Kg";"T.3 (4-9 kg)";;;;5;42.95;42.95;27.72;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/3/8/463138.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +57-000042;303538;318547;12;5;48;"Pack de 126 pañales Pampers BABY DRY - T3 / 4-9 Kg";"T.3 (4-9 kg)";;;;2;41.55;41.55;26.46;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/3/9/463139.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +34-000278;303539;318550;13;3;30;"4 Packs de 28 pañales Pampers BABY DRY - T.4+ / 9-20 Kg";"T.3+ (5-10 kg)";;;;4;36.95;36.95;23.52;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,34 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/4/0/463140.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +57-000020;303540;318553;14;4.14;12;"3 Packs de 46 pañales Pampers BABY DRY - T.4 / 7-14 Kg";"T.4 (7-14 kg)";;;;8;44.95;44.95;28.98;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";"-
";"http://static.bebeboutik.com/img/p/4/6/3/1/4/1/463141.jpg, http://static.bebeboutik.com/img/p/4/6/3/1/4/2/463142.jpg";2;"8714996, 8715097";"Pampers, Baby Dry" +57-000026;303541;318554;15;2.88;2;"Pack de 99 pañales Pampers BABY DRY - T.4 / 7-14 Kg";"T.4 (7-14 kg)";;;;2;32.95;32.95;20.79;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/4/3/463143.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +57-000033;303542;318555;16;2;19;"Pack de 116 pañales Pampers BABY DRY - T.4 / 7-14 Kg";"T.4 (7-14 kg)";;;;12;38.25;38.25;24.36;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/4/4/463144.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +57-000036;303543;318556;17;2.5;18;"2 Packs de 76 pañales Pampers BABY DRY - T4 / 7-14 Kg";"T.4 (7-14 kg)";;;;12;50.15;50.15;31.92;1;0;"Lo más destacado:Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/4/5/463145.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +57-000045;303544;318557;18;3;5;"6 Packs de 20 pañales Pampers BABY DRY - T4 / 7-14 Kg";"T.4 (7-14 kg)";;;;5;39.95;39.95;25.2;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/4/6/463146.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +20-000075;303545;318558;19;2.5;49;"Pack de 78 pañales Pampers BABY DRY - T.4 / 7-18 Kg";"T.4 (7-18 kg)";;;;1;25.95;25.95;16.38;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/4/7/463147.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +34-000331;303546;318559;20;3;47;"4 Packs de 27 pañales Pampers BABY DRY - T.4 / 7-18 Kg";"T.4 (7-18 kg)";;;;3;35.65;35.65;22.68;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/4/8/463148.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +34-000336;303547;318561;21;2.5;30;"2 Packs de 45 pañales Pampers BABY DRY - T.4 / 7-18 Kg";"T.4 (7-18 kg)";;;;0;29.95;29.95;18.9;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/4/9/463149.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +34-000350;303548;318562;22;5.8;42;"Pack de 174 pañales Pampers BABY DRY - T4 / 7-18 Kg";"T.4 (7-18 kg)";;;;8;56.95;56.95;36.54;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/5/0/463150.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +34-000353;303549;318563;23;3;29;"2 Packs de 62 pañales Pampers BABY DRY - T.4 / 7-18 Kg";"T.4 (7-18 kg)";;;;1;40.95;40.95;26.04;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/5/1/463151.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +57-000021;303550;318566;24;3;45;"3 Packs de 40 pañales Pampers BABY DRY - T4+/ 9-16 Kg";"T.4+ (9-16 kg)";;;;5;40.25;40.25;26.4;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,34 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/5/2/463152.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +57-000034;303551;318567;25;3;36;"Pack de 106 pañales Pampers BABY DRY - T.4+/ 9-16 Kg";"T.4+ (9-16 kg)";;;;14;35.95;35.95;23.32;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,34 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/5/3/463153.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +57-000046;303552;318568;26;3;46;"2 Packs de 62 pañales Pampers BABY DRY - T4+/ 9-16 Kg";"T.4+ (9-16 kg)";;;;4;41.95;41.95;27.28;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,34 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/5/4/463154.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +34-000349;303553;318571;27;5.4;26;"Pack de 152 pañales Pampers BABY DRY - T4+ / 9-20 Kg";"T.4+ (9-20 kg)";;;;4;51.95;51.95;33.44;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,34 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/5/5/463155.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +57-000035;303554;318572;28;2.88;24;"Pack de 96 pañales Pampers BABY DRY - T.5 / 11-18 Kg";"T.5 (11-18 kg)";;;;6;35.95;35.95;23.04;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,37 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/5/6/463156.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +34-000124;303555;318575;29;2;49;"Pack de 72 pañales Pampers BABY DRY - T.5 / 11-25 Kg";"T.5 (11-25 kg)";;;;1;26.95;26.95;17.28;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,37€€
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/5/7/463157.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +34-000288;303556;318576;30;2.5;46;"4 Packs de 23 pañales Pampers BABY DRY - T.5 / 11-25 Kg";"T.5 (11-25 kg)";;;;4;33.95;33.95;22.08;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,37 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/5/8/463158.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +67-000010;303557;318579;31;5.2;39;"Pack de 144 pañales Pampers BABY DRY - T5 / 11-25 Kg";"T.5 (11-25 kg)";;;;2;52.95;52.95;34.56;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,37€
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/5/9/463159.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +34-000337;303558;318582;32;2.5;47;"4 Packs de 22 pañales Pampers BABY DRY - T.5+ / 13-27 Kg";"T.5+ (13-27 kg)";;;;3;34.35;34.35;22;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,39 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/6/0/463160.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +34-000348;303559;318583;33;5.2;18;"Pack de 132 pañales Pampers BABY DRY - T5+ 13-27 Kg";"T.5+ (13-27 kg)";;;;3;51.55;51.55;33;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,39 €
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/6/1/463161.jpg;1;"8714996, 8715097";"Pampers, Baby Dry" +34-000347;303560;318541;34;5.8;48;"Pack de 204 pañales Pampers ACTIVE FIT - T3 / 4-9 Kg";"T.3 (4-9 kg)";;;;2;67.35;67.35;42.84;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";" +";http://static.bebeboutik.com/img/p/4/6/3/1/6/2/463162.jpg;1;"8714996, 8715098";"Pampers, Active Fit" +34-000354;303561;318543;35;2.5;48;"Pack de 90 pañales Pampers ACTIVE FIT - T.3 / 4-9 Kg";"T.3 (4-9 kg)";;;;2;29.95;29.95;18.9;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";" +";http://static.bebeboutik.com/img/p/4/6/3/1/6/3/463163.jpg;1;"8714996, 8715098";"Pampers, Active Fit" +34-000355;303562;318544;36;2.5;28;"Pack de 76 pañales Pampers ACTIVE FIT - T.3 / 4-9 Kg";"T.3 (4-9 kg)";;;;2;24.95;24.95;15.96;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";" +";http://static.bebeboutik.com/img/p/4/6/3/1/6/4/463164.jpg;1;"8714996, 8715098";"Pampers, Active Fit" +34-000161;303563;318548;37;5.3;48;"4 Packs de 44 pañales Pampers ACTIVE FIT - T.3+/ 5-10 Kg";"T.3+ (5-10 kg)";;;;2;58.95;58.95;36.96;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";" +";"http://static.bebeboutik.com/img/p/4/6/3/1/6/5/463165.jpg, http://static.bebeboutik.com/img/p/4/6/3/1/6/6/463166.jpg";2;"8714996, 8715098";"Pampers, Active Fit" +34-000271;303564;318549;38;2.88;9;"Pack de 96 pañales Pampers ACTIVE FIT - T.3+ / 5-10 Kg";"T.3+ (5-10 kg)";;;;1;31.65;31.65;20.16;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";" +";"http://static.bebeboutik.com/img/p/4/6/3/1/6/7/463167.jpg, http://static.bebeboutik.com/img/p/4/6/3/1/6/8/463168.jpg";2;"8714996, 8715098";"Pampers, Active Fit" +34-000298;303565;318551;39;3;27;"2 Packs de 60 pañales Pampers ACTIVE FIT - T.3+ / 5-10 Kg";"T.3+ (5-10 kg)";;;;3;39.95;39.95;25.2;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";" +";"http://static.bebeboutik.com/img/p/4/6/3/1/6/9/463169.jpg, http://static.bebeboutik.com/img/p/4/6/3/1/7/0/463170.jpg";2;"8714996, 8715098";"Pampers, Active Fit" +34-000299;303566;318552;40;2.5;30;"Pack de 88 pañales Pampers ACTIVE FIT - T.3+/ 5-10 Kg";"T.3+ (5-10 kg)";;;;0;28.95;28.95;18.48;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";" +";"http://static.bebeboutik.com/img/p/4/6/3/1/7/1/463171.jpg, http://static.bebeboutik.com/img/p/4/6/3/1/7/2/463172.jpg";2;"8714996, 8715098";"Pampers, Active Fit" +34-000334;303567;318560;41;2.5;19;"Pack de 76 pañales Pampers ACTIVE FIT - T.4 / 7-18 Kg";"T.4 (7-18 kg)";;;;11;24.95;24.95;15.96;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";" +";http://static.bebeboutik.com/img/p/4/6/3/1/7/3/463173.jpg;1;"8714996, 8715098";"Pampers, Active Fit" +34-000357;303568;318564;42;3;2;"4 Packs de 39 pañales Pampers ACTIVE FIT - T4 / 7-18 Kg";"T.4 (7-18 kg)";;;;8;50.95;50.95;32.76;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";" +";http://static.bebeboutik.com/img/p/4/6/3/1/7/4/463174.jpg;1;"8714996, 8715098";"Pampers, Active Fit" +67-000015;303569;318565;43;5.6;41;"Pack de 168 pañales Pampers ACTIVE FIT - T4 / 7-18 Kg";"T.4 (7-18 kg)";;;;9;55.45;55.45;35.28;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,33 €
";" +";http://static.bebeboutik.com/img/p/4/6/3/1/7/5/463175.jpg;1;"8714996, 8715098";"Pampers, Active Fit" +34-000333;303570;318569;44;3;194;"2 Packs de 50 pañales Pampers ACTIVE FIT - T.4+/ 9-20 Kg";"T.4+ (9-20 kg)";;;;6;34.45;34.45;23;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,34 €
";" +";http://static.bebeboutik.com/img/p/4/6/3/1/7/6/463176.jpg;1;"8714996, 8715098";"Pampers, Active Fit" +34-000346;303571;318570;45;5.2;37;"Pack de 140 pañales Pampers ACTIVE FIT - T4+ / 9-20 Kg";"T.4+ (9-20 kg)";;;;18;47.95;47.95;30.8;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,34 €
";" +";http://static.bebeboutik.com/img/p/4/6/3/1/7/7/463177.jpg;1;"8714996, 8715098";"Pampers, Active Fit" +34-000225;303572;318573;46;5;48;"Pack de 136 pañales Pampers ACTIVE FIT - T5 / 11-25 Kg";"T.5 (11-25 kg)";;;;2;49.95;49.95;32.64;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,37 €
";" +";http://static.bebeboutik.com/img/p/4/6/3/1/7/8/463178.jpg;1;"8714996, 8715098";"Pampers, Active Fit" +20-000339;303573;318574;47;2;18;"Pack de 72 pañales Pampers ACTIVE FIT - T.5 / 11-25 Kg";"T.5 (11-25 kg)";;;;2;26.95;26.95;17.28;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,37 €
";" +";http://static.bebeboutik.com/img/p/4/6/3/1/7/9/463179.jpg;1;"8714996, 8715098";"Pampers, Active Fit" +34-000335;303574;318577;48;2.88;49;"2 Packs de 48 pañales Pampers ACTIVE FIT - T.5 / 11-25 Kg";"T.5 (11-25 kg)";;;;1;35.95;35.95;23.04;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,37 €
";" +";http://static.bebeboutik.com/img/p/4/6/3/1/8/0/463180.jpg;1;"8714996, 8715098";"Pampers, Active Fit" +34-000358;303575;318578;49;3;30;"4 Packs de 35 pañales Pampers ACTIVE FIT - T5 / 11-25 Kg";"T.5 (11-25 kg)";;;;0;51.95;51.95;33.6;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,37 €
";" +";http://static.bebeboutik.com/img/p/4/6/3/1/8/1/463181.jpg;1;"8714996, 8715098";"Pampers, Active Fit" +67-000029;303576;318580;50;2;0;"Pack de 68 pañales Pampers ACTIVE FIT - T.5 / 11-25 Kg";"T.5 (11-25 kg)";;;;6;24.95;24.95;16.32;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,37 €
";" +";http://static.bebeboutik.com/img/p/4/6/3/1/8/2/463182.jpg;1;"8714996, 8715098";"Pampers, Active Fit" +34-000332;303577;318581;51;2.5;199;"2 Packs de 45 pañales Pampers ACTIVE FIT - T.5+ / 13-27 Kg";"T.5+ (13-27 kg)";;;;1;34.95;34.95;22.5;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,39 €
";" +";http://static.bebeboutik.com/img/p/4/6/3/1/8/3/463183.jpg;1;"8714996, 8715098";"Pampers, Active Fit" +67-000018;303578;318584;52;4.8;24;"Pack de 124 pañales Pampers ACTIVE FIT - T5+ / 13-27 Kg";"T.5+ (13-27 kg)";;;;6;47.95;47.95;31;1;0;"Lo más destacado: Los pañales Pampers Baby-Dry existen también en talla 3+, 4+ y 5+. La gama + está pensada para una mayor absorción. Pensada para proteger a los bebés que tienden a orinar más cantidad, sobretodo por la noche. Gracias al velo de protección especial, los pañales de la gama + absorben aún mejor la humedad, manteniendo al bebé seco durante 12h. Podréis distinguirlos gracias al símbolo + situado al lado de la talla en los paquetes de pañales
+Descripción:
+Precio por pañal: 0,39 €
";" +";http://static.bebeboutik.com/img/p/4/6/3/1/8/4/463184.jpg;1;"8714996, 8715098";"Pampers, Active Fit" +43-000023;303579;318527;53;2.8;87;"12 Paquetes de 64 toallitas para bebé Huggies - Pure";T.U;;;;13;19.95;19.95;12.48;1;0;"Descripción:
+Contiene: 12 paquetes de 64 toallitas
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/8/5/463185.jpg;1;"8714996, 8715099";"Pampers, Toallitas" +55-000043;303580;318528;54;2.8;41;"12 Paquetes de 64 toallitas para bebé Pampers - Fresh";T.U;;;;9;23.85;23.85;14.88;1;0;"Descripción:
+Composición: Todos los ingredientes han sido comprobados (para las pieles más sensibles)
+-
";"http://static.bebeboutik.com/img/p/4/6/3/1/8/6/463186.jpg, http://static.bebeboutik.com/img/p/4/6/3/1/8/7/463187.jpg, http://static.bebeboutik.com/img/p/4/6/3/1/8/8/463188.jpg";3;"8714996, 8715099";"Pampers, Toallitas" +55-000047;303581;318529;55;2.8;47;"12 Paquetes de 64 toallitas para bebé Pampers - Natural Clean";T.U;;;;3;23.85;23.85;14.88;1;0;"Descripción:
+Composición: Todos los ingredientes han sido comprobados (para las pieles más sensibles)
+-
";http://static.bebeboutik.com/img/p/4/6/3/1/8/9/463189.jpg;1;"8714996, 8715099";"Pampers, Toallitas" +32-000050;303582;318530;56;2.8;31;"15 Paquetes de 56 toallitas para bebé Pampers - Sensitive";T.U;;;;19;29.75;29.75;18.6;1;0;"Descripción:
+Composición: Todos los ingredientes han sido comprobados (para las pieles más sensibles)
+-
";http://static.bebeboutik.com/img/p/4/6/3/1/9/0/463190.jpg;1;"8714996, 8715099";"Pampers, Toallitas" +69-000148;303583;318531;57;2.8;198;"3 Paquetes de 55 toallitas para bebé Pampers - Kandoo";T.U;;;;2;15.95;15.95;10.59;1;0;"Descripción:
+Dimensiones: 36 x 8,8 x 10 cm
";"-
";http://static.bebeboutik.com/img/p/4/6/3/1/9/1/463191.jpg;1;"8714996, 8715099";"Pampers, Toallitas" diff --git a/modules/bulkupdate/bulkupdate.php b/modules/bulkupdate/bulkupdate.php new file mode 100755 index 00000000..1e8cb212 --- /dev/null +++ b/modules/bulkupdate/bulkupdate.php @@ -0,0 +1,1286 @@ +name = 'bulkupdate'; + $this->tab = 'administration'; + $this->need_instance = 0; + + parent::__construct(); + + $this->displayName = $this->l('Bulk update'); + $this->description = $this->l('Bulk update products.'); + + $this->version = '1.0'; + $this->author = 'Antadis'; + } + + function install() { + if (parent::install() == FALSE) + return FALSE; + return TRUE; + } + + public function getContent() { + global $cookie; + $output = ''.$this->l('Invalid EAN13 on line').' '.$i.'
'; + return $output.$this->displayForm(); + } + + $f = fopen($_FILES['csvfile']['tmp_name'], 'r'); + fgetcsv($f, 0, ';'); + $i = 1; + while($line = fgetcsv($f, 0, ';')) { + $i++; + $product = new Product((int) $line[0]); + if(Validate::isLoadedObject($product)) { + if((int) $line[1] != 0) { + if(!Db::getInstance()->getRow(' + SELECT `id_product_attribute` + FROM `'._DB_PREFIX_.'product_attribute` + WHERE `id_product` = '.(int) $line[0].' + AND `id_product_attribute` = '.(int) $line[1].' + ')) { + $output .= ''.$this->l('Invalid attribute ID for this product ID on line').' '.$i.'
'; + continue; + } + } + + if($line[2] != '') { + $qty = (int) $line[2]; + $old_qty = Product::getQuantity((int) $line[0], (int) $line[1] == 0? NULL: (int) $line[1]); + + if($process == 0) { + $product->addStockMvt($qty, 5, (int) $line[1]); + } else { + if($qty > $old_qty) { + $product->addStockMvt($qty - $old_qty, 5, (int) $line[1]); + } else { + $product->addStockMvt(-($old_qty - $qty), 5, (int) $line[1]); + } + } + } + + if(isset($line[4]) && $line[4] != '' && Validate::isEan13($line[4])) { + if((int) $line[1] != 0) { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product_attribute` + SET `ean13` = "'.pSQL($line[4]).'" + WHERE `id_product` = '.(int) $line[0].' + AND `id_product_attribute` = '.(int) $line[1].' + LIMIT 1 + '); + } else { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product` + SET `ean13` = "'.pSQL($line[4]).'" + WHERE `id_product` = '.(int) $line[0].' + LIMIT 1 + '); + } + + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'order_detail` + SET `product_ean13` = "'.pSQL($line[4]).'" + WHERE `product_id` = '.(int) $line[0].' + AND `product_attribute_id` = '.(int) $line[1].' + '); + } + + + if(isset($line[5]) && $line[5] != '' && Validate::isReference($line[5])) { + if((int) $line[1] != 0) { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product_attribute` + SET `location` = "'.pSQL($line[5]).'" + WHERE `id_product` = '.(int) $line[0].' + AND `id_product_attribute` = '.(int) $line[1].' + LIMIT 1 + '); + } else { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product` + SET `location` = "'.pSQL($line[5]).'" + WHERE `id_product` = '.(int) $line[0].' + LIMIT 1 + '); + } + } + } else { + $output .= ''.$this->l('Product #').(int) $line[0].' '.$this->l('not found').'
'; + } + } + fclose($f); + $output .= ''.$this->l('Products updated').'
'; + } + } elseif(Tools::isSubmit('submitUploadCategories')) { + $f = fopen($_FILES['csvfile']['tmp_name'], 'r'); + fgetcsv($f, 0, ';'); + + $products = array(); + $defaults = array(); + $positions = array(); + + while($line = fgetcsv($f, 0, ';')) { + if(empty($line[0])) { + continue; + } + + if(!isset($line[1])) { + continue; + } + + if(isset($line[2]) && !empty($line[2]) && (int) $line[2] != 0) { + $defaults[(int) $line[0]] = (int) $line[2]; + } + + $categories = array_map('intval', explode(',', $line[1])); + $products[(int) $line[0]] = $categories; + foreach($categories as $id_category) { + $positions[(int) $id_category] = 1; + } + } + + fclose($f); + + if(Tools::getValue('category_process') == 1) { + Db::getInstance()->ExecuteS(' + DELETE FROM `'._DB_PREFIX_.'category_product` + WHERE `id_product` IN ('.implode(', ', array_keys($products)).') + '); + } + + foreach(Db::getInstance()->ExecuteS(' + SELECT `id_category`, MAX(`position`) AS `position` + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_category` IN ('.implode(', ', array_keys($positions)).') + GROUP BY `id_category` + ') as $row) { + $positions[(int) $row['id_category']] = (int) $row['position']; + } + + foreach($products as $id_product => $id_categories) { + foreach($id_categories as $id_category) { + Db::getInstance()->ExecuteS(' + INSERT INTO `'._DB_PREFIX_.'category_product` VALUES ( + '.(int) $id_category.', + '.(int) $id_product.', + '.(int) ++$positions[(int) $id_category].' + ) + '); + } + } + + foreach($defaults as $id_product => $id_category_default) { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product` + SET `id_category_default` = '.(int) $id_category_default.' + WHERE `id_product` = '.(int) $id_product.' + LIMIT 1 + '); + + if(!$row = Db::getInstance()->getRow(' + SELECT `id_product` + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_product` = '.(int) $id_product.' + AND `id_category` = '.(int) $id_category_default.' + ')) { + $pos = (int) Db::getInstance()->getValue(' + SELECT MAX(`position`) + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_category` = '.(int) $id_category_default.' + ') + 1; + Db::getInstance()->ExecuteS(' + INSERT INTO `'._DB_PREFIX_.'category_product` VALUES ( + '.(int) $id_category_default.', + '.(int) $id_product.', + '.(int) $pos.' + ) + '); + } + } + + $output .= ''.$this->l('Products updated').'
'; + } elseif(Tools::isSubmit('submitUploadAccessories')) { + $f = fopen($_FILES['csvfile']['tmp_name'], 'r'); + fgetcsv($f, 0, ';'); + + $products = array(); + + while($line = fgetcsv($f, 0, ';')) { + if(empty($line[0]) || empty($line[1])) { + continue; + } + + if(!isset($products[(int) $line[0]])) { + $products[(int) $line[0]] = array(); + } + $products[(int) $line[0]][] = (int) $line[1]; + } + + fclose($f); + + if(Tools::getValue('access_process') == 1) { + Db::getInstance()->ExecuteS(' + DELETE FROM `'._DB_PREFIX_.'accessory` + WHERE `id_product_1` IN ('.implode(', ', array_keys($products)).') + '); + } + + foreach($products as $id_product_1 => $id_products_2) { + foreach($id_products_2 as $id_product_2) { + Db::getInstance()->ExecuteS(' + INSERT INTO `'._DB_PREFIX_.'accessory` VALUES ( + '.(int) $id_product_1.', + '.(int) $id_product_2.' + ) + '); + } + } + + $output .= ''.$this->l('Products updated').'
'; + } elseif(Tools::isSubmit('submitUploadImages')) { + $f = fopen($_FILES['csvfile']['tmp_name'], 'r'); + fgetcsv($f, 0, ';'); + + $products = array(); + $products_a = array(); + $products_a_ids = array(); + + while($line = fgetcsv($f, 0, ';')) { + if(empty($line[0])) { + continue; + } + + if(!isset($line[1]) + || empty($line[1])) { + continue; + } + + if(isset($line[2]) && !empty($line[2])) { + if(!isset($products_a[(int) $line[0]])) { + $products_a[(int) $line[0]] = array(array(), array()); + } + + $products_a[(int) $line[0]][0] = array_merge($products_a[(int) $line[0]][0], array_map('trim', explode(',', $line[1]))); + $products_a[(int) $line[0]][1][(int) $line[2]] = array_map('trim', explode(',', $line[1])); + $products_a_ids[] = (int) $line[2]; + } else { + $products[(int) $line[0]] = array_map('trim', explode(',', $line[1])); + } + } + + fclose($f); + + if(Tools::getValue('image_process') == 1) { + if(count($products) > 0) { + foreach(Db::getInstance()->ExecuteS(' + SELECT `id_image` + FROM `'._DB_PREFIX_.'image` + WHERE `id_product` IN ('.implode(', ', array_keys($products)).') + ') as $row) { + $i = new Image((int) $row['id_image']); + $i->delete(); + } + } + + if(count($products_a_ids) > 0) { + foreach(Db::getInstance()->ExecuteS(' + SELECT DISTINCT i.`id_image` + FROM `'._DB_PREFIX_.'image` i + LEFT JOIN `'._DB_PREFIX_.'product_attribute` a + ON i.`id_product` = a.`id_product` + WHERE a.`id_product_attribute` IN ('.implode(', ', $products_a_ids).') + ') as $row) { + $i = new Image((int) $row['id_image']); + $i->delete(); + } + } + } + + foreach($products as $id_product => $urls) { + foreach($urls as $url) { + $image = new Image(); + $image->id_product = $id_product; + $image->position = Image::getHighestPosition($id_product) + 1; + $image->cover = FALSE; + $image->legend = self::createMultiLangField(Db::getInstance()->getValue(' + SELECT `name` + FROM `'._DB_PREFIX_.'product_lang` + WHERE `id_product` = '.(int) $id_product.' + AND `id_lang` = 2 + ')); + $image->add(); + self::copyImg($id_product, $image->id, $url, 'products'); + } + } + $_id_products = array(); + + foreach($products_a as $id_product => $data) { + $_id_products[] = $id_product; + foreach(array_unique($data[0]) as $url) { + $image = new Image(); + $image->id_product = $id_product; + $image->position = Image::getHighestPosition($id_product) + 1; + $image->cover = FALSE; + $image->legend = self::createMultiLangField(Db::getInstance()->getValue(' + SELECT `name` + FROM `'._DB_PREFIX_.'product_lang` + WHERE `id_product` = '.(int) $id_product.' + AND `id_lang` = 2 + ')); + $image->add(); + self::copyImg($id_product, $image->id, $url, 'products'); + foreach($data[1] as $id_product_attribute => $urls) { + if(in_array($url, $urls)) { + Db::getInstance()->ExecuteS(' + INSERT INTO `'._DB_PREFIX_.'product_attribute_image` + VALUES ( + '.(int) $id_product_attribute.', + '.(int) $image->id.' + ) + '); + } + } + } + } + + $covers = array(); + foreach(Db::getInstance()->ExecuteS(' + SELECT `id_product` + FROM `'._DB_PREFIX_.'image` + WHERE `id_product` IN ('.implode(', ', array_merge($_id_products, array_keys($products))).') + AND `cover` = 1 + ') as $row) { + $covers[] = (int) $row['id_product']; + } + + $to_cover = array_diff(array_merge($_id_products, array_keys($products)), $covers); + + foreach($to_cover as $id_product) { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'image` + SET `cover` = 1 + WHERE `id_product` = '.(int) $id_product.' + LIMIT 1 + '); + } + + $output .= ''.$this->l('Products updated').'
'; + } elseif(Tools::isSubmit('submitUploadStatus')) { + $f = fopen($_FILES['csvfile']['tmp_name'], 'r'); + fgetcsv($f, 0, ';'); + + $products_0 = array(); + $products_1 = array(); + + while($line = fgetcsv($f, 0, ';')) { + if(empty($line[0]) || !isset($line[1])) { + continue; + } + + if((int) $line[1] == 0) { + $products_0[] = (int) $line[0]; + } else { + $products_1[] = (int) $line[0]; + } + } + + fclose($f); + + if(count($products_0) > 0) { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product` + SET `active` = 0 + WHERE `id_product` IN ('.implode(', ', $products_0).') + '); + } + + if(count($products_1) > 0) { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product` + SET `active` = 1 + WHERE `id_product` IN ('.implode(', ', $products_1).') + '); + } + + $output .= ''.$this->l('Products updated').'
'; + } elseif(Tools::isSubmit('submitUploadPrices')) { + $f = fopen($_FILES['csvfile']['tmp_name'], 'r'); + fgetcsv($f, 0, ';'); + + $products = array(); + $prices = array(); + + if(Tools::getValue('price_process') == 2) { + while($line = fgetcsv($f, 0, ';')) { + if(empty($line[0])) { + continue; + } + + $products[] = (int) $line[0]; + } + } else { + while($line = fgetcsv($f, 0, ';')) { + if(empty($line[0])) { + continue; + } + + if(!isset($line[1]) + || !isset($line[2]) + || !in_array(strtolower($line[1]), array('percentage', 'amount'))) { + continue; + } + + $products[] = (int) $line[0]; + $prices[] = array( + (int) $line[0], + strtolower($line[1]), + (float) $line[2] > 1? (float) $line[2] / 100: (float) $line[2], + isset($line[3]) && Validate::isDateFormat($line[3])? $line[3]: '0000-00-00 00:00:00', + isset($line[4]) && Validate::isDateFormat($line[4])? $line[4]: '0000-00-00 00:00:00', + isset($line[5])? (int) $line[5]: 1, + ); + } + } + + fclose($f); + + if(Tools::getValue('price_process') == 1 + || Tools::getValue('price_process') == 2) { + Db::getInstance()->ExecuteS(' + DELETE FROM `'._DB_PREFIX_.'specific_price` + WHERE `id_product` IN ('.implode(', ', $products).') + '); + } + + if(Tools::getValue('price_process') != 2) { + foreach($prices as $price) { + if((int) $price[0] != 0) { + Db::getInstance()->ExecuteS(' + INSERT INTO `'._DB_PREFIX_.'specific_price` VALUES ( + DEFAULT, + '.(int) $price[0].', + 1, + 0, + 0, + 0, + 0.0, + '.(int) $price[5].', + '.(float) $price[2].', + "'.pSQL($price[1]).'", + "'.pSQL($price[3]).'", + "'.pSQL($price[4]).'" + ) + '); + } else { + $output .= 'ID produit à 0, ligne non traitée : '.serialize($price).'
'; + } + } + } + + $output .= ''.$this->l('Products updated').'
'; + } elseif(Tools::isSubmit('submitUploadCombinations')) { + $f = fopen($_FILES['csvfile']['tmp_name'], 'r'); + fgetcsv($f, 0, ';'); + + $products = array(); + + while($line = fgetcsv($f, 0, ';')) { + if(empty($line[0])) { + continue; + } + + $products[] = (int) $line[0]; + } + + Db::getInstance()->ExecuteS(' + DELETE FROM `'._DB_PREFIX_.'product_attribute_combination` + WHERE `id_product_attribute` IN ( + SELECT `id_product_attribute` + FROM `'._DB_PREFIX_.'product_attribute` + WHERE `id_product` IN ('.implode(', ', $products).') + ) + '); + + Db::getInstance()->ExecuteS(' + DELETE FROM `'._DB_PREFIX_.'product_attribute` + WHERE `id_product` IN ('.implode(', ', $products).') + '); + + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'product` + SET `quantity` = 0 + WHERE `id_product` IN ('.implode(', ', $products).') + '); + + fclose($f); + + $output .= ''.$this->l('Products updated').'
'; + } elseif(Tools::isSubmit('submitExport')) { + set_time_limit(300); + $id_lang = Tools::getValue('id_lang', $cookie->id_lang); + if($id_category = (int) Tools::getValue('category')) { + $c = new Category($id_category, $cookie->id_lang); + $children = $c->recurseLiteCategTree(5, 0, $id_lang); + $ids = $this->_recurse_array(array($children)); + $products = array(); + foreach($c->getProductsWs() as $p) { + $products[] = $p['id']; + } + foreach($ids as $id) { + $sc = new Category($id, $id_lang); + foreach($sc->getProductsWs() as $p) { + $products[] = $p['id']; + } + } + $products = array_unique($products); + foreach(glob(dirname(__FILE__).'/*.csv') as $filename) { + unlink($filename); + } + $fname = Tools::passwdGen(10).'.csv'; + $f = fopen(dirname(__FILE__).'/'.$fname, 'w'); + fputcsv($f, array( + 'id_product', + 'id_product_attribute', + 'quantity', + 'product_name', + 'combination', + 'ean13', + 'location', + 'brand', + 'supplier_reference', + 'quantity_sold', + 'public_price_wt', + 'price_wt', + 'wholesale_price', + 'active', + 'description_short', + 'description', + 'images', + 'categories', + ), ';', '"'); + foreach($products as $product) { + $p = new Product((int) $product, $id_lang); + if(!Validate::isLoadedObject($p)) { + $output .= 'Erreur produit: '.serialize($product).' ce produit ne figure pas dans l\'export
'; + } else { + $categories = array(); + foreach(Db::getInstance()->ExecuteS(' + SELECT `id_category` + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_product` = '.(int) $p->id.' + ') as $cat) { + $categories[] = (int) $cat['id_category']; + } + + $combinations = array(); + foreach($p->getAttributeCombinaisons($id_lang) as $combi) { + if(!isset($combinations[$combi['id_product_attribute']])) { + $combinations[$combi['id_product_attribute']] = array( + 'qty' => $combi['quantity'], + 'name' => array($combi['attribute_name']), + 'ean13' => $combi['ean13'], + 'location' => empty($combi['location'])? $p->location: $combi['location'], + 'brand' => $p->manufacturer_name, + 'supplier_reference' => empty($combi['supplier_reference'])? $p->supplier_reference: $combi['supplier_reference'], + ); + } else { + $combinations[$combi['id_product_attribute']]['name'][] = $combi['attribute_name']; + } + } + + $images = array(); + foreach(Db::getInstance()->ExecuteS(' + SELECT i.`id_image`, l.`legend` + FROM `'._DB_PREFIX_.'image` i + LEFT JOIN `'._DB_PREFIX_.'image_lang` l + ON l.`id_image` = i.`id_image` + WHERE l.`id_lang` = '.(int) $id_lang.' + AND i.`id_product` = '.(int) $p->id.' + ') as $img) { + $link_image = str_split($img['id_image']); + $images[] = 'http://static.bebeboutik.com/img/p/'.implode('/', $link_image) .'/'. $img['id_image'].'.jpg'; + } + + if(count($combinations) > 0) { + foreach($combinations as $k => $v) { + $c_images = array(); + foreach(Db::getInstance()->ExecuteS(' + SELECT i.`id_image`, l.`legend` + FROM `'._DB_PREFIX_.'image` i + LEFT JOIN `'._DB_PREFIX_.'image_lang` l + ON l.`id_image` = i.`id_image` + LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` a + ON a.`id_image` = i.`id_image` + WHERE l.`id_lang` = '.(int) $id_lang.' + AND a.`id_product_attribute` = '.(int) $k.' + ') as $img) { + $link_image = str_split($img['id_image']); + $c_images[] = 'http://static.bebeboutik.com/img/p/'.implode('/', $link_image) .'/'. $img['id_image'].'.jpg'; + // $c_images[] = 'http://static.bebeboutik.com/'.(int) $p->id.'-'.$img['id_image'].'.jpg'; + } + + $names = array_unique($v['name']); + sort($names, SORT_STRING); + fputcsv($f, array( + $p->id, + $k, + $v['qty'], + $p->name[$id_lang], + implode(' - ', $names), + $v['ean13'], + $v['location'], + $v['brand'], + $v['supplier_reference'], + (int) Db::getInstance()->getValue(' + SELECT SUM(d.`product_quantity`) + FROM `'._DB_PREFIX_.'order_detail` d + LEFT JOIN `'._DB_PREFIX_.'orders` o + ON o.`id_order` = d.`id_order` + LEFT JOIN `'._DB_PREFIX_.'order_history` h + ON h.`id_order` = d.`id_order` + WHERE d.`product_id` = '.(int) $p->id.' + AND d.`product_attribute_id` = '.(int) $k.' + AND h.`id_order_state` = 2 + '), + $p->getPrice(TRUE, (int) $k, 2, NULL, FALSE, FALSE), + $p->getPrice(TRUE, (int) $k, 2), + Tools::ps_round($p->wholesale_price, 2), + $p->active, + $p->description_short[$id_lang], + $p->description[$id_lang], + count($c_images) > 0? implode(', ', $c_images): implode(', ', $images), + implode(', ', $categories), + ), ';', '"'); + } + } else { + fputcsv($f, array( + $p->id, + 0, + $p->quantity, + $p->name[$id_lang], + '', + $p->ean13, + $p->location, + $p->manufacturer_name, + $p->supplier_reference, + (int) Db::getInstance()->getValue(' + SELECT SUM(d.`product_quantity`) + FROM `'._DB_PREFIX_.'order_detail` d + LEFT JOIN `'._DB_PREFIX_.'orders` o + ON o.`id_order` = d.`id_order` + LEFT JOIN `'._DB_PREFIX_.'order_history` h + ON h.`id_order` = d.`id_order` + WHERE d.`product_id` = '.(int) $p->id.' + AND h.`id_order_state` = 2 + '), + $p->getPrice(TRUE, NULL, 2, NULL, FALSE, FALSE), + $p->getPrice(TRUE, NULL, 2), + Tools::ps_round($p->wholesale_price, 2), + $p->active, + $p->description_short[$id_lang], + $p->description[$id_lang], + implode(', ', $images), + implode(', ', $categories), + ), ';', '"'); + } + } + } + fclose($f); + $output .= ''.$this->l('Export complete.').' '.$this->l('Click here to download the file').'
'; + } elseif($id_brand = (int) Tools::getValue('brand-ps')) { + foreach(Db::getInstance()->ExecuteS(' + SELECT DISTINCT `id_product` + FROM `'._DB_PREFIX_.'product` + WHERE `id_manufacturer` = '.(int) $id_brand.' + ') as $p) { + $products[] = $p['id_product']; + } + foreach(glob(dirname(__FILE__).'/*.csv') as $filename) { + unlink($filename); + } + $fname = Tools::passwdGen(10).'.csv'; + $f = fopen(dirname(__FILE__).'/'.$fname, 'w'); + fputcsv($f, array( + 'id_product', + 'id_product_attribute', + 'quantity', + 'product_name', + 'combination', + 'ean13', + 'location', + 'brand', + 'supplier_reference', + 'quantity_sold', + 'public_price_wt', + 'price_wt', + 'wholesale_price', + 'active', + 'description_short', + 'description', + 'images', + 'categories', + ), ';', '"'); + foreach($products as $product) { + $p = new Product((int) $product, $id_lang); + if(!Validate::isLoadedObject($p)) { + $output .= 'Erreur produit: '.serialize($product).' ce produit ne figure pas dans l\'export
'; + } else { + $categories = array(); + foreach(Db::getInstance()->ExecuteS(' + SELECT `id_category` + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_product` = '.(int) $p->id.' + ') as $cat) { + $categories[] = (int) $cat['id_category']; + } + + $combinations = array(); + foreach($p->getAttributeCombinaisons($id_lang) as $combi) { + if(!isset($combinations[$combi['id_product_attribute']])) { + $combinations[$combi['id_product_attribute']] = array( + 'qty' => $combi['quantity'], + 'name' => array($combi['attribute_name']), + 'ean13' => $combi['ean13'], + 'location' => empty($combi['location'])? $p->location: $combi['location'], + 'brand' => $p->manufacturer_name, + 'supplier_reference' => empty($combi['supplier_reference'])? $p->supplier_reference: $combi['supplier_reference'], + ); + } else { + $combinations[$combi['id_product_attribute']]['name'][] = $combi['attribute_name']; + } + } + + $images = array(); + foreach(Db::getInstance()->ExecuteS(' + SELECT i.`id_image`, l.`legend` + FROM `'._DB_PREFIX_.'image` i + LEFT JOIN `'._DB_PREFIX_.'image_lang` l + ON l.`id_image` = i.`id_image` + WHERE l.`id_lang` = '.(int) $id_lang.' + AND i.`id_product` = '.(int) $p->id.' + ') as $img) { + $images[] = 'http://static.bebeboutik.com/'.(int) $p->id.'-'.$img['id_image'].'.jpg'; + } + + if(count($combinations) > 0) { + foreach($combinations as $k => $v) { + $c_images = array(); + foreach(Db::getInstance()->ExecuteS(' + SELECT i.`id_image`, l.`legend` + FROM `'._DB_PREFIX_.'image` i + LEFT JOIN `'._DB_PREFIX_.'image_lang` l + ON l.`id_image` = i.`id_image` + LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` a + ON a.`id_image` = i.`id_image` + WHERE l.`id_lang` = '.(int) $id_lang.' + AND a.`id_product_attribute` = '.(int) $k.' + ') as $img) { + $c_images[] = 'http://static.bebeboutik.com/'.(int) $p->id.'-'.$img['id_image'].'.jpg'; + } + + + + $names = array_unique($v['name']); + sort($names, SORT_STRING); + fputcsv($f, array( + $p->id, + $k, + $v['qty'], + $p->name[$id_lang], + implode(' - ', $names), + $v['ean13'], + $v['location'], + $v['brand'], + $v['supplier_reference'], + (int) Db::getInstance()->getValue(' + SELECT SUM(d.`product_quantity`) + FROM `'._DB_PREFIX_.'order_detail` d + LEFT JOIN `'._DB_PREFIX_.'orders` o + ON o.`id_order` = d.`id_order` + LEFT JOIN `'._DB_PREFIX_.'order_history` h + ON h.`id_order` = d.`id_order` + WHERE d.`product_id` = '.(int) $p->id.' + AND d.`product_attribute_id` = '.(int) $k.' + AND h.`id_order_state` = 2 + '), + $p->getPrice(TRUE, (int) $k, 2, NULL, FALSE, FALSE), + $p->getPrice(TRUE, (int) $k, 2), + Tools::ps_round($p->wholesale_price, 2), + $p->active, + $p->description_short[$id_lang], + $p->description[$id_lang], + count($c_images) > 0? implode(', ', $c_images): implode(', ', $images), + implode(', ', $categories), + ), ';', '"'); + } + } else { + fputcsv($f, array( + $p->id, + 0, + $p->quantity, + $p->name[$id_lang], + '', + $p->ean13, + $p->location, + $p->manufacturer_name, + $p->supplier_reference, + (int) Db::getInstance()->getValue(' + SELECT SUM(d.`product_quantity`) + FROM `'._DB_PREFIX_.'order_detail` d + LEFT JOIN `'._DB_PREFIX_.'orders` o + ON o.`id_order` = d.`id_order` + LEFT JOIN `'._DB_PREFIX_.'order_history` h + ON h.`id_order` = d.`id_order` + WHERE d.`product_id` = '.(int) $p->id.' + AND h.`id_order_state` = 2 + '), + $p->getPrice(TRUE, NULL, 2, NULL, FALSE, FALSE), + $p->getPrice(TRUE, NULL, 2), + Tools::ps_round($p->wholesale_price, 2), + $p->active, + $p->description_short[$id_lang], + $p->description[$id_lang], + implode(', ', $images), + implode(', ', $categories), + ), ';', '"'); + } + } + } + fclose($f); + $output .= ''.$this->l('Export complete.').' '.$this->l('Click here to download the file').'
'; + } + } elseif(Tools::isSubmit('submitExportPositions')) { + set_time_limit(300); + if($id_category = (int) Tools::getValue('category')) { + foreach(glob(dirname(__FILE__).'/*.csv') as $filename) { + unlink($filename); + } + $fname = Tools::passwdGen(10).'.csv'; + $f = fopen(dirname(__FILE__).'/'.$fname, 'w'); + fputcsv($f, array( + 'id_category', + 'id_product', + 'position', + 'name', + ), ';', '"'); + foreach(Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'category_product` cp + LEFT JOIN `'._DB_PREFIX_.'product_lang` l + ON cp.`id_product` = l.`id_product` + WHERE cp.`id_category` = '.(int) $id_category.' + AND l.`id_lang` = 2 + ') as $row) { + fputcsv($f, array( + (int) $row['id_category'], + (int) $row['id_product'], + (int) $row['position'], + $row['name'], + ), ';', '"'); + } + fclose($f); + $output .= ''.$this->l('Export complete.').' '.$this->l('Click here to download the file').'
'; + } + } elseif(Tools::isSubmit('submitUploadPositions')) { + set_time_limit(300); + $f = fopen($_FILES['csvfile']['tmp_name'], 'r'); + fgetcsv($f, 0, ';'); + + $products = array(); + + while($line = fgetcsv($f, 0, ';')) { + if($line[0] == '' || $line[1] == '' || $line[2] == '') { + continue; + } + + $products[] = $line; + } + + foreach($products as $line) { + Db::getInstance()->ExecuteS(' + UPDATE `'._DB_PREFIX_.'category_product` + SET `position` = '.(int) $line[2].' + WHERE `id_product` = '.(int) $line[1].' + AND `id_category` = '.(int) $line[0].' + '); + } + + fclose($f); + $output .= ''.$this->l('Products updated').'
'; + } + + return $output.$this->displayForm(); + } + + private function _recurse_array($array) { + $result = array(); + foreach($array as $i) { + $result[] = $i['id']; + if(count($i['children']) > 0) { + $result = array_merge($result, $this->_recurse_array($i['children'])); + } + } + return $result; + } + + public function displayForm() { + global $cookie; + + $output = ' + '; + + $output .= ' +'.$this->l('You have to configure "General Settings" tab before using this tab.').'
'.$this->l('In this tab, you can set a specific configuration for each category.').'
'.$this->l('ID Config').' | +'.$this->l('Category').' | +'.$this->l('Additional charges').' | +'.$this->l('Services').' | +'.$this->l('Actions').' | +|
---|---|---|---|---|---|
'.$this->l('There is no specific Canada Post configuration for categories at this point.').' | |||||
'.$c['id_cp_rate_config'].' | +'.$path.' | +'.$c['additional_charges'].' '.$configCurrency->sign.' | +'.$services.' | ++ + + + + | +
'.$this->l('Update a rule').' ('.$this->l('Add a rule').' ?)
+ '; + } + else + { + $html .= ''.$this->l('Add a rule').'
+ '; + } + + return $html; + } + + private function _postValidationCategory() + { + // Check post values + if (Tools::getValue('id_category') == NULL) + $this->_postErrors[] = $this->l('You have to select a category.'); + + if (!$this->_postErrors) + { + $id_cp_rate_config = Db::getInstance()->getValue('SELECT `id_cp_rate_config` FROM `'._DB_PREFIX_.'cp_rate_config` WHERE `id_category` = '.(int)Tools::getValue('id_category')); + + // Check if a config does not exist in Add case + if ($id_cp_rate_config > 0 && Tools::getValue('action') == 'add') + $this->_postErrors[] = $this->l('This category already has a specific Canada Post configuration.'); + + // Check if a config exists and if the IDs config correspond in Upd case + if (Tools::getValue('action') == 'edit' && (!isset($id_cp_rate_config) || $id_cp_rate_config != Tools::getValue('id_cp_rate_config'))) + $this->_postErrors[] = $this->l('An error occurred, please try again.'); + + // Check if a config exists in Delete case + if (Tools::getValue('action') == 'delete' && !isset($id_cp_rate_config)) + $this->_postErrors[] = $this->l('An error occurred, please try again.'); + } + } + + private function _postProcessCategory() + { + // Init Var + $date = date('Y-m-d H:i:s'); + $services = Tools::getValue('service'); + + // Add Script + if (Tools::getValue('action') == 'add') + { + $addTab = array( + 'id_product' => 0, + 'id_category' => (int)(Tools::getValue('id_category')), + 'id_currency' => (int)(Configuration::get('PS_CURRENCY_DEFAULT')), + 'additional_charges' => pSQL(Tools::getValue('additional_charges')), + 'date_add' => pSQL($date), + 'date_upd' => pSQL($date) + ); + Db::getInstance()->autoExecute(_DB_PREFIX_.'cp_rate_config', $addTab, 'INSERT'); + $id_cp_rate_config = Db::getInstance()->Insert_ID(); + foreach ($services as $s) + { + $addTab = array('id_cp_rate_service_code' => pSQL($s), 'id_cp_rate_config' => (int)$id_cp_rate_config, 'date_add' => pSQL($date), 'date_upd' => pSQL($date)); + Db::getInstance()->autoExecute(_DB_PREFIX_.'cp_rate_config_service', $addTab, 'INSERT'); + } + + // Display Results + if ($id_cp_rate_config > 0) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + + // Update Script + if (Tools::getValue('action') == 'edit' && Tools::getValue('id_cp_rate_config')) + { + $updTab = array( + 'id_currency' => (int)(Configuration::get('PS_CURRENCY_DEFAULT')), + 'additional_charges' => pSQL(Tools::getValue('additional_charges')), + 'date_upd' => pSQL($date) + ); + $result = Db::getInstance()->autoExecute(_DB_PREFIX_.'cp_rate_config', $updTab, 'UPDATE', '`id_cp_rate_config` = '.(int)Tools::getValue('id_cp_rate_config')); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cp_rate_config_service` WHERE `id_cp_rate_config` = '.(int)Tools::getValue('id_cp_rate_config')); + foreach ($services as $s) + { + $addTab = array('id_cp_rate_service_code' => pSQL($s), 'id_cp_rate_config' => (int)Tools::getValue('id_cp_rate_config'), 'date_add' => pSQL($date), 'date_upd' => pSQL($date)); + Db::getInstance()->autoExecute(_DB_PREFIX_.'cp_rate_config_service', $addTab, 'INSERT'); + } + + // Display Results + if ($result) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + + // Delete Script + if (Tools::getValue('action') == 'delete' && Tools::getValue('id_cp_rate_config')) + { + $result1 = Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cp_rate_config` WHERE `id_cp_rate_config` = '.(int)Tools::getValue('id_cp_rate_config')); + $result2 = Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cp_rate_config_service` WHERE `id_cp_rate_config` = '.(int)Tools::getValue('id_cp_rate_config')); + + // Display Results + if ($result1) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + } + + + + /* + ** Product Form Config Methods + ** + */ + + private function _displayFormProduct() + { + global $cookie; + + // Check if the module is configured + if (!$this->_webserviceTestResult) + return ''.$this->l('You have to configure "General Settings" tab before using this tab.').'
'.$this->l('In this tab, you can set a specific configuration for each product.').'
'.$this->l('ID Config').' | +'.$this->l('Product').' | +'.$this->l('Additional charges').' | +'.$this->l('Services').' | +'.$this->l('Actions').' | +|
---|---|---|---|---|---|
'.$this->l('There is no specific Canada Post configuration for products at this point.').' | |||||
'.$c['id_cp_rate_config'].' | +'.$product->name.' | +'.$c['additional_charges'].' '.$configCurrency->sign.' | +'.$services.' | ++ + + + + | +
'.$this->l('Update a rule').' ('.$this->l('Add a rule').' ?)
+ '; + } + else + { + $html .= ''.$this->l('Add a rule').'
+ '; + } + + return $html; + } + + private function _postValidationProduct() + { + // Check post values + if (Tools::getValue('id_product') == NULL) + $this->_postErrors[] = $this->l('You have to select a product.'); + + if (!$this->_postErrors) + { + $id_cp_rate_config = Db::getInstance()->getValue('SELECT `id_cp_rate_config` FROM `'._DB_PREFIX_.'cp_rate_config` WHERE `id_product` = '.(int)Tools::getValue('id_product')); + + // Check if a config does not exist in Add case + if ($id_cp_rate_config > 0 && Tools::getValue('action') == 'add') + $this->_postErrors[] = $this->l('This product already has a specific Canada Post configuration.'); + + // Check if a config exists and if the IDs config correspond in Upd case + if (Tools::getValue('action') == 'edit' && (!isset($id_cp_rate_config) || $id_cp_rate_config != Tools::getValue('id_cp_rate_config'))) + $this->_postErrors[] = $this->l('An error occurred, please try again.'); + + // Check if a config exists in Delete case + if (Tools::getValue('action') == 'delete' && !isset($id_cp_rate_config)) + $this->_postErrors[] = $this->l('An error occurred, please try again.'); + } + } + + private function _postProcessProduct() + { + // Init Var + $date = date('Y-m-d H:i:s'); + $services = Tools::getValue('service'); + + // Add Script + if (Tools::getValue('action') == 'add') + { + $addTab = array( + 'id_product' => (int)(Tools::getValue('id_product')), + 'id_category' => 0, + 'id_currency' => (int)(Configuration::get('PS_CURRENCY_DEFAULT')), + 'additional_charges' => pSQL(Tools::getValue('additional_charges')), + 'date_add' => pSQL($date), + 'date_upd' => pSQL($date) + ); + Db::getInstance()->autoExecute(_DB_PREFIX_.'cp_rate_config', $addTab, 'INSERT'); + $id_cp_rate_config = Db::getInstance()->Insert_ID(); + foreach ($services as $s) + { + $addTab = array('id_cp_rate_service_code' => pSQL($s), 'id_cp_rate_config' => (int)$id_cp_rate_config, 'date_add' => pSQL($date), 'date_upd' => pSQL($date)); + Db::getInstance()->autoExecute(_DB_PREFIX_.'cp_rate_config_service', $addTab, 'INSERT'); + } + + // Display Results + if ($id_cp_rate_config > 0) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + + // Update Script + if (Tools::getValue('action') == 'edit' && Tools::getValue('id_cp_rate_config')) + { + $updTab = array( + 'id_currency' => (int)(Configuration::get('PS_CURRENCY_DEFAULT')), + 'additional_charges' => pSQL(Tools::getValue('additional_charges')), + 'date_upd' => pSQL($date) + ); + $result = Db::getInstance()->autoExecute(_DB_PREFIX_.'cp_rate_config', $updTab, 'UPDATE', '`id_cp_rate_config` = '.(int)Tools::getValue('id_cp_rate_config')); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cp_rate_config_service` WHERE `id_cp_rate_config` = '.(int)Tools::getValue('id_cp_rate_config')); + foreach ($services as $s) + { + $addTab = array('id_cp_rate_service_code' => pSQL($s), 'id_cp_rate_config' => (int)Tools::getValue('id_cp_rate_config'), 'date_add' => pSQL($date), 'date_upd' => pSQL($date)); + Db::getInstance()->autoExecute(_DB_PREFIX_.'cp_rate_config_service', $addTab, 'INSERT'); + } + + // Display Results + if ($result) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + + // Delete Script + if (Tools::getValue('action') == 'delete' && Tools::getValue('id_cp_rate_config')) + { + $result1 = Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cp_rate_config` WHERE `id_cp_rate_config` = '.(int)Tools::getValue('id_cp_rate_config')); + $result2 = Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cp_rate_config_service` WHERE `id_cp_rate_config` = '.(int)Tools::getValue('id_cp_rate_config')); + + // Display Results + if ($result1) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + } + + + + /* + ** Help Config Methods + ** + */ + + private function _displayHelp() + { + return ''.$this->l('Welcome to the PrestaShop Canada Post Module configurator.').'
+'.$this->l('This section will help you to understand how to configure this module correctly.').'
+1. '.$this->l('General Settings').'
+'.$this->l('See below for the description of each field :').'
+'.$this->l('Your Canada Post Account').' : '.$this->l('You must subscribe to Canada Post website at this address').' http://www.canadapost.ca
+'.$this->l('Zip / Postal Code').' : '.$this->l('This field must be the Zip / Postal code of your package starting point.').'
+'.$this->l('Country').' : '.$this->l('This field must be the country of your package starting point.').'
+'.$this->l('Delivery Service').' : '.$this->l('These checkboxes correspond to the delivery services you want to be available (when there is no specific configuration for the product or the category product).').'
+2. '.$this->l('Categories Settings').'
+'.$this->l('This section allows you to define a specific Canada Post configuration for each product category (such as Additional charges).').'
+3. '.$this->l('Products Settings').'
+'.$this->l('This section allows you to define a specific Canada Post configuration for each product (such as Additional charges).').'
+{l s='Your order on' mod='cashondelivery'} {$shop_name} {l s='is complete.' mod='cashondelivery'}
+
+ {l s='You have chosen the cash on delivery method.' mod='cashondelivery'}
+
{l s='Your order will be sent very soon.' mod='cashondelivery'}
+
{l s='For any questions or for further information, please contact our' mod='cashondelivery'} {l s='customer support' mod='cashondelivery'}.
+
'.$this->getL('configure_currency').'
+'.$this->getL('payment_not_displayed').'
+'.$this->getL('configuration_in').' '.$currency['name'].' '.$currency['sign'].' | +
+
+
+
+
+ + +
+
+
+ '.$certificateExiste.'
+
+
+
+
+ '.$passwordExist.'
+ |
+
{l s='Your order on' mod='cashticket'} {$shop_name} {l s='is complete.' mod='cashticket'}
+
+ {l s='You have chosen the' mod='cashticket'} {$payment_name} {l s='method.' mod='cashticket'}
+
{l s='Your order will be sent very soon.' mod='cashticket'}
+
{l s='For any questions or for further information, please contact our' mod='cashticket'} {l s='customer support' mod='cashticket'}.
+
+ + + {l s='Pay with' mod='cashticket'} {$payment_name} + +
diff --git a/modules/cashticket/prepaidservices.js b/modules/cashticket/prepaidservices.js new file mode 100755 index 00000000..cd5a5dd5 --- /dev/null +++ b/modules/cashticket/prepaidservices.js @@ -0,0 +1,38 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* 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 SAThis Category not exist
+{$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'}
*} + {*{if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}{l s='On sale!' mod='categoryscroll'} + {elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}{l s='Reduced price!' mod='categoryscroll'}{/if}*} + {if isset($product.online_only) && $product.online_only}{l s='Online only!' mod='categoryscroll'}{/if} + {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))} ++ {/if} +
+ + + {l s='Pay by cheque (order process will be longer)' mod='cheque'} + +
\ No newline at end of file diff --git a/modules/cheque/payment_execution.tpl b/modules/cheque/payment_execution.tpl new file mode 100755 index 00000000..59a7d5df --- /dev/null +++ b/modules/cheque/payment_execution.tpl @@ -0,0 +1,80 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* 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{l s='Your shopping cart is empty.'}
+{else} + +{l s='Your order on' mod='cheque'} {$shop_name} {l s='is complete.' mod='cheque'}
+
+ {l s='Please send us a cheque with:' mod='cheque'}
+
- {l s='an amount of' mod='cheque'} {$total_to_pay}
+
- {l s='payable to the order of' mod='cheque'} {if $chequeName}{$chequeName}{else}___________{/if}
+
- {l s='mail to' mod='cheque'} {if $chequeAddress}{$chequeAddress}{else}___________{/if}
+
{l s='An e-mail has been sent to you with this information.' mod='cheque'}
+
{l s='Your order will be sent as soon as we receive your payment.' mod='cheque'}
+
{l s='For any questions or for further information, please contact our' mod='cheque'} {l s='customer support' mod='cheque'}.
+
+ {l s='We noticed a problem with your order. If you think this is an error, you can contact our' mod='cheque'} + {l s='customer support' mod='cheque'}. +
+{/if} diff --git a/modules/cheque/validation.php b/modules/cheque/validation.php new file mode 100755 index 00000000..7826caee --- /dev/null +++ b/modules/cheque/validation.php @@ -0,0 +1,64 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 7734 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../header.php'); +include(dirname(__FILE__).'/cheque.php'); + +$cheque = new Cheque(); + +if ($cart->id_customer == 0 OR $cart->id_address_delivery == 0 OR $cart->id_address_invoice == 0 OR !$cheque->active) + Tools::redirectLink(__PS_BASE_URI__.'order.php?step=1'); + +// Check that this payment option is still available in case the customer changed his address just before the end of the checkout process +$authorized = false; +foreach (Module::getPaymentModules() as $module) + if ($module['name'] == 'cheque') + { + $authorized = true; + break; + } +if (!$authorized) + die(Tools::displayError('This payment method is not available.')); + +$customer = new Customer((int)$cart->id_customer); + +if (!Validate::isLoadedObject($customer)) + Tools::redirectLink(__PS_BASE_URI__.'order.php?step=1'); + +$currency = new Currency((int)(Tools::isSubmit('currency_payement') ? Tools::getValue('currency_payement') : $cookie->id_currency)); +$total = (float)$cart->getOrderTotal(true, Cart::BOTH); + +$mailVars = array( + '{cheque_name}' => Configuration::get('CHEQUE_NAME'), + '{cheque_address}' => Configuration::get('CHEQUE_ADDRESS'), + '{cheque_address_html}' => str_replace("\n", '{l s='Approximate date of delivery with this carrier is between' mod='dateofdelivery'} {l s='and' mod='dateofdelivery'} *
+* {l s='with direct payment methods (e.g: credit card)' mod='dateofdelivery'}
+{/if} \ No newline at end of file diff --git a/modules/dateofdelivery/dateofdelivery.php b/modules/dateofdelivery/dateofdelivery.php new file mode 100755 index 00000000..c59012e0 --- /dev/null +++ b/modules/dateofdelivery/dateofdelivery.php @@ -0,0 +1,528 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 8332 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) + exit; + +class DateOfDelivery extends Module +{ + private $_html = ''; + + public function __construct() + { + $this->name = 'dateofdelivery'; + $this->tab = 'shipping_logistics'; + $this->version = '1.0'; + $this->author = 'PrestaShop'; + $this->need_instance = 0; + + parent::__construct(); + + $this->displayName = $this->l('Date of delivery'); + $this->description = $this->l('Displays an approximate date of delivery'); + } + + public function install() + { + if (!parent::install() OR !$this->registerHook('beforeCarrier') OR !$this->registerHook('orderDetailDisplayed')) + return false; + + if (!Db::getInstance()->Execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'dateofdelivery_carrier_rule` ( + `id_carrier_rule` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + `id_carrier` INT NOT NULL, + `minimal_time` INT NOT NULL, + `maximal_time` INT NOT NULL, + `delivery_saturday` TINYINT(1) NOT NULL, + `delivery_sunday` TINYINT(1) NOT NULL + ) ENGINE ='._MYSQL_ENGINE_.'; + ')) + return false; + + Configuration::updateValue('DOD_EXTRA_TIME_PRODUCT_OOS', 0); + Configuration::updateValue('DOD_EXTRA_TIME_PREPARATION', 1); + Configuration::updateValue('DOD_PREPARATION_SATURDAY', 1); + Configuration::updateValue('DOD_PREPARATION_SUNDAY', 1); + Configuration::updateValue('DOD_DATE_FORMAT', 'l j F Y'); + + return true; + } + + public function uninstall() + { + Configuration::deleteByName('DOD_EXTRA_TIME_PRODUCT_OOS'); + Configuration::deleteByName('DOD_EXTRA_TIME_PREPARATION'); + Configuration::deleteByName('DOD_PREPARATION_SATURDAY'); + Configuration::deleteByName('DOD_PREPARATION_SUNDAY'); + Configuration::deleteByName('DOD_DATE_FORMAT'); + Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'dateofdelivery_carrier_rule`'); + + return parent::uninstall(); + } + + public function getContent() + { + $this->_html .= '{l s='Approximate date of delivery is between' mod='dateofdelivery'} {$datesDelivery.0} {l s='and' mod='dateofdelivery'} {$datesDelivery.1} *
+* {l s='with direct payment methods (e.g: credit card)' mod='dateofdelivery'}
+{/if} \ No newline at end of file diff --git a/modules/dejala/MyLogUtils.php b/modules/dejala/MyLogUtils.php new file mode 100755 index 00000000..15dfaa4e --- /dev/null +++ b/modules/dejala/MyLogUtils.php @@ -0,0 +1,49 @@ +$avalue) { + $buffer=$buffer . $indent . "\t" . $akey ."=>". MyLogUtils::logValue($avalue,$lvl+1) . "\r\n"; + } + $buffer=$buffer.$indent."}"; + return ($buffer); + } + elseif (is_object($mvalue)) + { + $indent=""; + for ($i=0; $i < $lvl; $i++) + $indent = $indent."\t"; + $buffer = "?" . "=" . get_class($mvalue) . "{\r\n"; + foreach ($mvalue as $akey=>$avalue) { + $buffer=$buffer . $indent . "\t" . $akey ."=". MyLogUtils::logValue($avalue,$lvl+1) . "\r\n"; + } + $buffer=$buffer.$indent."}"; + return($buffer); + } + else + return ($mvalue); + } +} + diff --git a/modules/dejala/calendarutils.php b/modules/dejala/calendarutils.php new file mode 100755 index 00000000..70c8f8d9 --- /dev/null +++ b/modules/dejala/calendarutils.php @@ -0,0 +1,141 @@ + 0) + { + $currentHour = $currentHour + 1; + $dateUtc = mktime($currentHour, 0, 0, date('m', $dateUtc), date('d', $dateUtc), date('Y', $dateUtc)); + } + // si on est avant l'heure de départ, on se met à l'heure de départ + if ($currentHour < $startHour) + { + $dateUtc = mktime($startHour, 0, 0, date('m', $dateUtc), date('d', $dateUtc), date('Y', $dateUtc)); + } + return ($dateUtc); + } + + /** + * Ajout un délai à la date dateUtc : 0.5 jour ou 1*nb de jours + * Prend en compte le calendrier & les exceptions + **/ + public function addDelay($dateUtc, $delay, $calendar, $exceptions) + { + // on se base sur la prochaine date dispo + $dateUtc = $this->getNextDateAvailable($dateUtc, $calendar, $exceptions); + if (!$dateUtc) + return (null); + + if ($delay == '0.5') + { + $hour = (int)(date('H', $dateUtc)); + if ($hour < 12) + { + $dateUtc = mktime('14', 0, 0, date('m', $dateUtc), date('d', $dateUtc), date('Y', $dateUtc)); + } else + { + $dateUtc = $this->skipOneDay($dateUtc) ; + $dateUtc = $this->getNextDateAvailable($dateUtc, $calendar, $exceptions); + } + return ($dateUtc); + } + + $deliveryDelay = (int)($delay); + while ($deliveryDelay--) + { + $dateUtc = strtotime(date("Y-m-d", $dateUtc) . " +1 day"); + $dateUtc = mktime(0, 0, 0, date('m', $dateUtc), date('d', $dateUtc), date('Y', $dateUtc)); + $dateUtc = $this->getNextDateAvailable($dateUtc, $calendar, $exceptions); + } + return ($dateUtc); + } + + public function skipOneDay($dateUtc) + { + $dateUtc = strtotime(date("Y-m-d", $dateUtc) . " +1 day"); + // on remet sur 00h00 pr livrer au début du jour + $dateUtc = mktime(0, 0, 0, date('m', $dateUtc), date('d', $dateUtc), date('Y', $dateUtc)); + + return $dateUtc ; + } + public function skipCurDay($dateUtc) + { + $currentDayZero = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time())); + $dateUtcZero = mktime(0, 0, 0, date('m', $dateUtc), date('d', $dateUtc), date('Y', $dateUtc)); + if ($currentDayZero == $dateUtcZero) + { + $dateUtc = $this->skipOneDay($dateUtc) ; + } + return $dateUtc ; + } + /** + * Renvoie la prochaine journée disponible (soit $dateUtc, soit la prochaine à 00h00) + * Si aucune ds les 15j, renvoie NULL + **/ + public function getNextDateAvailable($dateUtc, $calendar, $exceptions) + { + // si dateUtc est dispo, retourne $dateUtc + if ($this->isDateAvailable($dateUtc, $calendar, $exceptions)) + return ($dateUtc); + + $loopcount = 0; + // on positionne au début de journée + $dateUtc = mktime(0, 0, 0, date('m', $dateUtc), date('d', $dateUtc), date('Y', $dateUtc)); + // on boucle pour trouver une journée dispo (si ds les 15j, y a pas : on laisse tomber + do + { + $dateUtc = strtotime(date("Y-m-d", $dateUtc) . " +1 day"); + $isDateFree = $this->isDateAvailable($dateUtc, $calendar, $exceptions); + $loopcount++; + } + while (!$isDateFree && ($loopcount < 15) ); + if ($isDateFree) + return ($dateUtc); + return (NULL); + } + + /** + * Returns if $dateUtc is available (orderable date) + **/ + public function isDateAvailable($dateUtc, $calendar, $exceptions) + { + // jour ferié ? + $mCalDate = date("d/m/Y", $dateUtc); + if (in_array($mCalDate, $exceptions)) + return (false); + // jour fermé ? + $wd = date('w', $dateUtc); + if (!isset($calendar[$wd])) + return (false); + + // on arrondit à l'heure suivante & on regarde si on est avant la fermeture + $stopHour = (int)($calendar[$wd]['stop_hour']); + $currentHour = (int)(date('H', $dateUtc)); + $currentMin = (int)(date('i', $dateUtc)); + if ($currentMin > 0) + $currentHour = $currentHour + 1; + // avant l'heure de fermeture ? + if ($currentHour <= $stopHour) + return (true); + else + return (false); + } + +} + diff --git a/modules/dejala/de.php b/modules/dejala/de.php new file mode 100755 index 00000000..10cdec71 --- /dev/null +++ b/modules/dejala/de.php @@ -0,0 +1,187 @@ +dejala_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Sonntag'; +$_MODULE['<{dejala}prestashop>dejala_6f8522e0610541f1ef215a22ffa66ff6'] = 'Montag'; +$_MODULE['<{dejala}prestashop>dejala_5792315f09a5d54fb7e3d066672b507f'] = 'Dienstag'; +$_MODULE['<{dejala}prestashop>dejala_796c163589f295373e171842f37265d5'] = 'Mittwoch'; +$_MODULE['<{dejala}prestashop>dejala_78ae6f0cd191d25147e252dc54768238'] = 'Donnerstag'; +$_MODULE['<{dejala}prestashop>dejala_c33b138a163847cdb6caeeb7c9a126b4'] = 'Freitag'; +$_MODULE['<{dejala}prestashop>dejala_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Samstag'; +$_MODULE['<{dejala}prestashop>dejala_9902522831a16af239ba868918f984c6'] = 'Dejala.com: Lieferung per Kurier'; +$_MODULE['<{dejala}prestashop>dejala_69a226fe54256a93edb693bc97a7bcb5'] = 'Lassen Sie Dejala.com Ihre Lieferungen per Kurier übernehmen'; +$_MODULE['<{dejala}prestashop>dejala_f66e08578735b3cde28a2d8215b68a52'] = 'Das Dejala-Modul benötigt die PHP-Erweiterung cURL, um ordnungsgemäß zu funktionieren. Bitte installieren Sie diePHP-Erweiterung \"cURL\"'; +$_MODULE['<{dejala}prestashop>dejala_0e334c81db8c621e16d82618aaf746ab'] = 'Login ist erforderlich.'; +$_MODULE['<{dejala}prestashop>dejala_2a04cf556c49e32d4b4c46fd9b8bade5'] = 'Kennwort ist erforderlich.'; +$_MODULE['<{dejala}prestashop>dejala_483cf1f6e275faa3c29ff20ba6e4407f'] = 'Land ist erforderlich.'; +$_MODULE['<{dejala}prestashop>dejala_2485b5c3212614c367f862a8e46f4d11'] = 'Das Login muss eine gültige E-Mail-Adresse sein.'; +$_MODULE['<{dejala}prestashop>dejala_dd189cdaa73e88a19f495a0d6c49a61b'] = 'Shop Name ist erforderlich.'; +$_MODULE['<{dejala}prestashop>dejala_4876f72a0b3d7f46de2b201ab02cd0a7'] = 'ist keine gültige Marge.'; +$_MODULE['<{dejala}prestashop>dejala_ad5ee5e5c2989c1e72c586a9f8121716'] = 'Ein Fehler trat während der Authentifizierung Ihres Kontos auf Dejala.com auf. Ihre Zugangsdaten wurden nicht erkannt'; +$_MODULE['<{dejala}prestashop>dejala_23e0f5b7cc6e26112230c098b893944a'] = 'Unmöglich, die Handlung durchzuführen'; +$_MODULE['<{dejala}prestashop>dejala_6bd82dd0c6115429b03dd84828d6ccb2'] = 'Bitte wählen Sie ein anderes Login'; +$_MODULE['<{dejala}prestashop>dejala_0aec12d0e7c8784012ee74606648d625'] = 'Dejala Server ist von Ihrem Prestashop Server nicht erreichbar. Dies ist sicherlich auf eine Begrenzung von Ihrem Hosting-Provider zurückzuführen. Bitte kontaktieren Sie seinen technischen Support und fragen Sie, ob Ihr Server autorisiert ist, ausgehende HTTP-Verbindungen zu initiieren'; +$_MODULE['<{dejala}prestashop>dejala_f46fe05842135a72df96c3409cf00683'] = 'Fehler beim Aktualisieren des Standorts'; +$_MODULE['<{dejala}prestashop>dejala_2f63af6e20f182573774b785515ccb95'] = 'Fehler beim Aktualisieren der Kontakte'; +$_MODULE['<{dejala}prestashop>dejala_3a29c6eb6abefd3d629290756168d892'] = 'Fehler beim Aktualisieren der Prozesse'; +$_MODULE['<{dejala}prestashop>dejala_5f010efe1c8e6cb195205cbf864044aa'] = 'Fehler beim Aktualisieren der Produkte'; +$_MODULE['<{dejala}prestashop>dejala_004ac360e91b3dcf50a19a0fd09e3826'] = 'Sie müssen mindestens eine E-Mail-Adresse angeben, um Dejalas Sichtbarkeit zu begrenzen'; +$_MODULE['<{dejala}prestashop>dejala_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{dejala}prestashop>dejala_dfa53d8241c9f6908e669371b50e95f3'] = 'Dieses Modul benötigt die PHP-Erweiterung cURL, um ordnungsgemäß zu funktionieren. Bitte installieren Sie zuerst die PHP-Erweiterung \"cURL\"'; +$_MODULE['<{dejala}prestashop>dejala_4c7d16a1e83bcbfd9b33e95f8e90a625'] = 'Ein Fehler trat während der Authentifizierung Ihres Kontos auf Dejala.com auf. Dies kann an einem vorübergehenden Netzwerk- oder Plattform-Problem liegen. Bitte versuchen Sie es später noch einmal oder kontaktieren Sie Dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_94939d114a8c65173b70b6e01aad11c0'] = 'Ein Fehler ist beim Laden aufgetreten, bitte versuchen Sie es später noch einmal oder kontaktieren Sie Dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_41d211dd68bf0f87cf3181b0c8dac6e7'] = 'Dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_3d8764621d6076807b0d60cfcadb7213'] = 'Wenn Sie es wünschen... Kradmelder'; +$_MODULE['<{dejala}prestashop>dejala_627db4c965627fb7f03682dbbc43a4a1'] = 'Ich wähle mein Lieferdatum, wenn mein Produkt verfügbar ist'; +$_MODULE['<{dejala}prestashop>dejala_07e9ea0147aee652244a280da00efb5a'] = 'Lieferdatum ausgewählt'; +$_MODULE['<{dejala}prestashop>dejala_47a4dfe5ab79feb7884fa57786ea587c'] = 'ab'; +$_MODULE['<{dejala}prestashop>dejala_ba93cc89ba75ee6e74699a49a69c0600'] = 'Lieferdatum noch nicht vom Kunden gewählt'; +$_MODULE['<{dejala}prestashop>dejala_a240fa27925a635b08dc28c9e4f9216d'] = 'Bestellen'; +$_MODULE['<{dejala}prestashop>dejala_296a91ebe13e861efa9bd0f74a927353'] = 'Bestellung an Dejala gesandt'; +$_MODULE['<{dejala}prestashop>dejala_carrier_21034ae6d01a83e702839a72ba8a77b0'] = '(zzgl. MwSt.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_1f87346a16cf80c372065de3c54c86d9'] = '(Inkl. Mwst.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_e7a6ca4e744870d455a57b644f696457'] = 'Kostenlos!'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_21034ae6d01a83e702839a72ba8a77b0'] = '(zzgl. MwSt.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_1f87346a16cf80c372065de3c54c86d9'] = '(Inkl. Mwst.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_e7a6ca4e744870d455a57b644f696457'] = 'Kostenlos!'; +$_MODULE['<{dejala}prestashop>dejala_contacts_a766dcf63862aaaa1625a45169aeb37a'] = 'Shop-Besitzer'; +$_MODULE['<{dejala}prestashop>dejala_contacts_4e140ba723a03baa6948340bf90e2ef6'] = 'Name:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_d2cacc542d8dd31bd89f8defed1b55ad'] = 'Vorname:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_673ae02fffb72f0fe68a66f096a01347'] = 'Telefon:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_7a31464d87d555a1d5a7d2afdeb64d4e'] = 'mobil:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_01401fe9a93df81d28637e5218597b76'] = 'E-Mail:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_7e2121a0b71ccc33c5eeaf11999fdbcd'] = 'Kontakt Lagerkontrolle'; +$_MODULE['<{dejala}prestashop>dejala_contacts_23e44d356bfc0d17f904cb743b4d247c'] = 'Kontakt Verwaltung'; +$_MODULE['<{dejala}prestashop>dejala_contacts_527a0a71d5684695421ec3375ec6dba8'] = 'Konakt Webseitenwartung'; +$_MODULE['<{dejala}prestashop>dejala_contacts_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_9c8a7900448628ee2978be9a3945d148'] = 'Ihr Guthaben'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b0ee4c529eda15bdecda8bf189a3c813'] = 'Ihr virtuelles Guthaben (zu Testzwecken)'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_defcb35db6f9bdac29b888bfc07e6386'] = 'Euro'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_c2b55c1a6a9880bf1d7cba1914a6da56'] = 'Stocken Sie Ihr Konto auf'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_642c4a47922246182590d4f3c8304f35'] = 'Liste der letzten Lieferungen'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_01abfc750a0c942167651c40d088531d'] = 'Nr.'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_67d5168b4f2b5424a3d118ea9ef99372'] = 'Erstellung'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_d79cf3f429596f77db95c65074663a54'] = 'Bestell-ID'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2a033d36697bb24bfc7ece05545d268e'] = 'Tracking_Nummer'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b021df6aac4654c454f46c77646e745f'] = 'Label'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_3601146c4e948c32b6424d2c0a7f0118'] = 'Preis'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_ec53a8c4f07baed5d8825072c89799be'] = 'Status'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Versand'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Beschreibung'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2ca8d70baf21b18878843c02a086e46c'] = 'In'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2510c39011c5be704182423e3a695e91'] = 'h'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_d98a07f84921b24ee30f86fd8cd85c3c'] = 'von'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_01b6e20344b68835c5ed1ddedf20d531'] = 'an'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_427c7fb2385f610d26ea90fff86f9a84'] = 'CSV-Export'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_5da618e8e4b89c66fe86e32cdafde142'] = 'Von'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_e12167aa0a7698e6ebc92b4ce3909b53'] = 'An'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_a60852f204ed8028c1c58808b746d115'] = 'OK'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_8424d087ffe39bb2ee8db173c7e07ba5'] = 'Erstell_datum'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_d79cf3f429596f77db95c65074663a54'] = 'Bestell-ID'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_2a033d36697bb24bfc7ece05545d268e'] = 'Tracking_Nummer'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_ac27812104f966f43d3a60f37a869338'] = 'short_label'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_78a5eb43deef9a7b5b9ce157b9d52ac4'] = 'Preis'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_9acb44549b41563697bb490144ec6258'] = 'Status'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_1e6e6626b6e59276b14112ebc34c5d49'] = 'Versand_datum'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_c20456384feb648b4692b700ec570d42'] = 'Zeitlimit'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_5c5c8fc67b523e638e0a904d61651f2d'] = 'Versand_start'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_8e659923776b8706dbf4636c408e987c'] = 'Versand-ende'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_ba402b48292a61e4d82f85eeaa0904dc'] = 'Versand_datum'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_7c7f9f48d29519e8cb47ac606a431a65'] = 'Versand_Zeit'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_617283f39e91b6ead659cef3c722cabc'] = 'Lieferpräferenzen'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_11d783488db0c358bd9077a2e1a250e7'] = 'Versand vorschlagen '; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_ffe181130430aff6386df37df36347f8'] = 'sofort'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_a3cb1f2ebeda6fa36b27598f1d096f60'] = 'einen halben Tag'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_849490640e65410418220e5c179a1477'] = 'einen Tag'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_44fdec47036f482b68b748f9d786801b'] = 'Tage'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_6749e3e07aeb12081dc32e581ffcf463'] = 'nach Bestellung'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_48b4a9d141bcbb3911caa5caf4b750b2'] = 'Anzeige'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_7877adcb96eb8221c075f0008093bbf7'] = 'Termine'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_b4f86cbc11cb9565374c08c61372f3ad'] = 'Tage in der Benutzerroberfläche für die Zeitspanne'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_44a33a70398318da91b789b33152dafa'] = 'Dejala aktiv halten, wenn Warenkorb nicht auf Lager'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_767cd99c2f2b9fb9e5aa531c37b45f87'] = 'Ermöglicht Kunden Dejala zu wählen, auch wenn ein Produkt nicht auf Lager ist (Der Kunde wählt den Liefertermin, wenn die Bestellung zur Verfügung steht)'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{dejala}prestashop>dejala_header_c45abd6f2b5f3b3a954c97f008ccb52c'] = 'Versenden Sie Ihre Bestellungen per Kurier mit'; +$_MODULE['<{dejala}prestashop>dejala_header_20e846b603a0b7f1c00b1fc457308fb7'] = 'DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_home_21e71170be5450c6380d7a9fc0ba51c3'] = 'Neu auf Dejala.fr?'; +$_MODULE['<{dejala}prestashop>dejala_home_07965cce4ec6247bd57783dff0af1657'] = 'Ihr Shop-Name:'; +$_MODULE['<{dejala}prestashop>dejala_home_558f162b01a3d6d31865a1ca91a03d57'] = 'Wählen Sie Ihr Land:'; +$_MODULE['<{dejala}prestashop>dejala_home_0309a6c666a7a803fdb9db95de71cf01'] = 'Frankreich'; +$_MODULE['<{dejala}prestashop>dejala_home_907eba32d950bfab68227fd7ea22999b'] = 'Spanien'; +$_MODULE['<{dejala}prestashop>dejala_home_a999205c014634072764fe3fadc4f4ca'] = 'Wählen Sie Ihr Login:'; +$_MODULE['<{dejala}prestashop>dejala_home_a7e4228de9b12575b0cd88c4cf0f54f9'] = 'Wählen Sie Ihr Kennwort:'; +$_MODULE['<{dejala}prestashop>dejala_home_0ba7583639a274c434bbe6ef797115a4'] = 'Registrieren'; +$_MODULE['<{dejala}prestashop>dejala_home_72429bbc9acf8e6fcf6132ac1fa20d57'] = 'Ich habe bereits ein Konto für meinen Shop:'; +$_MODULE['<{dejala}prestashop>dejala_home_051672911a3f1f05efba78a553ef6fe2'] = 'Anmeldung:'; +$_MODULE['<{dejala}prestashop>dejala_home_b341a59d5636ed3d6a819137495b08a0'] = 'Kennwort:'; +$_MODULE['<{dejala}prestashop>dejala_home_e5b47edd743751a81819b7f421639303'] = 'Log-in'; +$_MODULE['<{dejala}prestashop>dejala_home_853fe2c3719fab6d1dde555eb536f649'] = 'Dejala.fr'; +$_MODULE['<{dejala}prestashop>dejala_home_02d222897fd57cbc8154be7b2c41e2ff'] = 'Zur Erinnerung:'; +$_MODULE['<{dejala}prestashop>dejala_home_3a40880c274dd353056ce584940d1ca8'] = 'Der Name Ihres Shops ist'; +$_MODULE['<{dejala}prestashop>dejala_home_55724d105b50b04063a21fba83236de6'] = 'Ihr Login ist'; +$_MODULE['<{dejala}prestashop>dejala_home_bbb658f348426b60b3395d5357225112'] = 'Sie sind auf der'; +$_MODULE['<{dejala}prestashop>dejala_home_c8ab370eeab3cf4011e25fa953031e77'] = 'Testplattform'; +$_MODULE['<{dejala}prestashop>dejala_home_68279960d4eaab19115d276486e1e1d7'] = 'Betriebsplattform'; +$_MODULE['<{dejala}prestashop>dejala_home_64baa4dba37ddc4207a777ac53565f06'] = 'Zum Test-Modus wechseln '; +$_MODULE['<{dejala}prestashop>dejala_home_a0802ed7a4e243cc01699e44e0b0b33b'] = 'Zum Betriebsmodus wechseln '; +$_MODULE['<{dejala}prestashop>dejala_home_104cdbe9fcaa62064ecc718b647c2929'] = 'Ihre Bitte um Echtzeitbetrieb wird bearbeitet: Dejala.fr wird Sie kontaktieren, um Ihre Registrierung abzuschließen.'; +$_MODULE['<{dejala}prestashop>dejala_home_1ccd621bb658777957a0c0ae95b97fc6'] = 'Echtzeitbetrieb: bitten Sie Dejala um Erstellung Ihres Betriebskontos'; +$_MODULE['<{dejala}prestashop>dejala_home_9c8a7900448628ee2978be9a3945d148'] = 'Ihr Guthaben'; +$_MODULE['<{dejala}prestashop>dejala_home_b0ee4c529eda15bdecda8bf189a3c813'] = 'Ihr virtuelles Guthaben (zu Testzwecken)'; +$_MODULE['<{dejala}prestashop>dejala_home_defcb35db6f9bdac29b888bfc07e6386'] = 'Euro'; +$_MODULE['<{dejala}prestashop>dejala_home_c2b55c1a6a9880bf1d7cba1914a6da56'] = 'Stocken Sie Ihr Konto auf'; +$_MODULE['<{dejala}prestashop>dejala_home_d33b3ef83df48e14035b6927a27a6824'] = 'Dejala IST FÜR KEINEN Nutzer sichtbar'; +$_MODULE['<{dejala}prestashop>dejala_home_8ce5717d0efdee714d5c44eb72559943'] = 'Dejala IST FÜR ALLE Nutzer sichtbar'; +$_MODULE['<{dejala}prestashop>dejala_home_97f9bae265c399ce4781878d46a5a733'] = 'Dejala IST NUR für folgende Nutzer sichtbar'; +$_MODULE['<{dejala}prestashop>dejala_home_66495952bdab30f6bdc92e318d4f36a6'] = '(Z.B.: a@foo.com, b@bar.com)'; +$_MODULE['<{dejala}prestashop>dejala_home_e49df857f0f92d5dd2f73b9fa54d7308'] = 'Aktualisieren Sie die Sichtbarkeit von Dejala '; +$_MODULE['<{dejala}prestashop>dejala_location_ce9142ea2df85cf8ea4dfda7164e7dcf'] = 'Bitte geben Sie die Adresse Ihres Lagers an'; +$_MODULE['<{dejala}prestashop>dejala_location_c58b3ccfae7d8991a1bdf33f275d6007'] = '(Readonly)'; +$_MODULE['<{dejala}prestashop>dejala_location_20dfc4f904ba3c650a578c41f87e7053'] = 'Suchen'; +$_MODULE['<{dejala}prestashop>dejala_location_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Firma'; +$_MODULE['<{dejala}prestashop>dejala_location_dd7bf230fde8d4836917806aff6a6b27'] = 'Adresse'; +$_MODULE['<{dejala}prestashop>dejala_location_783cb853aae6984e51583b3bb80c09d2'] = 'Adresse (2)'; +$_MODULE['<{dejala}prestashop>dejala_location_9b514b51d03075005814a33edc74c958'] = 'Postleitzahl'; +$_MODULE['<{dejala}prestashop>dejala_location_57d056ed0984166336b7879c2af3657f'] = 'Stadt'; +$_MODULE['<{dejala}prestashop>dejala_location_bcc254b55c4a1babdf1dcb82c207506b'] = 'Telefon'; +$_MODULE['<{dejala}prestashop>dejala_location_4e186c431f7c016c761c722debb9768e'] = 'mobil'; +$_MODULE['<{dejala}prestashop>dejala_location_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Kommentare'; +$_MODULE['<{dejala}prestashop>dejala_location_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren '; +$_MODULE['<{dejala}prestashop>dejala_menu_8cf04a9734132302f96da8e113e80ce5'] = 'Startseite'; +$_MODULE['<{dejala}prestashop>dejala_menu_ce5bf551379459c1c61d2a204061c455'] = 'Ort'; +$_MODULE['<{dejala}prestashop>dejala_menu_9aa698f602b1e5694855cee73a683488'] = 'Kontakte'; +$_MODULE['<{dejala}prestashop>dejala_menu_77ea79b4b2638f146bf02ea6dc076006'] = 'Prozesse'; +$_MODULE['<{dejala}prestashop>dejala_menu_3eb0f1d14d6ec438d91fcfdab94fc1ca'] = 'Lieferoptionen'; +$_MODULE['<{dejala}prestashop>dejala_menu_e16dd6e118732c5d1586d6aba0b62f3a'] = 'Preise'; +$_MODULE['<{dejala}prestashop>dejala_menu_9bbd45bad55cfc620803907f2d8a0217'] = 'Abrechnung'; +$_MODULE['<{dejala}prestashop>dejala_menu_36d5423bb12a6d74d1d0f0ba09ef47cb'] = 'Technische Optionen'; +$_MODULE['<{dejala}prestashop>dejala_menu_35cf95ca41b6d074cfaeac16b0e0906c'] = 'DEJALA PRO'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_845398bc903ec28114a5f9874d83936b'] = 'Lager ist geöffnet'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_2084c04f7a380a68b653e5fc82d352f0'] = 'Von'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_7fc56270e7a70fa81a5935b72eacbe29'] = 'Bis'; +$_MODULE['<{dejala}prestashop>dejala_processes_237527ad3e0c9d87f072f2ac3a873dc8'] = 'Bitte geben Sie die Prozesse für eine ordnungsgemäße Handhabung der Lieferung an'; +$_MODULE['<{dejala}prestashop>dejala_processes_0f516eb68a85aae932001976c51dee2f'] = 'Sie können die Standardprozesse frei an Ihre Geschäftsprozesse anpassen'; +$_MODULE['<{dejala}prestashop>dejala_processes_dbfdb39c2251ff72f42f7078ab347611'] = 'Falsche Adresse'; +$_MODULE['<{dejala}prestashop>dejala_processes_b1da17cfc7c9a051fe4ce45bf1dd1ace'] = 'Empfänger abwesend'; +$_MODULE['<{dejala}prestashop>dejala_processes_3ab0370c6e7c3d0ea1cd540e7afacc9a'] = 'Lieferung abgelehnt'; +$_MODULE['<{dejala}prestashop>dejala_processes_138a10902b1fec08bcf2d9f5a6f4b02b'] = 'Liefer-Verpackung'; +$_MODULE['<{dejala}prestashop>dejala_processes_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren '; +$_MODULE['<{dejala}prestashop>dejala_products_aa83582f6ce84345c97815de714e6ebd'] = 'Bitte stellen Sie Ihre Liefermarge ein '; +$_MODULE['<{dejala}prestashop>dejala_products_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{dejala}prestashop>dejala_products_26160d42b371fb091c142cb8cfa09c34'] = 'Kaufpreis'; +$_MODULE['<{dejala}prestashop>dejala_products_f8ca05a1d72f37501747657deecdd15c'] = 'Marge inkl. MwSt.'; +$_MODULE['<{dejala}prestashop>dejala_products_e6f254c2f6e55725e99e1e6dfd6d9caa'] = 'Kundenpreis'; +$_MODULE['<{dejala}prestashop>dejala_products_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Beschreibung'; +$_MODULE['<{dejala}prestashop>dejala_products_1cdad1a5f8e5d09be270415e44c0f039'] = 'Kaufen zzgl. MwSt. '; +$_MODULE['<{dejala}prestashop>dejala_products_ecef91ba37ffc5f5294ea50efee7c6a2'] = 'Kaufen inkl. MwSt.'; +$_MODULE['<{dejala}prestashop>dejala_products_765a24c102d9a0b03eb03c77e90a9144'] = 'Verkaufen zzgl. MwSt. '; +$_MODULE['<{dejala}prestashop>dejala_products_8588719c33b27bd80ae45cc533117c00'] = 'Verkaufen inkl. MwSt.'; +$_MODULE['<{dejala}prestashop>dejala_products_efeb369cccbd560588a756610865664c'] = 'In'; +$_MODULE['<{dejala}prestashop>dejala_products_2510c39011c5be704182423e3a695e91'] = 'h'; +$_MODULE['<{dejala}prestashop>dejala_products_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_b44c4d973c20b84bad66d243b215ef37'] = 'Triggerstatusliste'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_a296002220093a4833752a3cf94f07d0'] = 'Liste der Status, die dejala.fr triggern'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren '; +$_MODULE['<{dejala}prestashop>dejala_timetable_193993f964d2d4df4b1484227c1626b6'] = 'Wählen Sie Ihren Liefertag'; +$_MODULE['<{dejala}prestashop>dejala_timetable_26903e0f192163f4a0957c0b185edf71'] = 'Wählen Sie Ihre Lieferzeitspanne'; diff --git a/modules/dejala/dejala.php b/modules/dejala/dejala.php new file mode 100755 index 00000000..8a3bb03e --- /dev/null +++ b/modules/dejala/dejala.php @@ -0,0 +1,1384 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 8783 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) + exit; + +require_once(_PS_MODULE_DIR_ . "dejala/dejalaconfig.php"); +require_once(_PS_MODULE_DIR_ . "dejala/dejalautils.php"); +require_once(_PS_MODULE_DIR_ . "dejala/dejalacarrierutils.php"); +require_once(_PS_MODULE_DIR_ . "dejala/dejalacart.php"); +require_once(_PS_MODULE_DIR_ . "dejala/calendarutils.php"); + + +/** + * This module enables the interractions with dejala.com carrier services +**/ +class Dejala extends CarrierModule +{ + const INSTALL_SQL_FILE = 'install.sql'; + public $DEJALA_DEBUG = FALSE; + public $dejalaConfig; + public $id_lang ; + private $wday_labels ; + private static $INSTANCE = NULL ; + + public static function getInstance() + { + if (!self::$INSTANCE) + { + self::$INSTANCE = new Dejala(); + } + return self::$INSTANCE; + } + + public function __construct() + { + global $cookie ; + + //TODO Iso code of countries where the module can be used, if none module available for all countries + $this->limited_countries = array('fr'); + $this->name = 'dejala'; + $this->tab = 'shipping_logistics'; + $this->version = 1.4; + $this->internal_version = '1.3'; + $this->id_lang = (!isset($cookie) OR !is_object($cookie)) ? (int)(Configuration::get('PS_LANG_DEFAULT')) : (int)($cookie->id_lang); + $this->wday_labels = array($this->l('Sunday'), $this->l('Monday'), $this->l('Tuesday'), $this->l('Wednesday'), $this->l('Thursday'), $this->l('Friday'), $this->l('Saturday')); + + parent::__construct(); + + // The parent construct is required for translations + $this->page = basename(__FILE__, '.php'); + $this->displayName = $this->l('Dejala.com : Courier delivery'); + $this->description = $this->l('Lets Dejala.com handle your deliveries by courier'); + + // load configuration only if installed + if ($this->id) + { + if (true !== extension_loaded('curl')) + { + $this->warning = $this->l('The Dejala module requires php extension cURL to function properly. Please install the php extension "cURL"'); + } + + $this->dejalaConfig = new DejalaConfig(); + $this->dejalaConfig->loadConfig(); + + // Update table schema + if (!isset($this->dejalaConfig->internal_version) || $this->dejalaConfig->internal_version < $this->internal_version) + { + $this->unregisterHook('cart') ; + $res = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'dejala_cart` LIMIT 1') ; + if ($res) + { + if (!array_key_exists('cart_date_upd', (int)$res[0])) + { + Db::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'dejala_cart` ADD COLUMN cart_date_upd DATETIME DEFAULT 0;'); + } + if (!array_key_exists('delivery_price', (int)$res[0])) + { + Db::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'dejala_cart` ADD COLUMN delivery_price FLOAT DEFAULT NULL;'); + } + } + $this->dejalaConfig->internal_version = $this->internal_version ; + $this->dejalaConfig->saveConfig() ; + } + } + } + + + /** + * install dejala module + */ + public function install() + { + if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) + return (false); + elseif (!$sql = file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) + return (false); + + $sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql); + $sql = preg_split("/;\s*[\r\n]+/",$sql); + + foreach ($sql as $query) + if (!empty($query)) + { + if (!Db::getInstance()->Execute(trim($query))) + return (false); + } + + if (parent::install() == false + OR $this->registerHook('updateOrderStatus') == false + OR $this->registerHook('extraCarrier') == false + OR $this->registerHook('processCarrier') == false) + return (false); + + + $this->dejalaConfig = new DejalaConfig(); + if (!$this->dejalaConfig->saveConfig()) + return (false); + + DejalaCarrierUtils::createDejalaCarrier($this->dejalaConfig) ; + return (true); + } + + public function uninstall() + { + + // If Dejala is default carrier, try to set another one as default + $djlCarrier = DejalaCarrierUtils::getCarrierByName($this->name) ; + if (Configuration::get('PS_CARRIER_DEFAULT') == (int)($djlCarrier->id)) + { + $carriers = Carrier::getCarriers($cookie->id_lang, true, false, false, NULL, Carrier::PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE); + foreach($carriers as $carrier) + { + if ($carrier['active'] AND !$carrier['deleted'] AND ($carrier['external_module_name'] != $this->name)) + { + Configuration::updateValue('PS_CARRIER_DEFAULT', (int)$carrier['id_carrier']); + break ; + } + } + } + $djlCarrier->deleted = 1; + if (!$djlCarrier->update()) return false; + + $this->dejalaConfig->uninstall(); + if (!parent::uninstall() OR + !$this->unregisterHook('updateOrderStatus') OR + !$this->unregisterHook('extraCarrier') OR + !$this->unregisterHook('processCarrier')) + return false; + + return true; + } + + + /** + * Data validation for module configuration + **/ + public function _postValidation() + { + $errors = array(); + + $method = Tools::getValue('method'); + if ($method == 'signin') + { + if (empty($_POST['login'])) + $errors[] = $this->l('login is required.'); + if (empty($_POST['password'])) + $errors[] = $this->l('password is required.'); + if (empty($_POST['country'])) + $errors[] = $this->l('country is required.'); + } + elseif ($method == 'register') + { + if (empty($_POST['login'])) + $errors[] = $this->l('login is required.'); + if (empty($_POST['login']) OR !Validate::isEmail($_POST['login'])) + $errors[] = $this->l('login must be a valid e-mail address.'); + if (empty($_POST['password'])) + $errors[] = $this->l('password is required.'); + if (empty($_POST['store_name'])) + $errors[] = $this->l('Shop name is required.'); + if (empty($_POST['country'])) + $errors[] = $this->l('country is required.'); + } + elseif ($method == 'products') + { + $products = array(); + $djlUtil = new DejalaUtils(); + $responseArray = $djlUtil->getStoreProducts($this->dejalaConfig, $products); + if ('200' != $responseArray['status']) + $products = array(); + foreach ($_POST as $key=>$value) + { + if (0 === strpos($key, 'margin_')) + { + $this->mylog( "key=" . substr($key, 7) ); + $productID = (int)(substr($key, 7)); + if ( is_null($_POST[$key]) || (0 == strlen($_POST[$key])) ) + $_POST[$key] = 0; + $_POST[$key] = str_replace(',', '.', $_POST[$key]); + $_POST[$key] = str_replace(' ', '', $_POST[$key]); + + if (!Validate::isFloat($_POST[$key])) + { + $errors[] = $value . ' ' . $this->l('is not a valid margin.'); + } + $margin = (float)($_POST[$key]); + foreach ($products as $l_product) + { + if ((int)$l_product['id'] == (int)$productID) + { + $product = (int)$l_product; + break; + } + } + if ($product) + { + $vat_factor = (1+ ($product['vat'] / 100)); + $public_price = round($product['price']*$vat_factor, 2); + $public_price = round($public_price + $margin, 2); + if ($public_price < 0) + $errors[] = $value . ' ' . $this->l('is not a valid margin.'); + } + } + } + } + return ($errors); + } + + /** + * Module configuration request processing + **/ + public function _postProcess() + { + global $smarty; + + $errors = array(); + $method = Tools::getValue('method'); + if ($method == 'signin') + { + $djlUtil = new DejalaUtils(); + $this->dejalaConfig->mode = 'TEST'; + $this->dejalaConfig->login = Tools::getValue('login'); + $this->dejalaConfig->password = Tools::getValue('password'); + $this->dejalaConfig->country = Tools::getValue('country'); + $this->dejalaConfig->serviceURL = str_replace('.fr', '.'.$this->dejalaConfig->country, $this->dejalaConfig->serviceURL); + $this->dejalaConfig->sandboxServiceURL = str_replace('.fr', '.'.$this->dejalaConfig->country, $this->dejalaConfig->sandboxServiceURL); + $storeAttr = array(); + $response = $djlUtil->ping($this->dejalaConfig, 'TEST'); + if ($response['status'] == 200) + { + $this->dejalaConfig->saveConfig(); + } + else + { + if ($response['status'] == 401) + $errors[] = $this->l('An error occurred while authenticating your account on Dejala.com. Your credentials were not recognized.'); + else + $errors[] = $this->l('Unable to process the action.') . '(' . $response['status'] . ')'; + + $this->dejalaConfig->login = null; + $this->dejalaConfig->password = null; + } + } + elseif ($method == 'register') + { + $djlUtil = new DejalaUtils(); + $this->dejalaConfig->mode = 'TEST'; + $this->dejalaConfig->login = Tools::getValue('login'); + $this->dejalaConfig->password = Tools::getValue('password'); + $this->dejalaConfig->country = Tools::getValue('country'); + $this->dejalaConfig->serviceURL = str_replace('.fr', '.'.$this->dejalaConfig->country, $this->dejalaConfig->serviceURL); + $this->dejalaConfig->sandboxServiceURL = str_replace('.fr', '.'.$this->dejalaConfig->country, $this->dejalaConfig->sandboxServiceURL); + $this->dejalaConfig->storeUrl = Dejala::getHttpHost(true, true) ; + $response = $djlUtil->createInstantStore($this->dejalaConfig, Tools::getValue('store_name')); + if ($response['status'] == 201) + $this->dejalaConfig->saveConfig(); + elseif ($response['status'] == 409) + $errors[] = $this->l('Please choose another login'); + elseif ($response['status'] == 403) + $errors[] = $this->l('Dejala Server cannot be reached by your Prestashop server. This is most likely due to a limit set by your hosting provider. Please contact their technical support and ask if your server is authorized to initiate outbound HTTP connections.'); + else + $errors[] = $this->l('Unable to process the action.') . '(' . $response['status'] . ')'; + $this->dejalaConfig->loadConfig(); + } + elseif ($method == 'location') + { + $djlUtil = new DejalaUtils(); + $response = $djlUtil->setStoreLocation($this->dejalaConfig, $_POST); + if ($response['status'] != 200) + $errors[] = $this->l('An error occurred while updating location'); + } + elseif ($method == 'contact') + { + $djlUtil = new DejalaUtils(); + $response = $djlUtil->setStoreContacts($this->dejalaConfig, $_POST); + if ($response['status'] != 200) + $errors[] = $this->l('An error occurred while updating contacts'); + } + elseif ($method == 'processes') + { + $djlUtil = new DejalaUtils(); + $response = $djlUtil->setStoreProcesses($this->dejalaConfig, $_POST); + if ($response['status'] != 200) + $errors[] = $this->l('An error occurred while updating processes'); + } + elseif ($method == 'products') { + $djlUtil = new DejalaUtils(); + $response = $djlUtil->setStoreProducts($this->dejalaConfig, $_POST); + if ($response['status'] != 200) + $errors[] = $this->l('An error occurred while updating products'); + } + elseif ($method == 'technical_options') + { + $maxSatuses = (int)$_POST['status_max']; + if ($maxSatuses > 30) + $maxSatuses = 30; + $selectedTriggers=array(); + for ($i = 0; $i < $maxSatuses; $i++) + { + $l_val = Tools::getValue('status_'.$i); + if ($l_val) + $selectedTriggers[] = $l_val; + } + $trigerringStatuses = implode(',', $selectedTriggers); + $this->dejalaConfig->trigerringStatuses = htmlentities($trigerringStatuses, ENT_COMPAT, 'UTF-8'); + $this->dejalaConfig->saveConfig(); + $this->dejalaConfig->loadConfig(); + } + elseif ($method == 'delivery_options') + { + $djlUtil = new DejalaUtils(); + $response = $djlUtil->setStoreCalendar($this->dejalaConfig, $_POST); + if ($response['status'] != 200) + $errors[] = $this->l('An error occurred while updating products'); + + $m_attributes['nb_days_displayed'] = htmlentities(Tools::getValue('nb_days'), ENT_COMPAT, 'UTF-8'); + $m_attributes['delivery_delay'] = htmlentities(Tools::getValue('delivery_delay'), ENT_COMPAT, 'UTF-8'); + $m_attributes['delivery_partial'] = htmlentities(Tools::getValue('delivery_partial'), ENT_COMPAT, 'UTF-8'); + + $response = $djlUtil->setStoreAttributes($this->dejalaConfig, $m_attributes); + if ($response['status'] != 200) + $errors[] = $this->l('An error occurred while updating products'); + + } + elseif ($method == 'golive') + { + $djlUtil = new DejalaUtils(); + $response = $djlUtil->goLive($this->dejalaConfig, $_POST); + } + elseif ($method == 'switchMode') + { + $l_mode = Tools::getValue('mode'); + if ( ('PROD' == $l_mode) || ('TEST' == $l_mode) ) + { + $this->dejalaConfig->mode = $l_mode; + $this->dejalaConfig->saveConfig(); + } + } + elseif ($method == 'switchActive') + { + + $l_active = Tools::getValue('visibility_status'); + + if (($l_active == "visible") || ($l_active == "invisible")) + { + $this->dejalaConfig->visibility_status = $l_active; + $this->dejalaConfig->saveConfig(); + } + if ($l_active == "visible_limited") + { + $l_active_list = Tools::getValue('visible_users_list'); + if ($l_active_list == "") + { + $this->dejalaConfig->visible_users_list = ""; + $this->dejalaConfig->saveConfig(); + + $errors[] = $this->l('You must provide at least one email address to restrict Dejala\'s visibility.'); + } + else + { + $this->dejalaConfig->visibility_status = $l_active; + $this->dejalaConfig->visible_users_list = $l_active_list; + $this->dejalaConfig->saveConfig(); + } + } + } + else + $errors[] = $this->l('Unable to process the action.'); + + return ($errors); + } + + public function getContent() + { + global $smarty; + + $smarty->assign('country', $this->dejalaConfig->country); + $output = $this->display(__FILE__, 'dejala_header.tpl'); + if (!empty($_POST)) + { + $errors = $this->_postValidation(); + if (!count($errors)) + $errors = $this->_postProcess(); + if (count($errors)) + foreach ($errors AS $err) + $output .= ''.$text.''; + } + + public function hookProcessCarrier($params) + { + // FO: Temporary. Necessary to go around the product's cart re-instanciation bug. + global $cart ; + + $cartParams = $params['cart']; + $this->hooklog("processCarrier", $params) ; + // Process the cart for storage in dejala_cart. + $errors = array(); + $dejalaCarrierID = (int)Tools::getValue('dejala_id_carrier'); + $carrierID = (int)Tools::getValue('id_carrier'); + $dejalaProductID = (int)Tools::getValue('dejala_id_product'); + + if ( !empty($dejalaCarrierID) && !empty($carrierID) && ((int)($dejalaCarrierID) == (int)($carrierID)) ) + { + $id_cart = (int)($cartParams->id); + + $product = $this->getDejalaProduct($cartParams, $dejalaProductID) ; + + $timelimit = 10; + if (isset($product['timelimit'])) + $timelimit = (int)($product['timelimit']); + + /* manage shipping preferences */ + $date_shipping = 'NULL'; + if (isset($_POST['shipping_day']) AND !empty($_POST['shipping_day']) AND (10 <= strlen($_POST['shipping_day'])) ) + { + $shippingHour = (int)($_POST['shipping_hour']); + $shipping_day = $_POST['shipping_day']; + $ship_year = (int)(substr($shipping_day, 0, 4)); + $ship_month = (int)(substr($shipping_day, 5, 2)); + $ship_day = (int)(substr($shipping_day, 8, 2)); + $shippingTime = mktime($shippingHour, 0, 0, $ship_month, $ship_day, $ship_year); + // check that delivery date is in the future (5 min delay) + if ($shippingTime > time() - 5 * 60) + $date_shipping = $shippingTime; + } + + $djlCart = $this->getDejalaCart($cartParams->id) ; + $djlCart->shipping_date = $date_shipping; + $djlCart->id_dejala_product = $dejalaProductID; + $djlCart->id_delivery = NULL; + $djlCart->mode = $this->dejalaConfig->mode; + + // Dirty cheat as the cart updates itself right after this. + // This saves one full round trip to the server. + $djlCart->cart_date_upd = date('Y-m-d H:i:s') ; + $djlCart->save() ; + } + + // FO: VERY DIRTY HACK.... Re-assign the global cart to what it was before. + $cart = $cartParams ; + } + + /** + * Keep as a precaution if a hook is still registered + */ + public function hookCart($param) { + return ; + } + + + /** + * Appelé après la modification d'une commande + **/ + public function hookUpdateOrderStatus($params) + { + $this->hooklog("hookUpdateOrderStatus", $params); + // class OrderState + $newOrderStatus = $params["newOrderStatus"]; + $currentOrderStatusID = $newOrderStatus->id; + $this->mylog("newOrderStatus=" . $this->logValue($newOrderStatus)); + $this->mylog("found currentOrderStatusID=" . $currentOrderStatusID); + + $triggeringStatusList = html_entity_decode(Configuration::get('DJL_TRIGERRING_STATUSES'), ENT_COMPAT, 'UTF-8'); + $this->mylog("triggeringStatusList=" . $triggeringStatusList); + $triggeringStatuses = explode(",", $triggeringStatusList); + $orderID = $params["id_order"]; + + if ((NULL !== $orderID) && (TRUE === in_array($currentOrderStatusID, $triggeringStatuses))) + { + $mOrder = new Order($orderID); + $this->placeOrder($mOrder); + } + } + + + public function placeOrder($mOrder) { + $orderID = (int)$mOrder->id; + $this->myLog("placeOrder()"); + $this->myLog("mOrder->id_carrier=".$mOrder->id_carrier); + $mCarrier = new Carrier($mOrder->id_carrier); + $this->myLog("mCarrier->name=".$mCarrier->name); + if ($mCarrier->name != $this->name) + return ; + $this->myLog("placeOrder()"); + + $cartId = $mOrder->id_cart; + $djlCart = $this->getDejalaCart($cartId); + $this->myLog("djlCart->id_delivery=" . $djlCart->id_delivery); + + if (!$djlCart->id_delivery) + { + $this->myLog("id_delivery is not filled"); + $delivery = array(); + $this->getInfoFromOrder($orderID, $delivery); + $this->mylog("Sending delivery=" . $this->logValue($delivery)); + $djlUtil = new DejalaUtils(); + $response = $djlUtil->orderDelivery($this->dejalaConfig, $delivery, $djlCart->mode); + $statusCode = $response['status']; + + $this->mylog("send orderID=" . $orderID); + $this->mylog("sendOrder status_code=" . $statusCode); + $this->mylog("sendOrder response=" . $response['response']); + $this->mylog("sendOrder delivery=" . $this->logValue($delivery, 1)); + // update status after sending... + if ("201" === $statusCode) + { + $this->mylog("updating dejala cart cart_id=" . $cartId); + if (Validate::isUnsignedId($delivery['id'])) + { + $this->mylog("updating dejala cart id_delivery=" . $delivery['id']); + $djlCart->id_delivery = $delivery['id']; + $djlCart->update(); + } + + if (is_null($mOrder->shipping_number) || (0 === strlen($mOrder->shipping_number))) + { + $this->myLog('setting Order->shipping_number to ' . $delivery['tracking_number']); + $mOrder->shipping_number = $delivery['tracking_number']; + $mOrder->save(); + } + + $this->myLog("OK - Order sent to dejala.com"); + } + else + { + // Do nothing : Keep previous status + $this->myLog("NOK - Problem sending Order to dejala.com"); + } + } + } + + public function getInfoFromOrder($orderID, &$delivery) + { + $mOrder = new Order((int)$orderID); + if (NULL !== $mOrder) + { + $mDeliveryAddress = new Address($mOrder->id_address_delivery); + if (NULL !== $mDeliveryAddress) + { + // receiver address information + $delivery["receiver_firstname"]=$mDeliveryAddress->firstname; + $delivery["receiver_name"]=$mDeliveryAddress->lastname; + if ($mDeliveryAddress->company) + $delivery["receiver_company"]=$mDeliveryAddress->company; + $delivery["receiver_address"]=$mDeliveryAddress->address1; + if ($mDeliveryAddress->address2) + $delivery["receiver_address2"]=$mDeliveryAddress->address2; + $delivery["receiver_zipcode"]=$mDeliveryAddress->postcode; + $delivery["receiver_city"]=$mDeliveryAddress->city; + if ($mDeliveryAddress->phone_mobile) + $delivery["receiver_cellphone"]=$mDeliveryAddress->phone_mobile; + if ($mDeliveryAddress->phone) + $delivery["receiver_phone"]=$mDeliveryAddress->phone; + if ($mDeliveryAddress->other) + $delivery["receiver_comments"]=$mDeliveryAddress->other; + } + $delivery["packet_reference"]=$mOrder->id; + + + $id_cart = (int)$mOrder->id_cart; + /* set weight */ + $cart = new Cart($id_cart); + $delivery['weight'] = (float)($cart->getTotalWeight()); + + /* set dejalaProductID and sender_availability = shipping date */ + $djlCart = new DejalaCart($id_cart); + if (!is_null($djlCart) && !is_null($djlCart->id)) + { + $mDejalaProductID = (int)$djlCart->id_dejala_product; + $delivery["product_id"] = (int)($mDejalaProductID); + $mShippingDate = $djlCart->shipping_date; + if ( is_null($mShippingDate) || empty($mShippingDate) ) + $mShippingDate = 0; + + $delivery["shipping_start_utc"]=$mShippingDate; + } + } + return ($delivery); + } + + + public function getOrderShippingCostExternal($cart) + { + return $this->getOrderShippingCost($cart, 0); + } + + public function getOrderShippingCost($cart, $shipping_cost) + { + return $this->getDejalaProductPrice($cart) ; + } + + + private function getDejalaCart($cartId) { + return DejalaCart::getInstance($cartId) ; + } + + private function getDejalaProductPrice($cart) + { + $djlCart = $this->getDejalaCart($cart->id) ; + if (isset($djlCart->delivery_price) && $cart->date_upd <= $djlCart->cart_date_upd) + return $djlCart->delivery_price ; + + $product = $this->getDejalaProduct($cart) ; + return $product["price"] ; + } + + private function getDejalaProduct($cart, $productId = -1) + { + // echo "Date : " . $cart->date_upd . "
'.$text.''; + } + + public function getStoreLocation($dejalaConfig, &$location) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore'; + $postargs = array(); + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $locationNodes=$doc->getElementsByTagName('location'); + if ($locationNodes->length > 0) + { + $locationNode = $locationNodes->item(0); + $nodeList = $locationNode->childNodes; + foreach ($nodeList as $element) + $location[$element->nodeName] = $element->textContent; + } + } + return ($responseArray); + } + + public function getStoreCalendar($dejalaConfig, &$calendar) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/calendar/'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, array(), 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $nodeList = $doc->getElementsByTagName('entry'); + if ($nodeList->length > 0) + { + foreach ($nodeList as $element) + { + $calendarNode = $this->getNodeValue($element); + $calendar['entries'][(int)($calendarNode['weekday'])] = $calendarNode; + } + } + $nodeList = $doc->getElementsByTagName('exception'); + $calendar['exceptions'] = array(); + if ($nodeList->length > 0) + foreach ($nodeList as $element) + $calendar['exceptions'][] = $this->getNodeValue($element); + + } + return ($responseArray); + } + + public function getStoreContacts($dejalaConfig, &$contacts) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore'; + $postargs = array(); + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $contactsNodeList = $doc->getElementsByTagName('contacts'); + if ($contactsNodeList->length > 0) + { + $contactNodes = $contactsNodeList->item(0)->childNodes; + if ($contactNodes) + foreach ($contactNodes as $contactNode) + { + $name = $contactNode->nodeName; + $nodeList = $contactNode->childNodes; + $currentContactNode = array(); + if ($nodeList) + foreach ($nodeList as $element) + $currentContactNode[$element->nodeName] = $element->textContent; + + $contacts[$name] = $currentContactNode; + } + } + } + return ($responseArray); + } + + public function getStoreProducts($dejalaConfig, &$products) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/products'; + $postargs = array(); + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $productsNodeList = $doc->getElementsByTagName('product'); + foreach ($productsNodeList as $productNode) + { + $currentProduct = array(); + $nodeList = $productNode->childNodes; + foreach ($nodeList as $element) + $currentProduct[$element->nodeName] = $element->textContent; + if (count($currentProduct)) + $products[] = $currentProduct; + } + } + + usort($products, array("DejalaUtils", "cmpProducts")); + return ($responseArray); + } + + private static function cmpProducts($a, $b) + { + if ($a['priority'] == $b['priority']) + { + if (($a['price'] == $b['price'])) + return ($a['id'] < $b['id']) ? -1 : 1 ; + + return ($a['price'] < $b['price']) ? -1 : 1 ; + } + return ($a['priority'] < $b['priority']) ? -1 : 1; + } + + public function getStoreQuotation($dejalaConfig, $quotationElements, &$products) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/quotation'; + $postargs = $quotationElements; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $productsNodeList = $doc->getElementsByTagName('product'); + foreach ($productsNodeList as $productNode) + { + $currentProduct = $this->getNodeValue($productNode); + unset($currentProduct['calendar']['entries']['entry']); + $calendarNodeList = $doc->getElementsByTagName('entry'); + foreach ($calendarNodeList as $calendarNode) + { + $calendarEntry = $this->getNodeValue($calendarNode); + $currentProduct['calendar']['entries'][$calendarEntry['weekday']] = $calendarEntry; + } + $exceptionNodeList = $doc->getElementsByTagName('exception'); + $currentProduct['calendar']['exceptions'] = array(); + foreach ($exceptionNodeList as $exceptionNode) + $currentProduct['calendar']['exceptions'][] = $this->getNodeValue($exceptionNode); + + /*$currentProduct = array(); + $nodeList = $productNode->childNodes; + foreach ($nodeList as $element) { + $currentProduct[$element->nodeName] = $element->textContent; + } + */ + if (count($currentProduct)) + $products[] = $currentProduct; + } + } + usort($products, array("DejalaUtils", "cmpProducts")); + return ($responseArray); + } + + public function getStoreAttributes($dejalaConfig, &$store) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore'; + $postargs = array(); + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $fatherNodeList = $doc->getElementsByTagName('store'); + if ($fatherNodeList->length > 0) + { + $childNodes = $fatherNodeList->item(0)->childNodes; + foreach ($childNodes as $childNode) + $store[$childNode->nodeName] = $childNode->textContent; + + } + $nodeList = $doc->getElementsByTagName('attributes'); + $store['attributes'] = array(); + if ($nodeList->length > 0) + $store['attributes'] = $this->getNodeValue($nodeList->item(0)); + + } + return ($responseArray); + } + + public function getStoreProcesses($dejalaConfig, &$processes) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore'; + $postargs = array(); + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $fatherNodeList = $doc->getElementsByTagName('processes'); + if ($fatherNodeList->length > 0) + { + $childNodes = $fatherNodeList->item(0)->childNodes; + foreach ($childNodes as $childNode) + $processes[$childNode->nodeName] = $childNode->textContent; + } + } + return ($responseArray); + } + + public function getStoreProductByID($dejalaConfig, $productID, &$product) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/products/' . $productID; + $postargs = array(); + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $productsNodeList = $doc->getElementsByTagName('product'); + if ($productsNodeList->length > 0) + { + $nodeList = $productsNodeList->item(0)->childNodes; + foreach ($nodeList as $element) + $product[$element->nodeName] = $element->textContent; + } + } + return ($responseArray); + } + + public function getDelivery($dejalaConfig, &$delivery, $mode) + { + if ($mode !== 'PROD') + $serviceURL = $dejalaConfig->getRootServiceURI('TEST') . '/mystore/delivery/' . $delivery['id']; + else + $serviceURL = $dejalaConfig->getRootServiceURI('PROD') . '/mystore/delivery/' . $delivery['id']; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, array(), 'GET', TRUE); + + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $nodeList = $doc->getElementsByTagName('delivery'); + if ($nodeList->length > 0) + $this->getNodeValue($nodeList->item(0), $delivery); + } + return ($responseArray); + } + + /** + * Transforms and returns node into tree structure, use $value array if not null + **/ + function getNodeValue($node, &$value=NULL) + { + if ($node instanceof DOMElement) + { + $childNodes = $node->childNodes; + $onlyText = TRUE; + $text = ''; + foreach ($childNodes as $childNode) + { + if ($childNode instanceof DOMElement) + { + $onlyText = FALSE; + $value[$childNode->nodeName] = $this->getNodeValue($childNode); + } + } + + if ($onlyText) + return ($value=$node->textContent); + } + return ($value); + } + + public function getStoreDeliveries($dejalaConfig, &$deliveries, $args = array()) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/deliveries'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $args, 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $childNodes = $doc->getElementsByTagName('delivery'); + foreach ($childNodes as $childNode) + $deliveries[] = $this->getNodeValue($childNode); + + } + return ($responseArray); + } + + public function setStoreContacts($dejalaConfig, &$contacts) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/contacts'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $contacts, 'PUT', TRUE); + return ($responseArray); + } + public function setStoreLocation($dejalaConfig, &$location) + { + $serviceURL = $dejalaConfig->getRootServiceURI('TEST') . '/mystore/location'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $location, 'PUT', TRUE); + return ($responseArray); + } + public function setStoreProcesses($dejalaConfig, &$processes) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/processes'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $processes, 'PUT', TRUE); + return ($responseArray); + } + public function setStoreProducts($dejalaConfig, &$products) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/products'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $products, 'PUT', TRUE); + return ($responseArray); + } + public function setStoreCalendar($dejalaConfig, &$calendar) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/calendar'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $calendar, 'POST', TRUE); + return ($responseArray); + } + + public function setStoreAttributes($dejalaConfig, &$attributes) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/attributes'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $attributes, 'PUT', TRUE); + return ($responseArray); + } + + /** + * Ask Dejala.fr to create an account for the store on the production platform + **/ + public function goLive($dejalaConfig) + { + $serviceURL = $dejalaConfig->getRootServiceURI('TEST') . '/mystore/golive'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, array(), 'PUT', TRUE); + return ($responseArray); + } + /** + * teste la connexion sur le service Dejala dans le mode (TEST/PROD) + * */ + public function ping($dejalaConfig, $mode) + { + if ($mode !== 'PROD') + $serviceURL = $dejalaConfig->getRootServiceURI('TEST') . '/ping'; + else + $serviceURL = $dejalaConfig->getRootServiceURI('PROD') . '/ping'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, array(), 'GET', TRUE); + return ($responseArray); + } + + public function makeRequest($dejalaConfig, $serviceURL, $args, $method='POST', $needAuth=TRUE) + { + $session = curl_init($serviceURL); + $requestArgs = ""; + foreach ($args as $key => $value) + $requestArgs = $requestArgs . '&' . $key . '=' . urlencode($value); + + if ($method == 'GET') + { + if (strlen($requestArgs) > 0) + $requestArgs = '?' . $requestArgs; + $session = curl_init($serviceURL . $requestArgs); + } + elseif ($method == 'POST') + { + $session = curl_init($serviceURL); + curl_setopt($session, CURLOPT_POST, true); + curl_setopt($session, CURLOPT_POSTFIELDS, $requestArgs); + } + elseif ($method == 'PUT') + { + curl_setopt($session, CURLOPT_CUSTOMREQUEST, 'PUT'); + curl_setopt($session, CURLOPT_POSTFIELDS, $requestArgs); + } + // manage authenth + if ($needAuth) + { + curl_setopt($session, CURLOPT_USERPWD, $dejalaConfig->login.':'.$dejalaConfig->password); + curl_setopt($session, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); + } + // SSL option + if ($dejalaConfig->useSSL === 1) { + curl_setopt($session, CURLOPT_SSL_VERIFYHOST, 0); + curl_setopt($session, CURLOPT_SSL_VERIFYPEER, 0); + curl_setopt($session, CURLOPT_PORT, 443); + } + curl_setopt($session, CURLOPT_HEADER, true); + curl_setopt($session, CURLOPT_RETURNTRANSFER, true); + // Do the POST and then close the session + $response = curl_exec($session); + curl_close($session); + // Get HTTP Status code from the response + $status_code = array(); + preg_match('/\d\d\d/', $response, $status_code); + $responseArray['status']=$status_code[0]; + $responseArray['response']=$response; + return ($responseArray); + } + + + public function mylog($msg) + { + + require_once(dirname(__FILE__) . "/MyLogUtils.php"); + $myFile = dirname(__FILE__) . "/logFile.txt"; + MyLogUtils::myLog($myFile, $msg); + + } + + // get a string of a value for Log purposes + public function logValue($mvalue, $lvl=0) + { + require_once(dirname(__FILE__) . "/MyLogUtils.php"); + return (MyLogUtils::logValue($mvalue, $lvl)); + } + + +} + diff --git a/modules/dejala/deliveries_csv.php b/modules/dejala/deliveries_csv.php new file mode 100755 index 00000000..c806f031 --- /dev/null +++ b/modules/dejala/deliveries_csv.php @@ -0,0 +1,72 @@ +$val) + if (is_array($val)) + $l_array[$key] = doubleQuoteArray($val); + else + $l_array[$key] = ereg_replace('"', '""', $val); + + return ($l_array); + } + + global $smarty; + $dejalaConfig = new DejalaConfig(); + $dejalaConfig->loadConfig(); + + $from = Tools::getValue('datepickerFrom'); + $to = Tools::getValue('datepickerTo'); + if (!is_null($from) && !is_null($to) && (strlen($from) == 10) && (strlen($to) == 10) ) + { + $dateFrom = mktime(0, 0, 1, (int)(substr($from, 3, 2)), (int)(substr($from, 0, 2)), (int)(substr($from, 6, 4))); + $dateTo = mktime(23, 59, 59, (int)(substr($to, 3, 2)), (int)(substr($to, 0, 2)), (int)(substr($to, 6, 4))); + if ($dateFrom > $dateTo) + { + $tmp = $dateTo; + $dateTo = $dateFrom; + $dateFrom = $tmp; + } + + $djlUtil = new DejalaUtils(); + $deliveries = array(); + $responseArray = $djlUtil->getStoreDeliveries($dejalaConfig, $deliveries, array('from_utc'=>$dateFrom, 'to_utc'=>$dateTo)); + if ($responseArray['status']='200') + { + $l_deliveries = array(); + header("Content-type: text/csv"); + header("Content-disposition: attachment; filename=\"deliveries.csv\""); + + foreach ($deliveries as $key=>$delivery) + { + $l_delivery = doubleQuoteArray($delivery); + $l_delivery['price']=ereg_replace('\.', ',', $l_delivery['price']); + $l_delivery['creation_date'] = date('d/m/Y', $delivery['creation_utc']); + $l_delivery['creation_time'] = date('H\hi', $delivery['creation_utc']); + if (isset($delivery['shipping_start_utc'])) + { + $l_delivery['shipping_date'] = date('d/m/Y', $delivery['shipping_start_utc']); + $l_delivery['shipping_start'] = date('H\hi', $delivery['shipping_start_utc']); + $l_delivery['shipping_stop'] = date('H\hi', (int)($delivery['shipping_start_utc']) + 3600*(int)($delivery['timelimit']) ); + } + else + { + $delivery['shipping_date'] = ''; + $delivery['shipping_start'] = ''; + $delivery['shipping_stop'] = ''; + } + if (isset($l_delivery['delivery_utc'])) + { + $l_delivery['delivery_date'] = date('d/m/Y', $delivery['delivery_utc']); + $l_delivery['delivery_time'] = date('H\hi', $delivery['delivery_utc']); + } + $l_deliveries[$key] = $l_delivery; + } + $smarty->assign('deliveries', $l_deliveries); + $smarty->display(dirname(__FILE__).'/dejala_deliveries_csv.tpl'); + } + } diff --git a/modules/dejala/en.php b/modules/dejala/en.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/dejala/es.php b/modules/dejala/es.php new file mode 100755 index 00000000..1e3a92b5 --- /dev/null +++ b/modules/dejala/es.php @@ -0,0 +1,187 @@ +dejala_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Domingo'; +$_MODULE['<{dejala}prestashop>dejala_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lunes'; +$_MODULE['<{dejala}prestashop>dejala_5792315f09a5d54fb7e3d066672b507f'] = 'Martes'; +$_MODULE['<{dejala}prestashop>dejala_796c163589f295373e171842f37265d5'] = 'Miércoles'; +$_MODULE['<{dejala}prestashop>dejala_78ae6f0cd191d25147e252dc54768238'] = 'Jueves'; +$_MODULE['<{dejala}prestashop>dejala_c33b138a163847cdb6caeeb7c9a126b4'] = 'Viernes'; +$_MODULE['<{dejala}prestashop>dejala_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Sábado'; +$_MODULE['<{dejala}prestashop>dejala_9902522831a16af239ba868918f984c6'] = 'Dejala.com: transporte por mensajero'; +$_MODULE['<{dejala}prestashop>dejala_69a226fe54256a93edb693bc97a7bcb5'] = 'Envia los pedidos de entrega a dejala.fr'; +$_MODULE['<{dejala}prestashop>dejala_f66e08578735b3cde28a2d8215b68a52'] = 'El módulo necesita la extensión php Dejala cURL para funcionar'; +$_MODULE['<{dejala}prestashop>dejala_0e334c81db8c621e16d82618aaf746ab'] = 'login requerido.'; +$_MODULE['<{dejala}prestashop>dejala_2a04cf556c49e32d4b4c46fd9b8bade5'] = 'contraseña requerida.'; +$_MODULE['<{dejala}prestashop>dejala_483cf1f6e275faa3c29ff20ba6e4407f'] = 'país requerido.'; +$_MODULE['<{dejala}prestashop>dejala_2485b5c3212614c367f862a8e46f4d11'] = 'el login debe ser una dirección de correo electrónico válida.'; +$_MODULE['<{dejala}prestashop>dejala_dd189cdaa73e88a19f495a0d6c49a61b'] = 'Nombre de tienda requerido.'; +$_MODULE['<{dejala}prestashop>dejala_4876f72a0b3d7f46de2b201ab02cd0a7'] = 'no es un margen valido.'; +$_MODULE['<{dejala}prestashop>dejala_ad5ee5e5c2989c1e72c586a9f8121716'] = 'Se ha producido un error durante la autentificación de su cuenta en Dejala.com. Sus datos de autentificacón no se han reconocido.'; +$_MODULE['<{dejala}prestashop>dejala_23e0f5b7cc6e26112230c098b893944a'] = 'Imposible procesar la acción'; +$_MODULE['<{dejala}prestashop>dejala_6bd82dd0c6115429b03dd84828d6ccb2'] = 'Por favor escoja otro login'; +$_MODULE['<{dejala}prestashop>dejala_0aec12d0e7c8784012ee74606648d625'] = 'El servidor Dejala es inaccesible desde su servidor prestashop. Esto se debe posiblemente a un límite impuesto por su hosting. Contacte con el soporte técnico para preguntarle si su servidor se encuentra en medida de efectuar conexxiones HTTP de salida.'; +$_MODULE['<{dejala}prestashop>dejala_f46fe05842135a72df96c3409cf00683'] = 'Se ha producido un error al actualizar la localización'; +$_MODULE['<{dejala}prestashop>dejala_2f63af6e20f182573774b785515ccb95'] = 'Se ha producido un error al actualizar los contactos'; +$_MODULE['<{dejala}prestashop>dejala_3a29c6eb6abefd3d629290756168d892'] = 'Se ha producido un error al actualizar los procesos'; +$_MODULE['<{dejala}prestashop>dejala_5f010efe1c8e6cb195205cbf864044aa'] = 'Se ha producido un error al actualizar los productos'; +$_MODULE['<{dejala}prestashop>dejala_004ac360e91b3dcf50a19a0fd09e3826'] = 'Debe dar al menos una dirección email válida para restringir la visivilidad del módulo Dejala en su tienda'; +$_MODULE['<{dejala}prestashop>dejala_c888438d14855d7d96a2724ee9c306bd'] = 'Parámetros actualizados'; +$_MODULE['<{dejala}prestashop>dejala_dfa53d8241c9f6908e669371b50e95f3'] = 'Este módulo requiere la extensión php cURL para funcionar corectamente. Por favor instale antes la extensión php \"cURL\".'; +$_MODULE['<{dejala}prestashop>dejala_4c7d16a1e83bcbfd9b33e95f8e90a625'] = 'Se ha producido un error durante la autentificación de su cuenta en Dejala.com. Esto puede ser debido a un error de red o a un problema de plataforma. Inténtelo más tarde o contacte con Dejala.com.'; +$_MODULE['<{dejala}prestashop>dejala_94939d114a8c65173b70b6e01aad11c0'] = 'Se ha producido un error al recuperar los datos. Inténtelo más tarde o contacte con Dejala.com.'; +$_MODULE['<{dejala}prestashop>dejala_41d211dd68bf0f87cf3181b0c8dac6e7'] = 'Dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_3d8764621d6076807b0d60cfcadb7213'] = 'Cuando quiera... Por mensajero'; +$_MODULE['<{dejala}prestashop>dejala_627db4c965627fb7f03682dbbc43a4a1'] = 'Elegiré la hora de entrega cuando mi pedido esté listo.'; +$_MODULE['<{dejala}prestashop>dejala_07e9ea0147aee652244a280da00efb5a'] = 'Entrega preferible el'; +$_MODULE['<{dejala}prestashop>dejala_47a4dfe5ab79feb7884fa57786ea587c'] = 'a partir de '; +$_MODULE['<{dejala}prestashop>dejala_ba93cc89ba75ee6e74699a49a69c0600'] = 'Entrega cuya fecha debe establecerse con el cliente.'; +$_MODULE['<{dejala}prestashop>dejala_a240fa27925a635b08dc28c9e4f9216d'] = 'Pedido'; +$_MODULE['<{dejala}prestashop>dejala_296a91ebe13e861efa9bd0f74a927353'] = 'Pedido enviado a Dejala'; +$_MODULE['<{dejala}prestashop>dejala_carrier_21034ae6d01a83e702839a72ba8a77b0'] = '(sin IVA)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_1f87346a16cf80c372065de3c54c86d9'] = '(IVA inc.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_e7a6ca4e744870d455a57b644f696457'] = '¡ Gratis !'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_21034ae6d01a83e702839a72ba8a77b0'] = '(sin IVA)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_1f87346a16cf80c372065de3c54c86d9'] = '(IVA inc.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_e7a6ca4e744870d455a57b644f696457'] = '¡ Gratis !'; +$_MODULE['<{dejala}prestashop>dejala_contacts_a766dcf63862aaaa1625a45169aeb37a'] = 'Dueño de la tienda'; +$_MODULE['<{dejala}prestashop>dejala_contacts_4e140ba723a03baa6948340bf90e2ef6'] = 'Apellido:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_d2cacc542d8dd31bd89f8defed1b55ad'] = 'Nombre:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_673ae02fffb72f0fe68a66f096a01347'] = 'Teléfono:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_7a31464d87d555a1d5a7d2afdeb64d4e'] = 'Teléfono móvil:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_01401fe9a93df81d28637e5218597b76'] = 'E-Mail:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_7e2121a0b71ccc33c5eeaf11999fdbcd'] = 'Contacto de control de stock'; +$_MODULE['<{dejala}prestashop>dejala_contacts_23e44d356bfc0d17f904cb743b4d247c'] = 'Contacto con la Administración'; +$_MODULE['<{dejala}prestashop>dejala_contacts_527a0a71d5684695421ec3375ec6dba8'] = 'Contacto con Mantenimiento del Sitio web '; +$_MODULE['<{dejala}prestashop>dejala_contacts_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_9c8a7900448628ee2978be9a3945d148'] = 'Su crédito'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b0ee4c529eda15bdecda8bf189a3c813'] = 'Su crédito virtual (para simulación)'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_defcb35db6f9bdac29b888bfc07e6386'] = 'euros'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_c2b55c1a6a9880bf1d7cba1914a6da56'] = 'Acreditar su cuenta'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_642c4a47922246182590d4f3c8304f35'] = 'Lista de las ultimas entregas '; +$_MODULE['<{dejala}prestashop>dejala_deliveries_01abfc750a0c942167651c40d088531d'] = '#'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_67d5168b4f2b5424a3d118ea9ef99372'] = 'Creación'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_d79cf3f429596f77db95c65074663a54'] = 'ID de Pedido'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2a033d36697bb24bfc7ece05545d268e'] = 'N° de Tracking'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b021df6aac4654c454f46c77646e745f'] = 'Etiqueta'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_3601146c4e948c32b6424d2c0a7f0118'] = 'Precio pagado (sin IVA)'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_ec53a8c4f07baed5d8825072c89799be'] = 'Estado'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Fecha de toma en cargo'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Descripción'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2ca8d70baf21b18878843c02a086e46c'] = 'En '; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2510c39011c5be704182423e3a695e91'] = 'h'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_d98a07f84921b24ee30f86fd8cd85c3c'] = 'de'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_01b6e20344b68835c5ed1ddedf20d531'] = 'a'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_427c7fb2385f610d26ea90fff86f9a84'] = 'Exportación Csv '; +$_MODULE['<{dejala}prestashop>dejala_deliveries_5da618e8e4b89c66fe86e32cdafde142'] = 'De'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_e12167aa0a7698e6ebc92b4ce3909b53'] = 'a'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_a60852f204ed8028c1c58808b746d115'] = 'Ok'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_8424d087ffe39bb2ee8db173c7e07ba5'] = 'Fecha de creación'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_d79cf3f429596f77db95c65074663a54'] = 'N° de Pedido'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_2a033d36697bb24bfc7ece05545d268e'] = 'N° de Tracking'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_ac27812104f966f43d3a60f37a869338'] = 'Descripción rapida'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_78a5eb43deef9a7b5b9ce157b9d52ac4'] = 'Pecio pagado'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_9acb44549b41563697bb490144ec6258'] = 'Estado'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_1e6e6626b6e59276b14112ebc34c5d49'] = 'Fecha de Salida'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_c20456384feb648b4692b700ec570d42'] = 'Plazo'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_5c5c8fc67b523e638e0a904d61651f2d'] = 'Hora de Inicio'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_8e659923776b8706dbf4636c408e987c'] = 'Hora máxima de Entrega'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_ba402b48292a61e4d82f85eeaa0904dc'] = 'Fecha de Entrega'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_7c7f9f48d29519e8cb47ac606a431a65'] = 'Hora de Entrega'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_617283f39e91b6ead659cef3c722cabc'] = 'Preferencias de envío'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_11d783488db0c358bd9077a2e1a250e7'] = 'Su plazo de preparación de pedidos '; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_ffe181130430aff6386df37df36347f8'] = 'inmediato ( < 20 mn )'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_a3cb1f2ebeda6fa36b27598f1d096f60'] = 'medio dia'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_849490640e65410418220e5c179a1477'] = 'un dia'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_44fdec47036f482b68b748f9d786801b'] = 'dias'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_6749e3e07aeb12081dc32e581ffcf463'] = 'DEJALA propondrá la entrega al cabo del plazo de preparación'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_48b4a9d141bcbb3911caa5caf4b750b2'] = 'Proponer a sus clientes franjas horarias sobre '; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_7877adcb96eb8221c075f0008093bbf7'] = 'dias'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_b4f86cbc11cb9565374c08c61372f3ad'] = 'Franja en dias dentro de la cual su cliente podrá elejir ser entregado. De forma general, DEJALA vendrá recojer el pedido el dia de la entrega.'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_44a33a70398318da91b789b33152dafa'] = 'Activar si fuera de stock'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_767cd99c2f2b9fb9e5aa531c37b45f87'] = 'Permite a los clientes elegir Dejala, incluso si un producto está agotadok (El cliente elegirá la fecha de la entrega cuando su pedido esté listo)'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{dejala}prestashop>dejala_header_c45abd6f2b5f3b3a954c97f008ccb52c'] = 'Entregue sus pedidos por mensajero con '; +$_MODULE['<{dejala}prestashop>dejala_header_20e846b603a0b7f1c00b1fc457308fb7'] = 'DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_home_21e71170be5450c6380d7a9fc0ba51c3'] = '¿ Nuevo ?'; +$_MODULE['<{dejala}prestashop>dejala_home_07965cce4ec6247bd57783dff0af1657'] = 'Su nombre de tienda :'; +$_MODULE['<{dejala}prestashop>dejala_home_558f162b01a3d6d31865a1ca91a03d57'] = 'Escoja su País :'; +$_MODULE['<{dejala}prestashop>dejala_home_0309a6c666a7a803fdb9db95de71cf01'] = 'Francia'; +$_MODULE['<{dejala}prestashop>dejala_home_907eba32d950bfab68227fd7ea22999b'] = 'España'; +$_MODULE['<{dejala}prestashop>dejala_home_a999205c014634072764fe3fadc4f4ca'] = 'Elija su login :'; +$_MODULE['<{dejala}prestashop>dejala_home_a7e4228de9b12575b0cd88c4cf0f54f9'] = 'Elija su contraseña :'; +$_MODULE['<{dejala}prestashop>dejala_home_0ba7583639a274c434bbe6ef797115a4'] = 'Registrarse'; +$_MODULE['<{dejala}prestashop>dejala_home_72429bbc9acf8e6fcf6132ac1fa20d57'] = 'Ya dispongo de una cuenta para mi tienda :'; +$_MODULE['<{dejala}prestashop>dejala_home_051672911a3f1f05efba78a553ef6fe2'] = 'Login :'; +$_MODULE['<{dejala}prestashop>dejala_home_b341a59d5636ed3d6a819137495b08a0'] = 'Contraseña :'; +$_MODULE['<{dejala}prestashop>dejala_home_e5b47edd743751a81819b7f421639303'] = 'Apúntarse'; +$_MODULE['<{dejala}prestashop>dejala_home_853fe2c3719fab6d1dde555eb536f649'] = 'DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_home_02d222897fd57cbc8154be7b2c41e2ff'] = 'Para recordar'; +$_MODULE['<{dejala}prestashop>dejala_home_3a40880c274dd353056ce584940d1ca8'] = 'El nombre de su tienda en'; +$_MODULE['<{dejala}prestashop>dejala_home_55724d105b50b04063a21fba83236de6'] = 'Su login es'; +$_MODULE['<{dejala}prestashop>dejala_home_bbb658f348426b60b3395d5357225112'] = 'Está en modo'; +$_MODULE['<{dejala}prestashop>dejala_home_c8ab370eeab3cf4011e25fa953031e77'] = 'SIMULACIÓN en la plataforma de Test'; +$_MODULE['<{dejala}prestashop>dejala_home_68279960d4eaab19115d276486e1e1d7'] = 'PRODUCCIÓN en la plataforma real'; +$_MODULE['<{dejala}prestashop>dejala_home_64baa4dba37ddc4207a777ac53565f06'] = 'Bascular al modo SIMULACIÓN'; +$_MODULE['<{dejala}prestashop>dejala_home_a0802ed7a4e243cc01699e44e0b0b33b'] = 'Bascular al modo PRODUCCIÓN'; +$_MODULE['<{dejala}prestashop>dejala_home_104cdbe9fcaa62064ecc718b647c2929'] = 'Su péticion para bascular al modo real se está procesando: DEJALA entrará en contacto con usted para finalizar el trámite.'; +$_MODULE['<{dejala}prestashop>dejala_home_1ccd621bb658777957a0c0ae95b97fc6'] = 'Solicitar DEJALA para crear mi cuenta en producción'; +$_MODULE['<{dejala}prestashop>dejala_home_9c8a7900448628ee2978be9a3945d148'] = 'Su crédito'; +$_MODULE['<{dejala}prestashop>dejala_home_b0ee4c529eda15bdecda8bf189a3c813'] = 'Su crédito virtual (para pruebas en modo simulación)'; +$_MODULE['<{dejala}prestashop>dejala_home_defcb35db6f9bdac29b888bfc07e6386'] = 'euros'; +$_MODULE['<{dejala}prestashop>dejala_home_c2b55c1a6a9880bf1d7cba1914a6da56'] = 'Acreditar su cuenta'; +$_MODULE['<{dejala}prestashop>dejala_home_d33b3ef83df48e14035b6927a27a6824'] = 'Dejala NO es visible por los usuarios'; +$_MODULE['<{dejala}prestashop>dejala_home_8ce5717d0efdee714d5c44eb72559943'] = 'Dejala NO es visible por todos los usuarios'; +$_MODULE['<{dejala}prestashop>dejala_home_97f9bae265c399ce4781878d46a5a733'] = 'Dejala es visible únicamente por los sigueintes usuarios:'; +$_MODULE['<{dejala}prestashop>dejala_home_66495952bdab30f6bdc92e318d4f36a6'] = 'Por ej: a@foof.com, b@bar.com'; +$_MODULE['<{dejala}prestashop>dejala_home_e49df857f0f92d5dd2f73b9fa54d7308'] = 'Actualizar la visibilidad'; +$_MODULE['<{dejala}prestashop>dejala_location_ce9142ea2df85cf8ea4dfda7164e7dcf'] = 'Indique la dirección del PUNTO DE SALIDA de las mercancias'; +$_MODULE['<{dejala}prestashop>dejala_location_c58b3ccfae7d8991a1bdf33f275d6007'] = '(sólo lectura en producción)'; +$_MODULE['<{dejala}prestashop>dejala_location_20dfc4f904ba3c650a578c41f87e7053'] = 'Localizar'; +$_MODULE['<{dejala}prestashop>dejala_location_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Empresa'; +$_MODULE['<{dejala}prestashop>dejala_location_dd7bf230fde8d4836917806aff6a6b27'] = 'Dirección (1)'; +$_MODULE['<{dejala}prestashop>dejala_location_783cb853aae6984e51583b3bb80c09d2'] = 'Dirección (2)'; +$_MODULE['<{dejala}prestashop>dejala_location_9b514b51d03075005814a33edc74c958'] = 'Código postal'; +$_MODULE['<{dejala}prestashop>dejala_location_57d056ed0984166336b7879c2af3657f'] = 'Ciudad'; +$_MODULE['<{dejala}prestashop>dejala_location_bcc254b55c4a1babdf1dcb82c207506b'] = 'Teléfono'; +$_MODULE['<{dejala}prestashop>dejala_location_4e186c431f7c016c761c722debb9768e'] = 'Teléfono móvil'; +$_MODULE['<{dejala}prestashop>dejala_location_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Comentarios'; +$_MODULE['<{dejala}prestashop>dejala_location_b17f3f4dcf653a5776792498a9b44d6a'] = 'Guardar'; +$_MODULE['<{dejala}prestashop>dejala_menu_8cf04a9734132302f96da8e113e80ce5'] = 'Inicio'; +$_MODULE['<{dejala}prestashop>dejala_menu_ce5bf551379459c1c61d2a204061c455'] = 'Stock'; +$_MODULE['<{dejala}prestashop>dejala_menu_9aa698f602b1e5694855cee73a683488'] = 'Contactos'; +$_MODULE['<{dejala}prestashop>dejala_menu_77ea79b4b2638f146bf02ea6dc076006'] = 'Casos de entrega'; +$_MODULE['<{dejala}prestashop>dejala_menu_3eb0f1d14d6ec438d91fcfdab94fc1ca'] = 'Opciones de entrega'; +$_MODULE['<{dejala}prestashop>dejala_menu_e16dd6e118732c5d1586d6aba0b62f3a'] = 'Precios'; +$_MODULE['<{dejala}prestashop>dejala_menu_9bbd45bad55cfc620803907f2d8a0217'] = 'Historial de entregas'; +$_MODULE['<{dejala}prestashop>dejala_menu_36d5423bb12a6d74d1d0f0ba09ef47cb'] = 'Parámetros técnicos'; +$_MODULE['<{dejala}prestashop>dejala_menu_35cf95ca41b6d074cfaeac16b0e0906c'] = 'DEJALA PRO'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_845398bc903ec28114a5f9874d83936b'] = 'El stock está abierto :'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_2084c04f7a380a68b653e5fc82d352f0'] = 'De'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_7fc56270e7a70fa81a5935b72eacbe29'] = 'A'; +$_MODULE['<{dejala}prestashop>dejala_processes_237527ad3e0c9d87f072f2ac3a873dc8'] = 'Cómo actuar y con quien contactar en los casos siguientes '; +$_MODULE['<{dejala}prestashop>dejala_processes_0f516eb68a85aae932001976c51dee2f'] = 'No dude en modificar los procedimientos siguientes según sus imperativos comerciales y/o logísticos !'; +$_MODULE['<{dejala}prestashop>dejala_processes_dbfdb39c2251ff72f42f7078ab347611'] = 'Dirección del cliente erronea o no encontrada'; +$_MODULE['<{dejala}prestashop>dejala_processes_b1da17cfc7c9a051fe4ce45bf1dd1ace'] = 'Cliente ausente al momento de la entrega'; +$_MODULE['<{dejala}prestashop>dejala_processes_3ab0370c6e7c3d0ea1cd540e7afacc9a'] = 'Entrega denegada por el cliente'; +$_MODULE['<{dejala}prestashop>dejala_processes_138a10902b1fec08bcf2d9f5a6f4b02b'] = 'Precauciones especiales con sus paquetes (fragilidad, embalaje, etc)'; +$_MODULE['<{dejala}prestashop>dejala_processes_b17f3f4dcf653a5776792498a9b44d6a'] = 'Guardar'; +$_MODULE['<{dejala}prestashop>dejala_products_aa83582f6ce84345c97815de714e6ebd'] = 'Puede ajustar sur margen (ganar sobre el envio o tomar en cargo todo o parte del costo de envio) '; +$_MODULE['<{dejala}prestashop>dejala_products_49ee3087348e8d44e1feda1917443987'] = 'Destino del envio'; +$_MODULE['<{dejala}prestashop>dejala_products_26160d42b371fb091c142cb8cfa09c34'] = 'Precio que DEJALA le factura por el envio'; +$_MODULE['<{dejala}prestashop>dejala_products_f8ca05a1d72f37501747657deecdd15c'] = 'Su margen sobre el envio (IVA_incluido)'; +$_MODULE['<{dejala}prestashop>dejala_products_e6f254c2f6e55725e99e1e6dfd6d9caa'] = 'Costo final del envio (añadido a la carrito)'; +$_MODULE['<{dejala}prestashop>dejala_products_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Descripción de la prestación'; +$_MODULE['<{dejala}prestashop>dejala_products_1cdad1a5f8e5d09be270415e44c0f039'] = 'Compra sin IVA'; +$_MODULE['<{dejala}prestashop>dejala_products_ecef91ba37ffc5f5294ea50efee7c6a2'] = 'Compra IVA inc.'; +$_MODULE['<{dejala}prestashop>dejala_products_765a24c102d9a0b03eb03c77e90a9144'] = 'Venta sin IVA'; +$_MODULE['<{dejala}prestashop>dejala_products_8588719c33b27bd80ae45cc533117c00'] = 'Venta IVA inc.'; +$_MODULE['<{dejala}prestashop>dejala_products_efeb369cccbd560588a756610865664c'] = 'En'; +$_MODULE['<{dejala}prestashop>dejala_products_2510c39011c5be704182423e3a695e91'] = 'h'; +$_MODULE['<{dejala}prestashop>dejala_products_b17f3f4dcf653a5776792498a9b44d6a'] = 'Guardar'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_b44c4d973c20b84bad66d243b215ef37'] = 'Estados que generan automaticamente un pedido de entrega por DEJALA '; +$_MODULE['<{dejala}prestashop>dejala_technical_options_a296002220093a4833752a3cf94f07d0'] = 'Cuando un pedido de entrega se valida, se le carga el coste a su cuenta DEJALA.'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_b17f3f4dcf653a5776792498a9b44d6a'] = 'Guardar'; +$_MODULE['<{dejala}prestashop>dejala_timetable_193993f964d2d4df4b1484227c1626b6'] = 'Elegir el día de entrega'; +$_MODULE['<{dejala}prestashop>dejala_timetable_26903e0f192163f4a0957c0b185edf71'] = 'Elegir la hora de entrega'; diff --git a/modules/dejala/fr.php b/modules/dejala/fr.php new file mode 100755 index 00000000..d1b7ef54 --- /dev/null +++ b/modules/dejala/fr.php @@ -0,0 +1,187 @@ +dejala_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Dimanche'; +$_MODULE['<{dejala}prestashop>dejala_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lundi'; +$_MODULE['<{dejala}prestashop>dejala_5792315f09a5d54fb7e3d066672b507f'] = 'Mardi'; +$_MODULE['<{dejala}prestashop>dejala_796c163589f295373e171842f37265d5'] = 'Mercredi'; +$_MODULE['<{dejala}prestashop>dejala_78ae6f0cd191d25147e252dc54768238'] = 'Jeudi'; +$_MODULE['<{dejala}prestashop>dejala_c33b138a163847cdb6caeeb7c9a126b4'] = 'Vendredi'; +$_MODULE['<{dejala}prestashop>dejala_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Samedi'; +$_MODULE['<{dejala}prestashop>dejala_9902522831a16af239ba868918f984c6'] = 'dejala.com : le transport par coursier'; +$_MODULE['<{dejala}prestashop>dejala_69a226fe54256a93edb693bc97a7bcb5'] = 'Envoie les demandes de livraisons vers dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_f66e08578735b3cde28a2d8215b68a52'] = 'Le module nécessite l\'extension php Dejala cURL pour fonctionner correctement. Merci d\'installer l\'extension php \"curl \"'; +$_MODULE['<{dejala}prestashop>dejala_0e334c81db8c621e16d82618aaf746ab'] = 'Entrez votre nom d\'utilisateur'; +$_MODULE['<{dejala}prestashop>dejala_2a04cf556c49e32d4b4c46fd9b8bade5'] = 'Entrez votre mot de passe'; +$_MODULE['<{dejala}prestashop>dejala_483cf1f6e275faa3c29ff20ba6e4407f'] = 'Merci de bien vouloir sélectionner un pays'; +$_MODULE['<{dejala}prestashop>dejala_2485b5c3212614c367f862a8e46f4d11'] = 'Le nom d\'utilisateur doit être une adresse email valide'; +$_MODULE['<{dejala}prestashop>dejala_dd189cdaa73e88a19f495a0d6c49a61b'] = 'Entrez le nom de votre boutique'; +$_MODULE['<{dejala}prestashop>dejala_4876f72a0b3d7f46de2b201ab02cd0a7'] = 'n\'est pas une marge acceptée'; +$_MODULE['<{dejala}prestashop>dejala_ad5ee5e5c2989c1e72c586a9f8121716'] = 'Une erreur est survenue lors de l\'authentification de votre compte sur Dejala.com. Vos informations d\'authentification n\'ont pas été reconnues.'; +$_MODULE['<{dejala}prestashop>dejala_23e0f5b7cc6e26112230c098b893944a'] = 'Impossible de réaliser cette action'; +$_MODULE['<{dejala}prestashop>dejala_6bd82dd0c6115429b03dd84828d6ccb2'] = 'Ce login n\'est pas disponible. Merci de choisir un autre login.'; +$_MODULE['<{dejala}prestashop>dejala_0aec12d0e7c8784012ee74606648d625'] = 'Serveur Dejala inaccessible depuis votre serveur Prestashop. Ceci est certainement dû à une limite imposée par votre hébergeur. Contactez le support technique de ce dernier pour lui demander si votre serveur est autorisé à effectuer des connexions HTTP sortantes.'; +$_MODULE['<{dejala}prestashop>dejala_f46fe05842135a72df96c3409cf00683'] = 'Une erreur est survenue lors de la mise à jour de l\'adresse'; +$_MODULE['<{dejala}prestashop>dejala_2f63af6e20f182573774b785515ccb95'] = 'Une erreur est survenue lors de la mise à jour des contacts'; +$_MODULE['<{dejala}prestashop>dejala_3a29c6eb6abefd3d629290756168d892'] = 'Une erreur est survenue lors de la mise à jour des imprévus'; +$_MODULE['<{dejala}prestashop>dejala_5f010efe1c8e6cb195205cbf864044aa'] = 'Une erreur est survenue lors de la mise à jour des produits'; +$_MODULE['<{dejala}prestashop>dejala_004ac360e91b3dcf50a19a0fd09e3826'] = 'Vous devez fournir au moins une adresse email pour restreindre la visibilité du module Dejala sur votre boutique'; +$_MODULE['<{dejala}prestashop>dejala_c888438d14855d7d96a2724ee9c306bd'] = 'Modifications prises en compte'; +$_MODULE['<{dejala}prestashop>dejala_dfa53d8241c9f6908e669371b50e95f3'] = 'Ce module a besoin de l\'extension php \"cURL\" pour fonctionner correctement. Merci de bien vouloir installer l\'extension php \"cURL\"'; +$_MODULE['<{dejala}prestashop>dejala_4c7d16a1e83bcbfd9b33e95f8e90a625'] = 'Une erreur est survenue lors de l\'authentification de votre compte sur Dejala.com. Ceci peut être du à une erreur réseau ou à un problème de plate-forme. Réessayez plus tard ou contactez Dejala.com.'; +$_MODULE['<{dejala}prestashop>dejala_94939d114a8c65173b70b6e01aad11c0'] = 'Une erreur est survenue lors de la récupération des informations. Réessayez plus tard ou contactez Dejala.com.'; +$_MODULE['<{dejala}prestashop>dejala_41d211dd68bf0f87cf3181b0c8dac6e7'] = 'Dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_3d8764621d6076807b0d60cfcadb7213'] = 'Quand vous voulez... Par coursier'; +$_MODULE['<{dejala}prestashop>dejala_627db4c965627fb7f03682dbbc43a4a1'] = 'Je choisirai mon heure de livraison quand mon colis sera prêt.'; +$_MODULE['<{dejala}prestashop>dejala_07e9ea0147aee652244a280da00efb5a'] = 'Livraison souhaitée le'; +$_MODULE['<{dejala}prestashop>dejala_47a4dfe5ab79feb7884fa57786ea587c'] = 'à partir de'; +$_MODULE['<{dejala}prestashop>dejala_ba93cc89ba75ee6e74699a49a69c0600'] = 'Livraison dont la date doit être fixée avec le client.'; +$_MODULE['<{dejala}prestashop>dejala_a240fa27925a635b08dc28c9e4f9216d'] = 'Commande'; +$_MODULE['<{dejala}prestashop>dejala_296a91ebe13e861efa9bd0f74a927353'] = 'Commande envoyée à Dejala'; +$_MODULE['<{dejala}prestashop>dejala_carrier_21034ae6d01a83e702839a72ba8a77b0'] = 'HT'; +$_MODULE['<{dejala}prestashop>dejala_carrier_1f87346a16cf80c372065de3c54c86d9'] = 'TTC'; +$_MODULE['<{dejala}prestashop>dejala_carrier_e7a6ca4e744870d455a57b644f696457'] = 'Gratuit !'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_21034ae6d01a83e702839a72ba8a77b0'] = 'HT'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_1f87346a16cf80c372065de3c54c86d9'] = 'TTC'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_e7a6ca4e744870d455a57b644f696457'] = 'Gratuit !'; +$_MODULE['<{dejala}prestashop>dejala_contacts_a766dcf63862aaaa1625a45169aeb37a'] = 'Gérant de la Boutique (signataire)'; +$_MODULE['<{dejala}prestashop>dejala_contacts_4e140ba723a03baa6948340bf90e2ef6'] = 'Nom'; +$_MODULE['<{dejala}prestashop>dejala_contacts_d2cacc542d8dd31bd89f8defed1b55ad'] = 'Prénom'; +$_MODULE['<{dejala}prestashop>dejala_contacts_673ae02fffb72f0fe68a66f096a01347'] = 'Tél'; +$_MODULE['<{dejala}prestashop>dejala_contacts_7a31464d87d555a1d5a7d2afdeb64d4e'] = 'Mobile'; +$_MODULE['<{dejala}prestashop>dejala_contacts_01401fe9a93df81d28637e5218597b76'] = 'E-Mail'; +$_MODULE['<{dejala}prestashop>dejala_contacts_7e2121a0b71ccc33c5eeaf11999fdbcd'] = 'Contact du Stock (point de départ)'; +$_MODULE['<{dejala}prestashop>dejala_contacts_23e44d356bfc0d17f904cb743b4d247c'] = 'Contact Administratif et Financier'; +$_MODULE['<{dejala}prestashop>dejala_contacts_527a0a71d5684695421ec3375ec6dba8'] = 'Contact Expédition (suivi des livraisons)'; +$_MODULE['<{dejala}prestashop>dejala_contacts_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_9c8a7900448628ee2978be9a3945d148'] = 'Votre solde'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b0ee4c529eda15bdecda8bf189a3c813'] = 'Votre solde fictif (pour la simulation)'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_defcb35db6f9bdac29b888bfc07e6386'] = 'Euros (€)'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_c2b55c1a6a9880bf1d7cba1914a6da56'] = 'Rechargez votre compte'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_642c4a47922246182590d4f3c8304f35'] = 'Liste des dernières commandes'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_01abfc750a0c942167651c40d088531d'] = '#'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_67d5168b4f2b5424a3d118ea9ef99372'] = 'Date de la commande'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_d79cf3f429596f77db95c65074663a54'] = 'ID de la commande'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2a033d36697bb24bfc7ece05545d268e'] = 'N° de suivi Dejala'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b021df6aac4654c454f46c77646e745f'] = 'Libellé'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_3601146c4e948c32b6424d2c0a7f0118'] = 'Prix payé HT'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_ec53a8c4f07baed5d8825072c89799be'] = 'Etat '; +$_MODULE['<{dejala}prestashop>dejala_deliveries_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Date prise en charge'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Description'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2ca8d70baf21b18878843c02a086e46c'] = 'En '; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2510c39011c5be704182423e3a695e91'] = 'h'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_d98a07f84921b24ee30f86fd8cd85c3c'] = 'de'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_01b6e20344b68835c5ed1ddedf20d531'] = 'à'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_427c7fb2385f610d26ea90fff86f9a84'] = 'Exportation en CSV'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_5da618e8e4b89c66fe86e32cdafde142'] = 'De'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_e12167aa0a7698e6ebc92b4ce3909b53'] = 'A '; +$_MODULE['<{dejala}prestashop>dejala_deliveries_a60852f204ed8028c1c58808b746d115'] = 'OK'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_8424d087ffe39bb2ee8db173c7e07ba5'] = 'Date de création'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_d79cf3f429596f77db95c65074663a54'] = 'ID commande'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_2a033d36697bb24bfc7ece05545d268e'] = 'N° de suivi Dejala'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_ac27812104f966f43d3a60f37a869338'] = 'description courte'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_78a5eb43deef9a7b5b9ce157b9d52ac4'] = 'Prix payé'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_9acb44549b41563697bb490144ec6258'] = 'Etat'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_1e6e6626b6e59276b14112ebc34c5d49'] = 'Date de départ'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_c20456384feb648b4692b700ec570d42'] = 'Délai'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_5c5c8fc67b523e638e0a904d61651f2d'] = 'Heure Début'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_8e659923776b8706dbf4636c408e987c'] = 'heure max de Livraison'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_ba402b48292a61e4d82f85eeaa0904dc'] = 'Date de Livraison'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_7c7f9f48d29519e8cb47ac606a431a65'] = 'Heure de Livraison'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_617283f39e91b6ead659cef3c722cabc'] = 'Préférences de livraison'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_11d783488db0c358bd9077a2e1a250e7'] = 'Votre temps de préparation de commande'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_ffe181130430aff6386df37df36347f8'] = 'immédiat (< 20 mn)'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_a3cb1f2ebeda6fa36b27598f1d096f60'] = 'une demi-journée'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_849490640e65410418220e5c179a1477'] = 'une journée'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_44fdec47036f482b68b748f9d786801b'] = 'journées'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_6749e3e07aeb12081dc32e581ffcf463'] = 'Dejala proposera une livraison à l\'issue du temps de préparation'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_48b4a9d141bcbb3911caa5caf4b750b2'] = 'Proposer à votre client des créneaux sur '; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_7877adcb96eb8221c075f0008093bbf7'] = 'jours'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_b4f86cbc11cb9565374c08c61372f3ad'] = 'C\'est le nombre de jours parmi lesquels votre client pourra choisir d\'être livré. D\'une manière générale, Dejala viendra chercher la commande le jour de la livraison.'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_44a33a70398318da91b789b33152dafa'] = 'Actif en hors stock'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_767cd99c2f2b9fb9e5aa531c37b45f87'] = 'Ceci permettra à vos clients de commander un coursier quand un produit est hors stock. Votre client choisira son créneau de livraison quand sa commande sera prête.'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{dejala}prestashop>dejala_header_c45abd6f2b5f3b3a954c97f008ccb52c'] = 'Livrez vos clients par coursier avec '; +$_MODULE['<{dejala}prestashop>dejala_header_20e846b603a0b7f1c00b1fc457308fb7'] = 'DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_home_21e71170be5450c6380d7a9fc0ba51c3'] = 'Nouveau ? '; +$_MODULE['<{dejala}prestashop>dejala_home_07965cce4ec6247bd57783dff0af1657'] = 'Nom de votre site'; +$_MODULE['<{dejala}prestashop>dejala_home_558f162b01a3d6d31865a1ca91a03d57'] = 'Dans quel pays est votre entrepôt'; +$_MODULE['<{dejala}prestashop>dejala_home_0309a6c666a7a803fdb9db95de71cf01'] = 'France'; +$_MODULE['<{dejala}prestashop>dejala_home_907eba32d950bfab68227fd7ea22999b'] = 'Espagne'; +$_MODULE['<{dejala}prestashop>dejala_home_a999205c014634072764fe3fadc4f4ca'] = 'votre login (votre E-Mail)'; +$_MODULE['<{dejala}prestashop>dejala_home_a7e4228de9b12575b0cd88c4cf0f54f9'] = 'Choisissez un mot de passe sur Dejala'; +$_MODULE['<{dejala}prestashop>dejala_home_0ba7583639a274c434bbe6ef797115a4'] = 's\'inscrire'; +$_MODULE['<{dejala}prestashop>dejala_home_72429bbc9acf8e6fcf6132ac1fa20d57'] = 'je suis déjà inscrit sur DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_home_051672911a3f1f05efba78a553ef6fe2'] = 'login'; +$_MODULE['<{dejala}prestashop>dejala_home_b341a59d5636ed3d6a819137495b08a0'] = 'mot de passe Dejala'; +$_MODULE['<{dejala}prestashop>dejala_home_e5b47edd743751a81819b7f421639303'] = 's\'identifier'; +$_MODULE['<{dejala}prestashop>dejala_home_853fe2c3719fab6d1dde555eb536f649'] = 'DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_home_02d222897fd57cbc8154be7b2c41e2ff'] = 'Pour mémoire'; +$_MODULE['<{dejala}prestashop>dejala_home_3a40880c274dd353056ce584940d1ca8'] = 'Le nom de votre magasin est'; +$_MODULE['<{dejala}prestashop>dejala_home_55724d105b50b04063a21fba83236de6'] = 'Votre login (E-Mail) est'; +$_MODULE['<{dejala}prestashop>dejala_home_bbb658f348426b60b3395d5357225112'] = 'Vous êtes en mode'; +$_MODULE['<{dejala}prestashop>dejala_home_c8ab370eeab3cf4011e25fa953031e77'] = 'SIMULATION sur la plateforme de TEST'; +$_MODULE['<{dejala}prestashop>dejala_home_68279960d4eaab19115d276486e1e1d7'] = 'PRODUCTION'; +$_MODULE['<{dejala}prestashop>dejala_home_64baa4dba37ddc4207a777ac53565f06'] = 'passer en mode SIMULATION'; +$_MODULE['<{dejala}prestashop>dejala_home_a0802ed7a4e243cc01699e44e0b0b33b'] = 'passer en mode PRODUCTION'; +$_MODULE['<{dejala}prestashop>dejala_home_104cdbe9fcaa62064ecc718b647c2929'] = 'Votre demande de passage en production est en cours de traitement. DEJALA va vous contacter prochainement pour valider votre activation.'; +$_MODULE['<{dejala}prestashop>dejala_home_1ccd621bb658777957a0c0ae95b97fc6'] = 'je souhaite passer en PRODUCTION'; +$_MODULE['<{dejala}prestashop>dejala_home_9c8a7900448628ee2978be9a3945d148'] = 'Votre solde'; +$_MODULE['<{dejala}prestashop>dejala_home_b0ee4c529eda15bdecda8bf189a3c813'] = 'Votre solde fictif (pour la simulation)'; +$_MODULE['<{dejala}prestashop>dejala_home_defcb35db6f9bdac29b888bfc07e6386'] = 'Euros (€)'; +$_MODULE['<{dejala}prestashop>dejala_home_c2b55c1a6a9880bf1d7cba1914a6da56'] = 'Rechargez votre compte'; +$_MODULE['<{dejala}prestashop>dejala_home_d33b3ef83df48e14035b6927a27a6824'] = 'Dejala n\'est PAS visible par vos utilisateurs'; +$_MODULE['<{dejala}prestashop>dejala_home_8ce5717d0efdee714d5c44eb72559943'] = 'Dejala EST visible par tous vos utilisateurs'; +$_MODULE['<{dejala}prestashop>dejala_home_97f9bae265c399ce4781878d46a5a733'] = 'Dejala EST visible UNIQUEMENT par les utilisateurs suivants :'; +$_MODULE['<{dejala}prestashop>dejala_home_66495952bdab30f6bdc92e318d4f36a6'] = '(Par ex: a@foo.com, b@bar.com)'; +$_MODULE['<{dejala}prestashop>dejala_home_e49df857f0f92d5dd2f73b9fa54d7308'] = 'Mettre à jour la visibilité'; +$_MODULE['<{dejala}prestashop>dejala_location_ce9142ea2df85cf8ea4dfda7164e7dcf'] = 'Informations relatives au POINT DE DÉPART des marchandises'; +$_MODULE['<{dejala}prestashop>dejala_location_c58b3ccfae7d8991a1bdf33f275d6007'] = '(lecture seule)'; +$_MODULE['<{dejala}prestashop>dejala_location_20dfc4f904ba3c650a578c41f87e7053'] = 'Localiser'; +$_MODULE['<{dejala}prestashop>dejala_location_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Enseigne'; +$_MODULE['<{dejala}prestashop>dejala_location_dd7bf230fde8d4836917806aff6a6b27'] = 'Adresse'; +$_MODULE['<{dejala}prestashop>dejala_location_783cb853aae6984e51583b3bb80c09d2'] = 'Adresse (suite)'; +$_MODULE['<{dejala}prestashop>dejala_location_9b514b51d03075005814a33edc74c958'] = 'Code Postal'; +$_MODULE['<{dejala}prestashop>dejala_location_57d056ed0984166336b7879c2af3657f'] = 'Ville'; +$_MODULE['<{dejala}prestashop>dejala_location_bcc254b55c4a1babdf1dcb82c207506b'] = 'Tél'; +$_MODULE['<{dejala}prestashop>dejala_location_4e186c431f7c016c761c722debb9768e'] = 'Mobile'; +$_MODULE['<{dejala}prestashop>dejala_location_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Commentaire '; +$_MODULE['<{dejala}prestashop>dejala_location_b17f3f4dcf653a5776792498a9b44d6a'] = 'Enregistrer les modifications'; +$_MODULE['<{dejala}prestashop>dejala_menu_8cf04a9734132302f96da8e113e80ce5'] = 'Accueil'; +$_MODULE['<{dejala}prestashop>dejala_menu_ce5bf551379459c1c61d2a204061c455'] = 'Stock'; +$_MODULE['<{dejala}prestashop>dejala_menu_9aa698f602b1e5694855cee73a683488'] = 'Contacts'; +$_MODULE['<{dejala}prestashop>dejala_menu_77ea79b4b2638f146bf02ea6dc076006'] = 'Gestion des imprévus'; +$_MODULE['<{dejala}prestashop>dejala_menu_3eb0f1d14d6ec438d91fcfdab94fc1ca'] = 'Options de livraison'; +$_MODULE['<{dejala}prestashop>dejala_menu_e16dd6e118732c5d1586d6aba0b62f3a'] = 'Tarifs'; +$_MODULE['<{dejala}prestashop>dejala_menu_9bbd45bad55cfc620803907f2d8a0217'] = 'Historique de livraison'; +$_MODULE['<{dejala}prestashop>dejala_menu_36d5423bb12a6d74d1d0f0ba09ef47cb'] = 'Paramètres techniques'; +$_MODULE['<{dejala}prestashop>dejala_menu_35cf95ca41b6d074cfaeac16b0e0906c'] = 'DEJALA PRO'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_845398bc903ec28114a5f9874d83936b'] = 'Le stock est ouvert :'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_2084c04f7a380a68b653e5fc82d352f0'] = 'De'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_7fc56270e7a70fa81a5935b72eacbe29'] = 'A'; +$_MODULE['<{dejala}prestashop>dejala_processes_237527ad3e0c9d87f072f2ac3a873dc8'] = 'Conduite à tenir et personnes à prévenir dans les cas suivants '; +$_MODULE['<{dejala}prestashop>dejala_processes_0f516eb68a85aae932001976c51dee2f'] = 'N\'hésitez pas à modifier les procédures ci-dessous en fonction de vos impératifs commerciaux ou logistiques.'; +$_MODULE['<{dejala}prestashop>dejala_processes_dbfdb39c2251ff72f42f7078ab347611'] = 'L\'adresse de votre client est erronnée ou introuvable'; +$_MODULE['<{dejala}prestashop>dejala_processes_b1da17cfc7c9a051fe4ce45bf1dd1ace'] = 'Votre client est absent au moment de la livraison'; +$_MODULE['<{dejala}prestashop>dejala_processes_3ab0370c6e7c3d0ea1cd540e7afacc9a'] = 'Votre client refuse la livraison'; +$_MODULE['<{dejala}prestashop>dejala_processes_138a10902b1fec08bcf2d9f5a6f4b02b'] = 'Précautions particulières à prendre avec vos colis (fragilité, packaging, etc)'; +$_MODULE['<{dejala}prestashop>dejala_processes_b17f3f4dcf653a5776792498a9b44d6a'] = 'Enregistrer ces modifications'; +$_MODULE['<{dejala}prestashop>dejala_products_aa83582f6ce84345c97815de714e6ebd'] = 'Vous pouvez ajuster votre marge (gagner sur la livraison ou prendre en charge tout ou partie du coût de livraison) '; +$_MODULE['<{dejala}prestashop>dejala_products_49ee3087348e8d44e1feda1917443987'] = 'Destination de la livraison'; +$_MODULE['<{dejala}prestashop>dejala_products_26160d42b371fb091c142cb8cfa09c34'] = 'Prix d\'achat de la livraison à DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_products_f8ca05a1d72f37501747657deecdd15c'] = 'Votre marge TTC sur la livraison'; +$_MODULE['<{dejala}prestashop>dejala_products_e6f254c2f6e55725e99e1e6dfd6d9caa'] = 'Frais d\'expédition (ajoutés au panier)'; +$_MODULE['<{dejala}prestashop>dejala_products_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Description de la prestation'; +$_MODULE['<{dejala}prestashop>dejala_products_1cdad1a5f8e5d09be270415e44c0f039'] = 'achat HT'; +$_MODULE['<{dejala}prestashop>dejala_products_ecef91ba37ffc5f5294ea50efee7c6a2'] = 'achat TTC'; +$_MODULE['<{dejala}prestashop>dejala_products_765a24c102d9a0b03eb03c77e90a9144'] = 'vente HT'; +$_MODULE['<{dejala}prestashop>dejala_products_8588719c33b27bd80ae45cc533117c00'] = 'vente TTC'; +$_MODULE['<{dejala}prestashop>dejala_products_efeb369cccbd560588a756610865664c'] = 'Créneau de '; +$_MODULE['<{dejala}prestashop>dejala_products_2510c39011c5be704182423e3a695e91'] = 'h'; +$_MODULE['<{dejala}prestashop>dejala_products_b17f3f4dcf653a5776792498a9b44d6a'] = 'Enregistrer les modifications'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_b44c4d973c20b84bad66d243b215ef37'] = 'Liste des statuts qui valident automatiquement la commande de la course à DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_a296002220093a4833752a3cf94f07d0'] = 'Lorsqu\'une commande de course est validée, votre compte DEJALA est débité du montant de la course.'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mise à jour des statuts'; +$_MODULE['<{dejala}prestashop>dejala_timetable_193993f964d2d4df4b1484227c1626b6'] = 'Choisissez le jour de la livraison'; +$_MODULE['<{dejala}prestashop>dejala_timetable_26903e0f192163f4a0957c0b185edf71'] = 'Choisissez l\'heure de la livraison'; diff --git a/modules/dejala/google.gif b/modules/dejala/google.gif new file mode 100755 index 00000000..d24a14a9 Binary files /dev/null and b/modules/dejala/google.gif differ diff --git a/modules/dejala/index.php b/modules/dejala/index.php new file mode 100755 index 00000000..b559f985 --- /dev/null +++ b/modules/dejala/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 7233 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; \ No newline at end of file diff --git a/modules/dejala/it.php b/modules/dejala/it.php new file mode 100755 index 00000000..ada900a6 --- /dev/null +++ b/modules/dejala/it.php @@ -0,0 +1,187 @@ +dejala_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Domenica'; +$_MODULE['<{dejala}prestashop>dejala_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lunedi'; +$_MODULE['<{dejala}prestashop>dejala_5792315f09a5d54fb7e3d066672b507f'] = 'Martedì'; +$_MODULE['<{dejala}prestashop>dejala_796c163589f295373e171842f37265d5'] = 'Mercoledì'; +$_MODULE['<{dejala}prestashop>dejala_78ae6f0cd191d25147e252dc54768238'] = 'Giovedi'; +$_MODULE['<{dejala}prestashop>dejala_c33b138a163847cdb6caeeb7c9a126b4'] = 'Venerdì'; +$_MODULE['<{dejala}prestashop>dejala_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Sabato'; +$_MODULE['<{dejala}prestashop>dejala_9902522831a16af239ba868918f984c6'] = 'Dejala.com: consegna del corriere'; +$_MODULE['<{dejala}prestashop>dejala_69a226fe54256a93edb693bc97a7bcb5'] = 'Consente di gestire le consegne Dejala.com tramite corriere'; +$_MODULE['<{dejala}prestashop>dejala_f66e08578735b3cde28a2d8215b68a52'] = 'Il modulo Dejala richiede l\'estensione php cURL per funzionare correttamente. Si prega di installare l\'estensione php \"cURL\"'; +$_MODULE['<{dejala}prestashop>dejala_0e334c81db8c621e16d82618aaf746ab'] = 'login richiesto.'; +$_MODULE['<{dejala}prestashop>dejala_2a04cf556c49e32d4b4c46fd9b8bade5'] = 'è richiesta la password.'; +$_MODULE['<{dejala}prestashop>dejala_483cf1f6e275faa3c29ff20ba6e4407f'] = 'nazione richiesta.'; +$_MODULE['<{dejala}prestashop>dejala_2485b5c3212614c367f862a8e46f4d11'] = 'login deve essere un indirizzo e-mail valido.'; +$_MODULE['<{dejala}prestashop>dejala_dd189cdaa73e88a19f495a0d6c49a61b'] = 'Nome del negozio è obbligatorio.'; +$_MODULE['<{dejala}prestashop>dejala_4876f72a0b3d7f46de2b201ab02cd0a7'] = 'non è un margine valido.'; +$_MODULE['<{dejala}prestashop>dejala_ad5ee5e5c2989c1e72c586a9f8121716'] = 'Errore durante l\'autenticazione del tuo account su Dejala.com. Le tue credenziali non sono state riconosciute'; +$_MODULE['<{dejala}prestashop>dejala_23e0f5b7cc6e26112230c098b893944a'] = 'Impossibile elaborare l\'azione'; +$_MODULE['<{dejala}prestashop>dejala_6bd82dd0c6115429b03dd84828d6ccb2'] = 'Scegli un altro login'; +$_MODULE['<{dejala}prestashop>dejala_0aec12d0e7c8784012ee74606648d625'] = 'Dejala Server non raggiungibile dal tuo server Prestashop. Questo è certamente dovuto ad un limite impostato dal tuo hosting. Contatta il loro supporto tecnico e chiedi se il tuo server è autorizzato ad avviare le connessioni HTTP in uscita'; +$_MODULE['<{dejala}prestashop>dejala_f46fe05842135a72df96c3409cf00683'] = 'Errore durante l\'aggiornamento posizione'; +$_MODULE['<{dejala}prestashop>dejala_2f63af6e20f182573774b785515ccb95'] = 'Errore durante l\'aggiornamento dei contatti'; +$_MODULE['<{dejala}prestashop>dejala_3a29c6eb6abefd3d629290756168d892'] = 'Errore durante l\'aggiornamento dei processi'; +$_MODULE['<{dejala}prestashop>dejala_5f010efe1c8e6cb195205cbf864044aa'] = 'Errore durante l\'aggiornamento dei prodotti'; +$_MODULE['<{dejala}prestashop>dejala_004ac360e91b3dcf50a19a0fd09e3826'] = 'Devi fornire almeno un indirizzo email per limitare la visibilità di Dejala'; +$_MODULE['<{dejala}prestashop>dejala_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{dejala}prestashop>dejala_dfa53d8241c9f6908e669371b50e95f3'] = 'Questo modulo richiede l\'estensione PHP cURL per funzionare correttamente. Si prega di installare l\'estensione PHP \"cURL\" prima'; +$_MODULE['<{dejala}prestashop>dejala_4c7d16a1e83bcbfd9b33e95f8e90a625'] = 'Errore durante l\'autenticazione del tuo account su Dejala.com. Questo può essere dovuto a un problema temporaneo della rete o di piattaforma. Riprova più tardi o contatta Dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_94939d114a8c65173b70b6e01aad11c0'] = 'Errore durante il recupero negozio, riprova più tardi o contatta Dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_41d211dd68bf0f87cf3181b0c8dac6e7'] = 'Dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_3d8764621d6076807b0d60cfcadb7213'] = 'Quando vuoi.... corriere'; +$_MODULE['<{dejala}prestashop>dejala_627db4c965627fb7f03682dbbc43a4a1'] = 'Seleziono la mia data di spedizione quando il mio prodotto è disponibile'; +$_MODULE['<{dejala}prestashop>dejala_07e9ea0147aee652244a280da00efb5a'] = 'Data di spedizione selezionata'; +$_MODULE['<{dejala}prestashop>dejala_47a4dfe5ab79feb7884fa57786ea587c'] = 'a partire da'; +$_MODULE['<{dejala}prestashop>dejala_ba93cc89ba75ee6e74699a49a69c0600'] = 'Data di spedizione non ancora selezionata dal cliente'; +$_MODULE['<{dejala}prestashop>dejala_a240fa27925a635b08dc28c9e4f9216d'] = 'Ordine'; +$_MODULE['<{dejala}prestashop>dejala_296a91ebe13e861efa9bd0f74a927353'] = 'Ordine inviato a Dejala'; +$_MODULE['<{dejala}prestashop>dejala_carrier_21034ae6d01a83e702839a72ba8a77b0'] = '(tasse escl.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_1f87346a16cf80c372065de3c54c86d9'] = '(tasse incl.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_e7a6ca4e744870d455a57b644f696457'] = 'Gratis!'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_21034ae6d01a83e702839a72ba8a77b0'] = '(tasse escl.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_1f87346a16cf80c372065de3c54c86d9'] = '(tasse incl.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_e7a6ca4e744870d455a57b644f696457'] = 'Gratis!'; +$_MODULE['<{dejala}prestashop>dejala_contacts_a766dcf63862aaaa1625a45169aeb37a'] = 'Proprietario negozio'; +$_MODULE['<{dejala}prestashop>dejala_contacts_4e140ba723a03baa6948340bf90e2ef6'] = 'Nome:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_d2cacc542d8dd31bd89f8defed1b55ad'] = 'Nome:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_673ae02fffb72f0fe68a66f096a01347'] = 'Telefono:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_7a31464d87d555a1d5a7d2afdeb64d4e'] = 'Cellulare:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_01401fe9a93df81d28637e5218597b76'] = 'E-Mail:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_7e2121a0b71ccc33c5eeaf11999fdbcd'] = 'Contatto controllo magazzino'; +$_MODULE['<{dejala}prestashop>dejala_contacts_23e44d356bfc0d17f904cb743b4d247c'] = 'Contatto Amministrazione '; +$_MODULE['<{dejala}prestashop>dejala_contacts_527a0a71d5684695421ec3375ec6dba8'] = 'Contatto Manutenzione del sito web '; +$_MODULE['<{dejala}prestashop>dejala_contacts_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_9c8a7900448628ee2978be9a3945d148'] = 'Il tuo credito'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b0ee4c529eda15bdecda8bf189a3c813'] = 'Il tuo credito virtuale (come test)'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_defcb35db6f9bdac29b888bfc07e6386'] = 'euro'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_c2b55c1a6a9880bf1d7cba1914a6da56'] = 'Accredita il tuo account'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_642c4a47922246182590d4f3c8304f35'] = 'Elenco delle ultime consegne'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_01abfc750a0c942167651c40d088531d'] = 'n.'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_67d5168b4f2b5424a3d118ea9ef99372'] = 'Creazione'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_d79cf3f429596f77db95c65074663a54'] = 'ID ordine'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2a033d36697bb24bfc7ece05545d268e'] = 'n. controllo ordine'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b021df6aac4654c454f46c77646e745f'] = 'Etichetta'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_3601146c4e948c32b6424d2c0a7f0118'] = 'Prezzo'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_ec53a8c4f07baed5d8825072c89799be'] = 'Status'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Spedizione'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Descrizione'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2ca8d70baf21b18878843c02a086e46c'] = 'In'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2510c39011c5be704182423e3a695e91'] = 'h'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_d98a07f84921b24ee30f86fd8cd85c3c'] = 'da'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_01b6e20344b68835c5ed1ddedf20d531'] = 'a'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_427c7fb2385f610d26ea90fff86f9a84'] = 'Esportazione in Csv '; +$_MODULE['<{dejala}prestashop>dejala_deliveries_5da618e8e4b89c66fe86e32cdafde142'] = 'Da'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_e12167aa0a7698e6ebc92b4ce3909b53'] = 'Per'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_a60852f204ed8028c1c58808b746d115'] = 'Ok'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_8424d087ffe39bb2ee8db173c7e07ba5'] = 'data creazione'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_d79cf3f429596f77db95c65074663a54'] = 'ID ordine'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_2a033d36697bb24bfc7ece05545d268e'] = 'n. controllo ordine'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_ac27812104f966f43d3a60f37a869338'] = 'descrizione breve'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_78a5eb43deef9a7b5b9ce157b9d52ac4'] = 'prezzo'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_9acb44549b41563697bb490144ec6258'] = 'stato'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_1e6e6626b6e59276b14112ebc34c5d49'] = 'data consegna'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_c20456384feb648b4692b700ec570d42'] = 'limite tempo'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_5c5c8fc67b523e638e0a904d61651f2d'] = 'inizio spedizione'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_8e659923776b8706dbf4636c408e987c'] = 'fine spedizione'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_ba402b48292a61e4d82f85eeaa0904dc'] = 'data consegna'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_7c7f9f48d29519e8cb47ac606a431a65'] = 'ora consegna'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_617283f39e91b6ead659cef3c722cabc'] = 'Preferenze spedizione'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_11d783488db0c358bd9077a2e1a250e7'] = 'Proponi spedizione'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_ffe181130430aff6386df37df36347f8'] = 'immediatamente'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_a3cb1f2ebeda6fa36b27598f1d096f60'] = 'mezza giornata'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_849490640e65410418220e5c179a1477'] = 'un giorno'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_44fdec47036f482b68b748f9d786801b'] = 'giorni'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_6749e3e07aeb12081dc32e581ffcf463'] = 'dopo l\'ordinazione'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_48b4a9d141bcbb3911caa5caf4b750b2'] = 'Visualizza'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_7877adcb96eb8221c075f0008093bbf7'] = 'date'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_b4f86cbc11cb9565374c08c61372f3ad'] = 'giorni nell\'interfaccia di selezione della fascia oraria'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_44a33a70398318da91b789b33152dafa'] = 'Mantenere Dejala attivo quando il carrello è non disponibile'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_767cd99c2f2b9fb9e5aa531c37b45f87'] = 'Abilitare i clienti a scegliere Dejala anche se un prodotto è esaurito (il cliente sceglierà la data della consegna quando l\'ordine sarà pronto)'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{dejala}prestashop>dejala_header_c45abd6f2b5f3b3a954c97f008ccb52c'] = 'Spedisci i tuoi ordini tramite corriere con'; +$_MODULE['<{dejala}prestashop>dejala_header_20e846b603a0b7f1c00b1fc457308fb7'] = 'DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_home_21e71170be5450c6380d7a9fc0ba51c3'] = 'Sei nuovo su Dejala.fr?'; +$_MODULE['<{dejala}prestashop>dejala_home_07965cce4ec6247bd57783dff0af1657'] = 'Il nome del tuo negozio:'; +$_MODULE['<{dejala}prestashop>dejala_home_558f162b01a3d6d31865a1ca91a03d57'] = 'Seleziona il tuo paese:'; +$_MODULE['<{dejala}prestashop>dejala_home_0309a6c666a7a803fdb9db95de71cf01'] = 'Francia'; +$_MODULE['<{dejala}prestashop>dejala_home_907eba32d950bfab68227fd7ea22999b'] = 'Spagna'; +$_MODULE['<{dejala}prestashop>dejala_home_a999205c014634072764fe3fadc4f4ca'] = 'Scegli il tuo login:'; +$_MODULE['<{dejala}prestashop>dejala_home_a7e4228de9b12575b0cd88c4cf0f54f9'] = 'Scegli la tua password:'; +$_MODULE['<{dejala}prestashop>dejala_home_0ba7583639a274c434bbe6ef797115a4'] = 'Registrati'; +$_MODULE['<{dejala}prestashop>dejala_home_72429bbc9acf8e6fcf6132ac1fa20d57'] = 'Ho già un account per il mio negozio:'; +$_MODULE['<{dejala}prestashop>dejala_home_051672911a3f1f05efba78a553ef6fe2'] = 'Login:'; +$_MODULE['<{dejala}prestashop>dejala_home_b341a59d5636ed3d6a819137495b08a0'] = 'Password:'; +$_MODULE['<{dejala}prestashop>dejala_home_e5b47edd743751a81819b7f421639303'] = 'Identificati'; +$_MODULE['<{dejala}prestashop>dejala_home_853fe2c3719fab6d1dde555eb536f649'] = 'Dejala.fr'; +$_MODULE['<{dejala}prestashop>dejala_home_02d222897fd57cbc8154be7b2c41e2ff'] = 'Come promemoria'; +$_MODULE['<{dejala}prestashop>dejala_home_3a40880c274dd353056ce584940d1ca8'] = 'Il tuo nome negozio è'; +$_MODULE['<{dejala}prestashop>dejala_home_55724d105b50b04063a21fba83236de6'] = 'Il tuo login è'; +$_MODULE['<{dejala}prestashop>dejala_home_bbb658f348426b60b3395d5357225112'] = 'Sei nella modalità'; +$_MODULE['<{dejala}prestashop>dejala_home_c8ab370eeab3cf4011e25fa953031e77'] = 'piattaforma di test'; +$_MODULE['<{dejala}prestashop>dejala_home_68279960d4eaab19115d276486e1e1d7'] = 'piattaforma di produzione'; +$_MODULE['<{dejala}prestashop>dejala_home_64baa4dba37ddc4207a777ac53565f06'] = 'Passa alla modalità di test'; +$_MODULE['<{dejala}prestashop>dejala_home_a0802ed7a4e243cc01699e44e0b0b33b'] = 'Passa alla modalità di produzione'; +$_MODULE['<{dejala}prestashop>dejala_home_104cdbe9fcaa62064ecc718b647c2929'] = 'La tua richiesta di modalità live è in fase di elaborazione: Dejala.fr ti contatterà per completare la registrazione.'; +$_MODULE['<{dejala}prestashop>dejala_home_1ccd621bb658777957a0c0ae95b97fc6'] = 'Andare live: chiedi a Dejala.fr di creare account in produzione.'; +$_MODULE['<{dejala}prestashop>dejala_home_9c8a7900448628ee2978be9a3945d148'] = 'Il tuo credito'; +$_MODULE['<{dejala}prestashop>dejala_home_b0ee4c529eda15bdecda8bf189a3c813'] = 'Il tuo credito virtuale (come test)'; +$_MODULE['<{dejala}prestashop>dejala_home_defcb35db6f9bdac29b888bfc07e6386'] = 'euro'; +$_MODULE['<{dejala}prestashop>dejala_home_c2b55c1a6a9880bf1d7cba1914a6da56'] = 'Accredita il tuo account'; +$_MODULE['<{dejala}prestashop>dejala_home_d33b3ef83df48e14035b6927a27a6824'] = 'Dejala NON è visibile a nessun utente'; +$_MODULE['<{dejala}prestashop>dejala_home_8ce5717d0efdee714d5c44eb72559943'] = 'Dejala E\' visibile a tutti gli utenti'; +$_MODULE['<{dejala}prestashop>dejala_home_97f9bae265c399ce4781878d46a5a733'] = 'Dejala E\' visibile SOLO per i seguenti utenti '; +$_MODULE['<{dejala}prestashop>dejala_home_66495952bdab30f6bdc92e318d4f36a6'] = '(Es: a@foo.com, b@bar.com)'; +$_MODULE['<{dejala}prestashop>dejala_home_e49df857f0f92d5dd2f73b9fa54d7308'] = 'Aggiorna la visibilità di Dejala '; +$_MODULE['<{dejala}prestashop>dejala_location_ce9142ea2df85cf8ea4dfda7164e7dcf'] = 'Si prega di specificare l\'indirizzo del tuo magazzino'; +$_MODULE['<{dejala}prestashop>dejala_location_c58b3ccfae7d8991a1bdf33f275d6007'] = '(solo lettura)'; +$_MODULE['<{dejala}prestashop>dejala_location_20dfc4f904ba3c650a578c41f87e7053'] = 'Individua'; +$_MODULE['<{dejala}prestashop>dejala_location_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Società'; +$_MODULE['<{dejala}prestashop>dejala_location_dd7bf230fde8d4836917806aff6a6b27'] = 'Indirizzo'; +$_MODULE['<{dejala}prestashop>dejala_location_783cb853aae6984e51583b3bb80c09d2'] = 'Indirizzo (2)'; +$_MODULE['<{dejala}prestashop>dejala_location_9b514b51d03075005814a33edc74c958'] = 'CAP '; +$_MODULE['<{dejala}prestashop>dejala_location_57d056ed0984166336b7879c2af3657f'] = 'Città'; +$_MODULE['<{dejala}prestashop>dejala_location_bcc254b55c4a1babdf1dcb82c207506b'] = 'Telefono'; +$_MODULE['<{dejala}prestashop>dejala_location_4e186c431f7c016c761c722debb9768e'] = 'Cellulare'; +$_MODULE['<{dejala}prestashop>dejala_location_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Commenti'; +$_MODULE['<{dejala}prestashop>dejala_location_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiornare le impostazioni'; +$_MODULE['<{dejala}prestashop>dejala_menu_8cf04a9734132302f96da8e113e80ce5'] = 'Home'; +$_MODULE['<{dejala}prestashop>dejala_menu_ce5bf551379459c1c61d2a204061c455'] = 'Posizione'; +$_MODULE['<{dejala}prestashop>dejala_menu_9aa698f602b1e5694855cee73a683488'] = 'Contatti'; +$_MODULE['<{dejala}prestashop>dejala_menu_77ea79b4b2638f146bf02ea6dc076006'] = 'Processi'; +$_MODULE['<{dejala}prestashop>dejala_menu_3eb0f1d14d6ec438d91fcfdab94fc1ca'] = 'Opzioni di consegna'; +$_MODULE['<{dejala}prestashop>dejala_menu_e16dd6e118732c5d1586d6aba0b62f3a'] = 'Prezzi'; +$_MODULE['<{dejala}prestashop>dejala_menu_9bbd45bad55cfc620803907f2d8a0217'] = 'Contabilità'; +$_MODULE['<{dejala}prestashop>dejala_menu_36d5423bb12a6d74d1d0f0ba09ef47cb'] = 'Opzioni tecniche'; +$_MODULE['<{dejala}prestashop>dejala_menu_35cf95ca41b6d074cfaeac16b0e0906c'] = 'DEJALA PRO'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_845398bc903ec28114a5f9874d83936b'] = 'Magazzino aperto'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_2084c04f7a380a68b653e5fc82d352f0'] = 'De'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_7fc56270e7a70fa81a5935b72eacbe29'] = 'A'; +$_MODULE['<{dejala}prestashop>dejala_processes_237527ad3e0c9d87f072f2ac3a873dc8'] = 'Specifica le procedure per gestire correttamente le consegne'; +$_MODULE['<{dejala}prestashop>dejala_processes_0f516eb68a85aae932001976c51dee2f'] = 'Sentiti libero di adattare le procedure di default per le procedure dei tuoi affari'; +$_MODULE['<{dejala}prestashop>dejala_processes_dbfdb39c2251ff72f42f7078ab347611'] = 'Indirizzo errato'; +$_MODULE['<{dejala}prestashop>dejala_processes_b1da17cfc7c9a051fe4ce45bf1dd1ace'] = 'Destinatario assente'; +$_MODULE['<{dejala}prestashop>dejala_processes_3ab0370c6e7c3d0ea1cd540e7afacc9a'] = 'Consegna respinta'; +$_MODULE['<{dejala}prestashop>dejala_processes_138a10902b1fec08bcf2d9f5a6f4b02b'] = 'Precauzioni per la consegna '; +$_MODULE['<{dejala}prestashop>dejala_processes_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; +$_MODULE['<{dejala}prestashop>dejala_products_aa83582f6ce84345c97815de714e6ebd'] = 'Imposta i margini per le consegne'; +$_MODULE['<{dejala}prestashop>dejala_products_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{dejala}prestashop>dejala_products_26160d42b371fb091c142cb8cfa09c34'] = 'Prezzo di acquisto'; +$_MODULE['<{dejala}prestashop>dejala_products_f8ca05a1d72f37501747657deecdd15c'] = 'Margine tasse incluse'; +$_MODULE['<{dejala}prestashop>dejala_products_e6f254c2f6e55725e99e1e6dfd6d9caa'] = 'Prezzo cliente'; +$_MODULE['<{dejala}prestashop>dejala_products_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Descrizione'; +$_MODULE['<{dejala}prestashop>dejala_products_1cdad1a5f8e5d09be270415e44c0f039'] = 'Acquista tasse escl.'; +$_MODULE['<{dejala}prestashop>dejala_products_ecef91ba37ffc5f5294ea50efee7c6a2'] = 'Acquista tasse incl.'; +$_MODULE['<{dejala}prestashop>dejala_products_765a24c102d9a0b03eb03c77e90a9144'] = 'Vendi tasse escl.'; +$_MODULE['<{dejala}prestashop>dejala_products_8588719c33b27bd80ae45cc533117c00'] = 'Vendi tasse incl.'; +$_MODULE['<{dejala}prestashop>dejala_products_efeb369cccbd560588a756610865664c'] = 'tra'; +$_MODULE['<{dejala}prestashop>dejala_products_2510c39011c5be704182423e3a695e91'] = 'h'; +$_MODULE['<{dejala}prestashop>dejala_products_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_b44c4d973c20b84bad66d243b215ef37'] = 'Elenco di status che convalidano l\'ordine'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_a296002220093a4833752a3cf94f07d0'] = 'Elenco di status che attivano dejala.fr'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; +$_MODULE['<{dejala}prestashop>dejala_timetable_193993f964d2d4df4b1484227c1626b6'] = 'Scegli il tuo giorno di consegna'; +$_MODULE['<{dejala}prestashop>dejala_timetable_26903e0f192163f4a0957c0b185edf71'] = 'Scegli lai fascia oraria di consegna'; diff --git a/modules/dejala/logo.gif b/modules/dejala/logo.gif new file mode 100755 index 00000000..72db5e1a Binary files /dev/null and b/modules/dejala/logo.gif differ diff --git a/modules/dejala/picto_0.gif b/modules/dejala/picto_0.gif new file mode 100755 index 00000000..47feaa28 Binary files /dev/null and b/modules/dejala/picto_0.gif differ diff --git a/modules/dejala/picto_1.gif b/modules/dejala/picto_1.gif new file mode 100755 index 00000000..41827736 Binary files /dev/null and b/modules/dejala/picto_1.gif differ diff --git a/modules/dejala/picto_2.gif b/modules/dejala/picto_2.gif new file mode 100755 index 00000000..b018d159 Binary files /dev/null and b/modules/dejala/picto_2.gif differ diff --git a/modules/dejala/picto_3.gif b/modules/dejala/picto_3.gif new file mode 100755 index 00000000..2df2d0fd Binary files /dev/null and b/modules/dejala/picto_3.gif differ diff --git a/modules/dejala/picto_4.gif b/modules/dejala/picto_4.gif new file mode 100755 index 00000000..3853644d Binary files /dev/null and b/modules/dejala/picto_4.gif differ diff --git a/modules/dejala/picto_5.gif b/modules/dejala/picto_5.gif new file mode 100755 index 00000000..6eb0ee74 Binary files /dev/null and b/modules/dejala/picto_5.gif differ diff --git a/modules/dejala/picto_6.gif b/modules/dejala/picto_6.gif new file mode 100755 index 00000000..e3fdc0a0 Binary files /dev/null and b/modules/dejala/picto_6.gif differ diff --git a/modules/dejala/picto_7.gif b/modules/dejala/picto_7.gif new file mode 100755 index 00000000..93262854 Binary files /dev/null and b/modules/dejala/picto_7.gif differ diff --git a/modules/dejala/picto_8.gif b/modules/dejala/picto_8.gif new file mode 100755 index 00000000..f75ea966 Binary files /dev/null and b/modules/dejala/picto_8.gif differ diff --git a/modules/dejala/submenu-bg.gif b/modules/dejala/submenu-bg.gif new file mode 100755 index 00000000..c3de2cfc Binary files /dev/null and b/modules/dejala/submenu-bg.gif differ diff --git a/modules/dejala/timetable.css b/modules/dejala/timetable.css new file mode 100755 index 00000000..e34f693f --- /dev/null +++ b/modules/dejala/timetable.css @@ -0,0 +1,49 @@ +/* MFR081108 - Shipping Preferences */ +#shipping_now { + width:99%; + height:25px; + border:1px solid lightgrey; + margin-top:5; + padding-top:10px; +} + +#shipping_div { + width:100%; +} + +#shipping_dates { + width:100%; + float:left; + border:1px solid lightgrey; +} + +#shipping_dates div { + height:25px; + width:24.9%; + margin-top:5px; + float:left; + padding-top:10px; +} + +#shipping_hours { + float:left; + width:100%; + border:1px solid lightgrey; + margin-top:5px; +} + +#shipping_hours div { + height:31px; + width:19.9%; + float:left; + padding-top:10px; +} + +.title { + margin:5px; + font-size:1.1em; + font-weight:bold; + color:#993300; +} + +#shipping_pref input {border:none;} diff --git a/modules/dejala/timetable.js b/modules/dejala/timetable.js new file mode 100755 index 00000000..587f6a1a --- /dev/null +++ b/modules/dejala/timetable.js @@ -0,0 +1,104 @@ +/* Cache les heures non dispo pour le jour dayIndex */ +function hideUnusedHours(dayIndex){ + var i = 0; + var t_obj = document.getElementById('divhr0'); + + while (t_obj) + { + var cal = djl_calendar[dayIndex]; + var calStart = 0; + var calStop = 0; + if (cal) { + if (cal[2]) + calStart = djl_calendar[dayIndex][2]; + if (cal[3]) + calStop = djl_calendar[dayIndex][3]; + } + + if ( (i >= calStart) && (i <= calStop) ) { + t_obj.style.display = ''; + } else { + t_obj.style.display = 'none'; + } + i++; + t_obj = document.getElementById('divhr' + i); + } +} + +/* Sélectionne un des jours par son index */ +function selectDay(dayIndex) +{ + var i = 0; + var t_obj = document.getElementById('shipd0'); + var currentShipd = document.getElementById('shipd'+deliveryDateSelected); + if (currentShipd) { + currentShipd.parentNode.style.fontWeight=''; + currentShipd.parentNode.style.color = ''; + } + while (t_obj) + { + t_obj.checked = false; + if (i == dayIndex) + t_obj.checked = true; + i++; + t_obj = document.getElementById('shipd' + i); + } + deliveryDateSelected = dayIndex; + currentShipd = document.getElementById('shipd'+deliveryDateSelected); + if (currentShipd) { + currentShipd.parentNode.style.fontWeight='bold'; + currentShipd.parentNode.style.color = '#993300'; + } + hideUnusedHours(dayIndex); + + var currentShipHr = document.getElementById('shiphr' + deliveryHourSelected); + if (!currentShipHr || currentShipHr.parentNode.parentNode.style.display == 'none') { + var cal = djl_calendar[dayIndex]; + var calStart = 9; + if (cal) { + if (cal[2]) + calStart = djl_calendar[dayIndex][2]; + selectHour(calStart); + } + } +} + + +function selectHour(hourIndex) +{ + var i = 0; + var t_obj = document.getElementById('shiphr0'); + var currentShipHr = document.getElementById('shiphr' + deliveryHourSelected); + if (currentShipHr) { + currentShipHr.parentNode.style.fontWeight=''; + currentShipHr.parentNode.style.color = ''; + } + while (t_obj) + { + t_obj.checked = false; + if (i == hourIndex) + t_obj.checked = true; + i++; + t_obj = document.getElementById('shiphr' + i); + } + deliveryHourSelected = hourIndex; + currentShipHr = document.getElementById('shiphr' + deliveryHourSelected); + if (currentShipHr) { + currentShipHr.parentNode.style.fontWeight='bold'; + currentShipHr.parentNode.style.color = '#993300'; + } +} + +/** + toggle element visibility : make it visible if to_which is 1 and element is not visible, otherwise make it invisible +**/ +function toggle_visibility(eltId, to_which) +{ + var elt = $('div#' + eltId) ; + if (to_which == 1 && elt.get(0).style.display == 'none') { + elt.slideDown(); + } + else if (to_which == 0 && elt.get(0).style.display != 'none') { + elt.slideUp(); + } +} diff --git a/modules/dibs/de.php b/modules/dibs/de.php new file mode 100755 index 00000000..0e259c82 --- /dev/null +++ b/modules/dibs/de.php @@ -0,0 +1,43 @@ +dibs_b508edd89d96e13df300b298143998d3'] = 'DIBS'; +$_MODULE['<{dibs}prestashop>dibs_ef3a95ad5c00ef1b4d1d73d2b50bf54c'] = 'DIBS Zahlung API'; +$_MODULE['<{dibs}prestashop>dibs_f146cc67c82721f372d15664a9e4a0d6'] = 'Aus Sicherheitsgründen müssen Sie die Schlüssel Nr. 1 und 2, die von der MD5-Kontrolle von DIBS API verwendet werden, einstellen.'; +$_MODULE['<{dibs}prestashop>dibs_94c824556baeddc9d8a31710c38fb045'] = 'Sie müssen Ihre Händler-ID einstellen, um DIBS API nutzen zu können.'; +$_MODULE['<{dibs}prestashop>dibs_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Konfiguration aktualisiert'; +$_MODULE['<{dibs}prestashop>dibs_323d72a644340f9f2152febe46a52259'] = 'Ein DIBS-Konto erhalten'; +$_MODULE['<{dibs}prestashop>dibs_a24f296af38bde709dffc364b28bdebb'] = 'Klicken Sie bitte auf den Link, um den DIBS Anmeldeformular zu sehen:'; +$_MODULE['<{dibs}prestashop>dibs_97e7c9a7d06eac006a28bf05467fcc8b'] = 'Link'; +$_MODULE['<{dibs}prestashop>dibs_d826f3c7dc81b9d9b855f34bb855d9f6'] = 'Je nach Sprache und Land Regeln, können Abo-Parameter unterschiedlich sein.'; +$_MODULE['<{dibs}prestashop>dibs_d076f6d79396f176263a61ad3a1fe945'] = 'Bitte klicken Sie auf die entsprechende Flagge:'; +$_MODULE['<{dibs}prestashop>dibs_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{dibs}prestashop>dibs_794b8837b6ee6ddc4301f557915f9486'] = 'Logo-Farbe'; +$_MODULE['<{dibs}prestashop>dibs_44e1ec6255a91754e4911b16b9fc4d22'] = 'Die Grundfarbe des Logos, das auf der Zahlungsseite angezeigt wird.'; +$_MODULE['<{dibs}prestashop>dibs_229a7ec501323b94db7ff3157a7623c9'] = 'Händler-ID'; +$_MODULE['<{dibs}prestashop>dibs_b305acae66879c527cda4c4ded662585'] = 'Die von DIBS geschickte E-Mail sehen'; +$_MODULE['<{dibs}prestashop>dibs_310fc01b7a8c167aa514ccccc9e46e99'] = 'Sicherheitsschlüssel Nr. 1'; +$_MODULE['<{dibs}prestashop>dibs_247cc6885be1cb649d05acf81242cc35'] = 'Sicherheitsschlüssel Nr. 2'; +$_MODULE['<{dibs}prestashop>dibs_c7138fc31d63f966e368147a0cd4e55d'] = 'Diese Schlüssel werden für eine Verbesserung der Sicherheit eingesetzt.'; +$_MODULE['<{dibs}prestashop>dibs_b89642757f7199e37e74dd6a9a333733'] = 'Um diese Schlüssel zu erhalten, gehen auf die DIBS-Administrationsoberfläche zu Integration > MD5 Schlüsselmenü . Bitte stellen Sie sicher, dass die MD5-Kontrolle aktiviert ist, sonst funktioniert das Modul nicht .'; +$_MODULE['<{dibs}prestashop>dibs_f9986472f2190b1ec04c52dd1eca1af4'] = 'Verwenden Sie das DIBS-Testmodul'; +$_MODULE['<{dibs}prestashop>dibs_313ada9ae4162978238c99d505bb6870'] = 'Sobald dieses Feld mitgeteilt ist, wird die Transaktion nicht zum Karteninhaber weitergeleitet, sondern wird anstattdessen vom DIBS-Testmodul bearbeitet.'; +$_MODULE['<{dibs}prestashop>dibs_41f538d798be040c3710e4e128105ad2'] = 'Siehe auch Schritt 5 der 10 Schritt-Anleitung für weitere Informationen.'; +$_MODULE['<{dibs}prestashop>dibs_9d0ac8297882a62456cd41249c36d9af'] = 'Während Ihrer ersten Integration mit DIBS ist es nicht nötig, diese Einstellung einzugeben, da sämtliche Standardtransaktionen zunächst auf das DIBS-Testsystem treffen, bis DIBS die Integration genehmigt hat. Falls das Testsystem zu einem späteren Zeitpunkt verwendet wird, wird dies bei DIBS aktiviert (kontaktieren Sie den DIBS-Support, um das Testmodul Ihres Shops zu reaktivieren).'; +$_MODULE['<{dibs}prestashop>dibs_58768109d694bef3c059544892118901'] = 'Flexwin-Farbe'; +$_MODULE['<{dibs}prestashop>dibs_37b0d284e5d29973b385ca537272ec38'] = 'Die Grundfarbe von FlexWin.'; +$_MODULE['<{dibs}prestashop>dibs_2e2b79996d4fb73bff9b97725ddfbab8'] = 'Akzeptierte URL'; +$_MODULE['<{dibs}prestashop>dibs_0e260f9297ec338abbf671829d53c4ae'] = 'Die URL der Seite, die angezeigt werden soll, wenn der Kauf genehmigt ist.'; +$_MODULE['<{dibs}prestashop>dibs_fcb9c3f1b9731de08442d81583782db7'] = 'Gelöschte URL'; +$_MODULE['<{dibs}prestashop>dibs_491f74497aaca60ae31a327d12d52925'] = 'Die URL der Seite, die angezeigt werden soll, wenn der Kunde den Zahlungsvorgang abbricht.'; +$_MODULE['<{dibs}prestashop>dibs_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren'; +$_MODULE['<{dibs}prestashop>dibs_b64af11b4f643164b0b418c716a6f7a0'] = 'Mit dibs zahlen'; +$_MODULE['<{dibs}prestashop>dibs_fda89beb6740540db1053016d96624c3'] = 'dibs Logo'; +$_MODULE['<{dibs}prestashop>dibs_eeaf35c1eb180cc38a77b892a96d7ed3'] = 'Bezahlen Sie sicher und schnell mit dibs.'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Ihre Bestellung vom'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'ist abgeschlossen.'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Ihre Bestellung wird so schnell wie möglich zugeschickt.'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Bei Fragen oder für weitere Informationen, kontaktieren Sie bitte unseren'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Kunden-Support'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Wir haben bei Ihrer Bestellung ein Problem festgestellt. Wenn Sie denken, dies sei ein Fehler, können Sie an unseren'; diff --git a/modules/dibs/dibs.jpg b/modules/dibs/dibs.jpg new file mode 100755 index 00000000..31d9db63 Binary files /dev/null and b/modules/dibs/dibs.jpg differ diff --git a/modules/dibs/dibs.php b/modules/dibs/dibs.php new file mode 100755 index 00000000..b8689958 --- /dev/null +++ b/modules/dibs/dibs.php @@ -0,0 +1,414 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 8138 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) + exit; + +class dibs extends PaymentModule +{ + /** + * @var string set the merchant id sent by DIBS e-mail after subscription + * @staticvar + */ + public static $ID_MERCHANT; + + /** + * The URL of the page to be displayed if the purchase is approved. + * @var string + * @staticvar + */ + private static $ACCEPTED_URL = ''; + + /** + * The URL of the page to be displayed if the customer cancels the payment. + * @var string + * @staticvar + */ + private static $CANCELLED_URL = ''; + + /** + * Set the testing mode. + * @var string + */ + private static $TESTING; + + /** + * define more settings values, set for new version which probably. + * @var array + */ + public static $MORE_SETTINGS; + + /** + * @var string + * @staticvar + */ + private static $site_url; + /** + * Set the smarty object + * @var Smarty + */ + private $smarty; + + /** + * Only this langs array are allowed in DIBS API + * @var array + */ + private static $accepted_lang = array('da','en','es','fi','fo','fr','it','nl','no','pl','sv'); + + /** + * Formular link to DIBS subscription + * @var array + */ + public static $dibs_subscription_link = array( + 'fr' => 'http://www.dibspayment.com/order/fr_request/', + 'en' => 'http://www.dibspayment.com/order/uk_request_2eng', + 'da' => 'http://www.dibs.dk/bestil/internet/', + 'sv' => 'http://www.dibs.se/bestall/internet/', + 'no' => 'http://www.dibs.no/bestill/internett/', + ); + + public function __construct() + { + global $smarty; + $this->smarty = $smarty; + $this->name = 'dibs'; + $this->tab = 'payments_gateways'; + $this->version = '1.1'; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('DIBS'); + $this->description = $this->l('DIBS payment API'); + + if (self::$site_url === NULL) + { + if(method_exists('Tools', 'getProtocol')) + self::$site_url = Tools::htmlentitiesutf8(Tools::getProtocol().$_SERVER['HTTP_HOST'].__PS_BASE_URI__); + else + self::$site_url = Tools::htmlentitiesutf8((!is_null($use_ssl) && $use_ssl ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].__PS_BASE_URI__); + } + + self::$ID_MERCHANT = Configuration::get('DIBS_ID_MERCHANT'); + self::$ACCEPTED_URL = Configuration::get('DIBS_ACCEPTED_URL'); + self::$CANCELLED_URL = Configuration::get('DIBS_CANCELLED_URL'); + self::$TESTING = (int)Configuration::get('DIBS_TESTING'); + self::$MORE_SETTINGS = Configuration::get('DIBS_MORE_SETTINGS') != '' ? unserialize(Tools::htmlentitiesDecodeUTF8(Configuration::get('DIBS_MORE_SETTINGS'))) : array(); + + if (!isset(self::$MORE_SETTINGS['k1']) + OR (isset(self::$MORE_SETTINGS['k1']) AND (self::$MORE_SETTINGS['k1'] === '' OR self::$MORE_SETTINGS['k2'] === '') )) + $this->warning = $this->l('For security reasons, you must set key #1 and key #2 used by MD5 control of DIBS API.'); + if (!self::$ID_MERCHANT OR self::$ID_MERCHANT === '') + $this->warning = $this->l('You have to set your merchant ID to use DIBS API.'); + + /* For 1.4.3 and less compatibility */ + $updateConfig = array('PS_OS_CHEQUE', 'PS_OS_PAYMENT', 'PS_OS_PREPARATION', 'PS_OS_SHIPPING', 'PS_OS_CANCELED', 'PS_OS_REFUND', 'PS_OS_ERROR', 'PS_OS_OUTOFSTOCK', 'PS_OS_BANKWIRE', 'PS_OS_PAYPAL', 'PS_OS_WS_PAYMENT'); + if (!Configuration::get('PS_OS_PAYMENT')) + foreach ($updateConfig as $u) + if (!Configuration::get($u) && defined('_'.$u.'_')) + Configuration::updateValue($u, constant('_'.$u.'_')); + } + + public function install() + { + return (parent::install() + AND $this->registerHook('orderConfirmation') + AND $this->registerHook('payment') + AND Configuration::updateValue('DIBS_ACCEPTED_URL', self::$site_url.(substr(trim(self::$site_url), -1, 1) === '/' ? '' : '/').'order-confirmation.php') + AND Configuration::updateValue('DIBS_CANCELLED_URL', self::$site_url) + AND Configuration::updateValue('DIBS_TESTING', 1) + AND Configuration::updateValue('DIBS_MORE_SETTINGS', Tools::htmlentitiesUTF8(serialize(array('flexwin_color' => 'blue', 'logo_color' => 'black', 'k1' => '', 'k2' => ''))), true)); + } + + public function uninstall() + { + return (parent::uninstall() + AND Configuration::deleteByName('DIBS_ACCEPTED_URL') + AND Configuration::deleteByName('DIBS_ID_MERCHANT') + AND Configuration::deleteByName('DIBS_CANCELLED_URL') + AND Configuration::deleteByName('DIBS_TESTING') + AND Configuration::deleteByName('DIBS_MORE_SETTINGS')); + } + + public function hookOrderConfirmation($params) + { + if (!$this->active) + return; + if ($params['objOrder']->module != $this->name) + return; + + if ($params['objOrder']->valid) + $this->smarty->assign(array('status' => 'ok', 'id_order' => $params['objOrder']->id)); + else + $this->smarty->assign('status', 'failed'); + return $this->display(__FILE__, 'hookorderconfirmation.tpl'); + } + + private function preProcess() + { + if (Tools::isSubmit('submitModule')) + { + self::$ID_MERCHANT = (Tools::getValue('idMerchant') !== '' ? Tools::getValue('idMerchant') : self::$ID_MERCHANT); + self::$ACCEPTED_URL = ((Validate::isUrl(Tools::getValue('acceptedUrl'))) ? Tools::getValue('acceptedUrl') : self::$ACCEPTED_URL); + self::$CANCELLED_URL = ((Validate::isUrl(Tools::getValue('cancelledUrl'))) ? Tools::getValue('cancelledUrl') : self::$CANCELLED_URL); + self::$TESTING = (int)isset($_POST['testing']); + self::$MORE_SETTINGS['flexwin_color'] = Tools::getValue('flexwin_color'); + self::$MORE_SETTINGS['logo_color'] = Tools::getValue('logo_color'); + self::$MORE_SETTINGS['k1'] = Tools::getValue('k1'); + self::$MORE_SETTINGS['k2'] = Tools::getValue('k2'); + + Configuration::updateValue('DIBS_ID_MERCHANT', self::$ID_MERCHANT); + Configuration::updateValue('DIBS_ACCEPTED_URL', self::$ACCEPTED_URL); + Configuration::updateValue('DIBS_CANCELLED_URL', self::$CANCELLED_URL); + Configuration::updateValue('DIBS_TESTING', self::$TESTING); + Configuration::updateValue('DIBS_MORE_SETTINGS', Tools::htmlentitiesUTF8(serialize(self::$MORE_SETTINGS))); + + $data_sync = ''; + if (self::$ID_MERCHANT !== '' AND self::$TESTING !== 1 AND self::$MORE_SETTINGS['k1'] !== '' AND self::$MORE_SETTINGS['k2'] !== '') + $data_sync = ''; + + echo '
+
+
+ {l s='Pay with dibs' mod='dibs'}
{l s='Pay safely and quickly with dibs.' mod='dibs'}
+
{l s='Your order on' mod='dibs'} {$shop_name} {l s='is complete.' mod='dibs'}
+
{l s='Your order will be sent as soon as possible.' mod='dibs'}
+
{l s='For any questions or for further information, please contact our' mod='dibs'} {l s='customer support' mod='dibs'}.
+
+ {l s='We noticed a problem with your order. If you think this is an error, you can contact our' mod='dibs'} + {l s='customer support' mod='dibs'}. +
+{/if} \ No newline at end of file diff --git a/modules/dibs/img/da.jpg b/modules/dibs/img/da.jpg new file mode 100755 index 00000000..add78c62 Binary files /dev/null and b/modules/dibs/img/da.jpg differ diff --git a/modules/dibs/img/en.jpg b/modules/dibs/img/en.jpg new file mode 100755 index 00000000..72b962fa Binary files /dev/null and b/modules/dibs/img/en.jpg differ diff --git a/modules/dibs/img/fr.jpg b/modules/dibs/img/fr.jpg new file mode 100755 index 00000000..4cd7f380 Binary files /dev/null and b/modules/dibs/img/fr.jpg differ diff --git a/modules/dibs/img/index.php b/modules/dibs/img/index.php new file mode 100755 index 00000000..b559f985 --- /dev/null +++ b/modules/dibs/img/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 7233 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; \ No newline at end of file diff --git a/modules/dibs/img/no.jpg b/modules/dibs/img/no.jpg new file mode 100755 index 00000000..82311e5a Binary files /dev/null and b/modules/dibs/img/no.jpg differ diff --git a/modules/dibs/img/sv.jpg b/modules/dibs/img/sv.jpg new file mode 100755 index 00000000..28f0b03e Binary files /dev/null and b/modules/dibs/img/sv.jpg differ diff --git a/modules/dibs/index.php b/modules/dibs/index.php new file mode 100755 index 00000000..b559f985 --- /dev/null +++ b/modules/dibs/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 7233 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; \ No newline at end of file diff --git a/modules/dibs/it.php b/modules/dibs/it.php new file mode 100755 index 00000000..307e02b2 --- /dev/null +++ b/modules/dibs/it.php @@ -0,0 +1,43 @@ +dibs_b508edd89d96e13df300b298143998d3'] = 'DIBS'; +$_MODULE['<{dibs}prestashop>dibs_ef3a95ad5c00ef1b4d1d73d2b50bf54c'] = 'DIBS pagamento API'; +$_MODULE['<{dibs}prestashop>dibs_f146cc67c82721f372d15664a9e4a0d6'] = 'Per ragioni di sicurezza devi impostare la chiave n. 1 e n. 2 utilizzate dal controllo MD5 di DIBS API.'; +$_MODULE['<{dibs}prestashop>dibs_94c824556baeddc9d8a31710c38fb045'] = 'Devi impostare il tuo ID commerciante per utilizzare DIBS API.'; +$_MODULE['<{dibs}prestashop>dibs_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configurazione aggiornata'; +$_MODULE['<{dibs}prestashop>dibs_323d72a644340f9f2152febe46a52259'] = 'Ottieni un account DIBS'; +$_MODULE['<{dibs}prestashop>dibs_a24f296af38bde709dffc364b28bdebb'] = 'Clicca sul link seguente per accedere al modulo di sottoscrizione DIBS:'; +$_MODULE['<{dibs}prestashop>dibs_97e7c9a7d06eac006a28bf05467fcc8b'] = 'Link'; +$_MODULE['<{dibs}prestashop>dibs_d826f3c7dc81b9d9b855f34bb855d9f6'] = 'A seconda lingua e norme del paese, i parametri di sottoscrizione possono essere diverse.'; +$_MODULE['<{dibs}prestashop>dibs_d076f6d79396f176263a61ad3a1fe945'] = 'Clicca sulle bandiere corrette:'; +$_MODULE['<{dibs}prestashop>dibs_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{dibs}prestashop>dibs_794b8837b6ee6ddc4301f557915f9486'] = 'Colore logo'; +$_MODULE['<{dibs}prestashop>dibs_44e1ec6255a91754e4911b16b9fc4d22'] = 'Il colore di base del logo che appare sulla pagina di pagamento.'; +$_MODULE['<{dibs}prestashop>dibs_229a7ec501323b94db7ff3157a7623c9'] = 'ID commerciante'; +$_MODULE['<{dibs}prestashop>dibs_b305acae66879c527cda4c4ded662585'] = 'Vedi l\'e-mail inviata da DIBS.'; +$_MODULE['<{dibs}prestashop>dibs_310fc01b7a8c167aa514ccccc9e46e99'] = 'Chiave di sicurezza n. 1'; +$_MODULE['<{dibs}prestashop>dibs_247cc6885be1cb649d05acf81242cc35'] = 'Chiave di sicurezza n. 2'; +$_MODULE['<{dibs}prestashop>dibs_c7138fc31d63f966e368147a0cd4e55d'] = 'Queste chiavi sono usate per migliorare la sicurezza.'; +$_MODULE['<{dibs}prestashop>dibs_b89642757f7199e37e74dd6a9a333733'] = 'Per ottenere queste chiavi vai all\'interfaccia di amministrazione DIBS e nel menu Integrazione > chiavi MD5 . Assicurati che il controllo MD5 sia attivato, altrimenti il modulo non funzionerà.'; +$_MODULE['<{dibs}prestashop>dibs_f9986472f2190b1ec04c52dd1eca1af4'] = 'Usa il modulo di test DIBS'; +$_MODULE['<{dibs}prestashop>dibs_313ada9ae4162978238c99d505bb6870'] = 'Quando questo campo è dichiarato, la transazione non viene inviata all\'emittente della carta, ma è invece gestita dal modulo di prova DIBS.'; +$_MODULE['<{dibs}prestashop>dibs_41f538d798be040c3710e4e128105ad2'] = 'Per ulteriori informazioni vedi anche la Fase 5 della Guida in 10 Fasi.'; +$_MODULE['<{dibs}prestashop>dibs_9d0ac8297882a62456cd41249c36d9af'] = 'Durante la tua prima integrazione con DIBS, non vi è alcuna necessità di inserire questo parametro, dal momento che tutte le operazioni di default riguarderanno il sistema di test DIBS fino a che DIBS ha approvato l\'integrazione. Qualora il sistema di test fosse utilizzato in un secondo momento, questo sarà attivato a DIBS (contatta il supporto DIBS per riattivare la modalità di prova del tuo negozio) .'; +$_MODULE['<{dibs}prestashop>dibs_58768109d694bef3c059544892118901'] = 'Colore Flexwin '; +$_MODULE['<{dibs}prestashop>dibs_37b0d284e5d29973b385ca537272ec38'] = 'Il tema colore base di FlexWin.'; +$_MODULE['<{dibs}prestashop>dibs_2e2b79996d4fb73bff9b97725ddfbab8'] = 'Url accettato'; +$_MODULE['<{dibs}prestashop>dibs_0e260f9297ec338abbf671829d53c4ae'] = 'L\'URL della pagina da visualizzare se l\'acquisto è approvato.'; +$_MODULE['<{dibs}prestashop>dibs_fcb9c3f1b9731de08442d81583782db7'] = 'Url annullato '; +$_MODULE['<{dibs}prestashop>dibs_491f74497aaca60ae31a327d12d52925'] = 'L\'URL della pagina da visualizzare se il cliente annulla il pagamento.'; +$_MODULE['<{dibs}prestashop>dibs_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; +$_MODULE['<{dibs}prestashop>dibs_b64af11b4f643164b0b418c716a6f7a0'] = 'Paga con dibs'; +$_MODULE['<{dibs}prestashop>dibs_fda89beb6740540db1053016d96624c3'] = 'logo dibs'; +$_MODULE['<{dibs}prestashop>dibs_eeaf35c1eb180cc38a77b892a96d7ed3'] = 'Paga in modo sicuro e veloce con dibs.'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Il tuo ordine '; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'è completo.'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Il tuo ordine verrà inviato al più presto.'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Per eventuali domande o per ulteriori informazioni, contatta la nostra'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'assistenza clienti'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Abbiamo notato un problema con il tuo ordine. Se pensi che sia un errore, contatta la nostra'; diff --git a/modules/dibs/logo.gif b/modules/dibs/logo.gif new file mode 100755 index 00000000..f658014e Binary files /dev/null and b/modules/dibs/logo.gif differ diff --git a/modules/dibs/logos/dibs_black.jpg b/modules/dibs/logos/dibs_black.jpg new file mode 100755 index 00000000..3b3159da Binary files /dev/null and b/modules/dibs/logos/dibs_black.jpg differ diff --git a/modules/dibs/logos/dibs_blue.jpg b/modules/dibs/logos/dibs_blue.jpg new file mode 100755 index 00000000..cb55d111 Binary files /dev/null and b/modules/dibs/logos/dibs_blue.jpg differ diff --git a/modules/dibs/logos/dibs_green.jpg b/modules/dibs/logos/dibs_green.jpg new file mode 100755 index 00000000..14a812d8 Binary files /dev/null and b/modules/dibs/logos/dibs_green.jpg differ diff --git a/modules/dibs/logos/dibs_grey.jpg b/modules/dibs/logos/dibs_grey.jpg new file mode 100755 index 00000000..a8263d9b Binary files /dev/null and b/modules/dibs/logos/dibs_grey.jpg differ diff --git a/modules/dibs/logos/dibs_purple.jpg b/modules/dibs/logos/dibs_purple.jpg new file mode 100755 index 00000000..6e312b8b Binary files /dev/null and b/modules/dibs/logos/dibs_purple.jpg differ diff --git a/modules/dibs/logos/dibs_yellow.jpg b/modules/dibs/logos/dibs_yellow.jpg new file mode 100755 index 00000000..93de6e20 Binary files /dev/null and b/modules/dibs/logos/dibs_yellow.jpg differ diff --git a/modules/dibs/logos/index.php b/modules/dibs/logos/index.php new file mode 100755 index 00000000..b559f985 --- /dev/null +++ b/modules/dibs/logos/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 7233 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; \ No newline at end of file diff --git a/modules/dibs/validation.php b/modules/dibs/validation.php new file mode 100755 index 00000000..f28591f6 --- /dev/null +++ b/modules/dibs/validation.php @@ -0,0 +1,47 @@ + $value) + if (is_string($value) AND in_array($key, $required_fields) AND $key !== 'HTTP_COOKIE') + $message .= $key.': '.$value."\n"; + if (sizeof($errors)) + { + $message .= sizeof($errors).' error(s):'."\n"; + $valid_order = false; + } + + foreach ($errors AS $error) + $message .= $error."\n"; + $message = nl2br(strip_tags($message)); + if ($valid_order === true) + $obj_dibs->validateOrder((int)$posted_values['orderid'], Configuration::get('PS_OS_PAYMENT'), (float)((int)$posted_values['amount'] / 100), $obj_dibs->displayName, $message, array(), NULL, false, $secure_cart[2]); + if ($valid_order === false) + $obj_dibs->validateOrder((int)$posted_values['orderid'], Configuration::get('PS_OS_ERROR'), 0, $obj_dibs->displayName, $message, array(), NULL, false, $secure_cart[2]); +} \ No newline at end of file diff --git a/modules/eanmanager/AdminEANManager.php b/modules/eanmanager/AdminEANManager.php new file mode 100755 index 00000000..3c527d90 --- /dev/null +++ b/modules/eanmanager/AdminEANManager.php @@ -0,0 +1,311 @@ +_html .= ' + + + + + + + ++ | '.$this->l('ID').' | +'.$this->l('EAN').' | +'.$this->l('Reference').' | +'.$this->l('Name').' | +'.$this->l('New EAN').' | +
---|---|---|---|---|---|
+ | '.$product->id.' '.$attr['id_product_attribute'].' |
+ '.(!empty($attr['ean13'])? $attr['ean13']: ''.$product->ean13).''.' | +'.((string) $attr['reference'] == ''? $product->reference: $attr['reference']).' | +'.$product->name.$attr['name'].' | ++ |
+ | '.$product->id.' | +'.$product->ean13.' | +'.$product->reference.' | +'.$product->name.' | ++ |
+ | EAN | +Référence | +Nom | +Nouvel EAN | +
---|---|---|---|---|
+ | '.(!empty($attr['ean13'])? $attr['ean13']: ''.$product->ean13).''.' | +'.((string) $attr['reference'] == ''? $product->reference: $attr['reference']).' | +'.$product->name.$attr['name'].' | ++ |
+ | '.$product->ean13.' | +'.$product->reference.' | +'.$product->name.' | ++ |
'.$this->l('You have to configure "General Settings" tab before using this tab.').'
'.$this->l('Your categories have already been configured.').'
+ '; + + // Display eBay Categories + if (!Configuration::get('EBAY_CATEGORY_LOADED')) + { + $ebay = new eBayRequest(); + $ebay->saveCategories(); + Configuration::updateValue('EBAY_CATEGORY_LOADED', 1); + Configuration::updateValue('EBAY_CATEGORY_LOADED_DATE', date('Y-m-d H:i:s')); + } + + + // Loading categories + $categoryConfigList = array(); + $categoryConfigListTmp = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'ebay_category_configuration`'); + foreach ($categoryConfigListTmp as $c) + $categoryConfigList[$c['id_category']] = $c; + $categoryList = $this->_getChildCategories(Category::getCategories($cookie->id_lang), 0); + $eBayCategoryList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'ebay_category` WHERE `id_category_ref` = `id_category_ref_parent`'); + + + // Display header + $html = ''.$this->l('To export your products on eBay, you have to associate each one of your shop categories to an eBay category. You can also define an impact of your price on eBay.').'
'.$this->l('Beware : Only product default categories are used for this configuration.').'
+ * Certaines catégories bénéficient du nouveau format d’annonces multi-versions qui permet de publier 1 seule annonce pour plusieurs versions du même produit.
+ Pour les catégories ne bénéficiant pas de ce format multi-versions, une annonce sera créée pour chaque version du produit.
+ Cliquez ici pour plus d’informations sur les catégories multi-versions
+
'.$this->l('You have to configure "General Settings" tab before using this tab.').'
'.$this->l('You have to configure "General Settings" tab before using this tab.').'
'.$this->l('You have to configure "Categories Settings" tab before using this tab.').'
'.$this->l('You have to configure "General Settings" tab before using this tab.').'
'.$dateLastImport.'
+ '.$this->l('Order Ref eBay').' : '.$order['id_order_ref'].'
+ '.$this->l('Id Order Seller').' : '.$order['id_order_seller'].'
+ '.$this->l('Amount').' : '.$order['amount'].'
+ '.$this->l('Status').' : '.$order['status'].'
+ '.$this->l('Date').' : '.$order['date'].'
+ '.$this->l('E-mail').' : '.$order['email'].'
+ '.$this->l('Products').' :
';
+ if (isset($order['product_list']) && count($order['product_list']) > 0)
+ {
+ $html .= '
'.$this->l('Id Product').' | +'.$this->l('Id Product Attribute').' | +'.$this->l('Quantity').' | '.$this->l('Price').' |
'.$product['id_product'].' | +'.$product['id_product'].' | +'.$product['quantity'].' | +'.$product['price'].' |
Si vous avez des suggestions sur le module eBay, veuillez les postez sur le Forum http://www.prestashop.com/forums/viewforum/134/ebay/
Plus d’infos et tous les liens sur www.inscriptionpro.com
A noter : dès votre inscription en tant que professionnel sur eBay.fr, vous recevrez automatiquement un email (dans les 48h) de notre service dédié à l’intégration afin de vous aider dans cette démarche.
+ Vous pouvez contacter directement notre service “Inscription Pro” par email : inscriptionpro@ebay.com
L’inscription se fait directement sur eBay.fr via un formulaire. Choisissez un pseudo, un mot de passe, saisissez vos informations personnelles (adresse, téléphone…) et le tour est joué.
+Envoyez à notre service clients les documents justifiant votre statut professionnel.
+Si vous n’avez pas de compte PayPal Business, il faut d’abord vous en créer un directement sur le site de PayPal : créez votre compte PayPal business
+ Si vous avez déjà un compte PayPal, liez-le à votre compte eBay pour recevoir les paiements des acheteurs et payer automatiquement les frais eBay.
Cette section est à configurer lors de la première utilisation du module.
Vous devez définir votre compte PayPal comme moyen de paiement de produits sur eBay en renseignant l’email que vous utilisez pour votre compte PayPal.
Si vous n’en avez pas, vous devez souscrire à un compte PayPal Business.
Vous devez définir le moyen et les frais de livraison qui seront appliqués à vos produits sur eBay.
Avant de publier vos produits sur eBay, vous devez associer les catégories de produits de votre boutique Prestashop avec celles d’eBay. Vous pouvez également choisir de vendre les produits de votre boutique Prestashop à un prix différent sur eBay. Cet impact sur le prix est défini en %.
+NB : Certaines catégories bénéficient du nouveau format d’annonce multi-versions.
+Afin d’optimiser le design de vos fiches produits sur eBay, vous pouvez personnaliser le header et le footer de vos annonces en créant un template qui s’appliquera à l’ensemble de vos produits sur eBay. En designant vos annonces selon votre charte graphique (logo, couleurs…), vous développez votre notoriété et votre visibilité sur eBay. De plus, un template d’annonce bien travaillé et présenté de manière agréable et professionnelle fait souvent la différence auprès des acheteurs.
+Cette section vous permet de mettre effectivement en ligne vos produits sur eBay. Vous avez le choix de placer la totalité des produits de votre boutique Prestashop sur eBay (option recommandée) ou seulement certaines catégories.
+Rappel : Si vous avez une Boutique eBay, vous ne paierez aucun frais d’insertion pour mettre vos produits en ligne sur eBay.
+Sur eBay, comme ailleurs, il faut soigner la présentation de ses produits sous peine de ne pas atteindre le niveau de ventes attendu. Un produit mal photographié et mal décrit ne se vendra pas. Il y a donc certaines normes à respecter avant de mettre en ligne ses produits sur eBay.fr. Cela vous permettra de bénéficier d’un bon référencement de vos produits sur eBay, d’optimiser vos ventes et ainsi de développer d’une visibilité optimale.
+eBay est la seule place de marché en France à vous donner la propriété du client. Vous êtes donc responsable de la relation client avec vos acheteurs qui vous évaluent en tant que vendeur. Pour avoir donc un bon profil vendeur, de bonnes évaluations et ainsi augmentez la confiance de vos acheteurs, il vous faut évidemment remplir vos obligations de vendeur mais aussi soigner votre relation client.
+Vous devez avoir un objectif en taux de satisfaction (évaluations) de votre profil vendeur de minimum 4.8/5.
Cette notation influence beaucoup le référencement de vos annonces dans eBay.
Voici comment les 4 critères sur lesquels vous devez soigner votre niveau de service client pour atteindre cet objectif de 4.8 de taux de satisfaction sur votre profil vendeur :
NB : L’outil « Gestionnaire de Ventes Pro » vous permet d’automatiser un certain nombre de ses tâches de relation client et ainsi de vous faire gagner du temps.
Souscrire au Gestionnaire de ventes Pro
+ | {SLOGAN} | +
+ Consulter nos évaluations + Ajouter cette boutique à mes favoris + + |
+
+ {MAIN_IMAGE} + {MEDIUM_IMAGE_1} {MEDIUM_IMAGE_2} {MEDIUM_IMAGE_3} + |
+
+ + {PRODUCT_NAME} + {PRODUCT_PRICE} {PRODUCT_PRICE_DISCOUNT} + Disponibilité : En Stock + + {DESCRIPTION} + |
+ |
{$editorial->body_logo_subheading|stripslashes}
{/if} + {if $editorial->body_title}+ ' . $emc->lang('Change configuration') . '
'; + } + + private function getOrders() + { + $id_order_state = (int)(Configuration::get('EMC_ORDER_STATE')); + $id_carrier = (int)(Configuration::get('EMC_CARRIER')); + + $sql = ' + SELECT o.id_order as id_order, o.`id_customer` as id_customer, + CONCAT(c.`firstname`, \' \', c.`lastname`) AS `customer`, + o.total_paid_real as total, o.total_shipping as shipping, + o.date_add as date, o.id_currency as id_currency, o.id_lang as id_lang, + SUM(od.product_weight * od.product_quantity) as weight + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (o.`id_order` = od.`id_order`) + LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = o.`id_customer`) + LEFT JOIN `'._DB_PREFIX_.'order_history` oh ON (oh.`id_order` = o.`id_order`) + LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = oh.`id_order_state`) + LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = o.`id_lang`) + WHERE (SELECT moh.`id_order_state` FROM `'._DB_PREFIX_.'order_history` moh WHERE moh.`id_order` = o.`id_order` ORDER BY moh.date_add DESC LIMIT 1) = '.$id_order_state.' + AND o.id_carrier = '.pSQL($id_carrier).' + GROUP BY o.`id_order`, od.`id_order` + ORDER BY o.`date_add` ASC'; + return Db::getInstance()->ExecuteS($sql); + } + + private function displayOrders($orders) + { + global $cookie; + echo '+ | '.$emc->lang('ID').' | +'.$emc->lang('Name').' | +'.$emc->lang('Total Cost').' | +'.$emc->lang('Total shipment').' | +'.$emc->lang('Date').' | +'.$emc->lang('Packaging').' | +'.$emc->lang('Nature of contents').' | +'.$emc->lang('Detail').' | +
---|---|---|---|---|---|---|---|---|
+ + | +'.(int)($order['id_order']).' | +'.htmlentities($customer->lastname, ENT_COMPAT, 'UTF-8').' '.htmlentities($customer->firstname, ENT_COMPAT, 'UTF-8').' | +'.Tools::displayPrice($order['total'], new Currency((int)($order['id_currency']))).' | +'.Tools::displayPrice($order['shipping'], new Currency((int)($order['id_currency']))).' | +'.Tools::displayDate($order['date'], (int)($order['id_lang'])).' | ++ + | +'.envoimoinscher::selectNature(Configuration::get('EMC_CONTENT'),(int)($order['id_order'])).' | ++ | +
'.$emc->lang('No order to export').' |
' . $this->l('List of orders recognized') . '
'; + echo '' . $this->l('Please upload a CSV file.') . '
'; + } + else + { + if (!$this->_importNumber()) + return ''.$this->l('Column').' '.$this->columnName.' '.$this->l('is required').'.'.'
'; + } + } + } + + private function displayOrdersTable() + { + global $cookie; + + $order_state = new OrderState(Configuration::get('EXPEDITOR_STATE_EXP')); + + $html = ''; + $html.= ''.$this->l('All orders which have the state').' "'.$order_state->name[$cookie->id_lang].'"'; + + foreach(explode(',',Configuration::get('EXPEDITOR_CARRIER')) as $val ) { + $carrier = new Carrier($val); + if ($carrier->id) $html.= ' '.$this->l('or the carrier').' "'.$carrier->name.'"'; + } + $html.= '.
' . $this->l('Change configuration') . '
'; + + $orders = ExpeditorModule::getOrders(); + if (empty($orders)) + { + $html.= ''.$this->l('Direct access to Expeditor tab.').'
'; + + return $this->_html; + } + + private function _displayForm() + { + global $cookie; + $this->orderStateExp = Configuration::get('EXPEDITOR_STATE_EXP'); + $this->orderStateImp = Configuration::get('EXPEDITOR_STATE_IMP'); + + $this->_html .= ' +'; + $this->_html .= ' ' . $this->l('Download format file for import data') . ''; + $this->_html .= '
'; + } + +} + +?> diff --git a/modules/expeditor/expeditor_format.fmt b/modules/expeditor/expeditor_format.fmt new file mode 100644 index 00000000..ee30c1af --- /dev/null +++ b/modules/expeditor/expeditor_format.fmt @@ -0,0 +1,28 @@ +[GENERAL] +DELIMITE=O +SEPARATEUR=59 +DELIMITEUR=34 +FINDELIGNE=CRLF +Unit poids=G +CN23=0 +[CHAMPS] +ReferenceExpedition=1 +NomDestinataire=2 +Prenom=3 +Adresse1=4 +Adresse2=5 +Adresse3=6 +Adresse4=7 +CodePostal=8 +Commune=9 +CodePays=10 +Poids=11 +HorsGabarit=12 +CodeProduit=13 +Portable=14 +Mail=15 +CodePointRetrait=16 +CodePorte1=17 +CodePorte2=18 +NomCommercialChargeur=19 +InstructionLivraison=20 diff --git a/modules/expeditor/fr.php b/modules/expeditor/fr.php new file mode 100644 index 00000000..d867154c --- /dev/null +++ b/modules/expeditor/fr.php @@ -0,0 +1,56 @@ +adminexpeditor_6469db4ad821b30a18b6115436976da1'] = 'Liste des commandes reconnues'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_a31b14406b9514d425f953656535ab6f'] = 'Mail envoyé à'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_f0ad8720c40df052f77713bca0a3dcc3'] = 'Erreur d\'envois de mail'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_4049d979b8e6b7d78194e96c3208a5a5'] = 'Numéro de commande'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_910d956cb2615e5739ac06c7f08fba26'] = 'Numéro de suivi de colis'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_b131798fbac3b43b107f96dd8978b6db'] = 'Retour'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_ac45207391e0814770a3087346d7027e'] = 'Veuillez uploader un fichier au format CSV'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_1976d7f704de389d9fe064e08ea35b2d'] = 'Colonne'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_0a5fa53f3f20f67f98bd6c3b16df059d'] = 'est obligatoire'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_de21dc13e1ea638777fbfad49f88b332'] = 'Toutes les commandes dont l\'état de commande est'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_2345e28c9b93f368968be4781ed70f5c'] = 'Modifier cette configuration'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_37c85a61df6352af7285c307022c4413'] = 'Aucune commande dans cet état.'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_d79cf3f429596f77db95c65074663a54'] = 'Commande ID'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_ce26601dac0dea138b7295f02b7620a7'] = 'Client'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_0eede552438475bdfe820c13f24c9399'] = 'Prix total'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_f4e8b53a114e5a17d051ab84d326cae5'] = 'Frais de port'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_44749712dbec183e983dcd78a7736c41'] = 'Date'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_2d527db7ca13aa92cb04888fafd6f8dd'] = 'Poids (en gramme)'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_d6773ce9649ea971a625e4b002a3b0dc'] = 'Non mécanisable'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_a254c25adc7d10d7e9c4889484f875a5'] = 'Détail'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_fd76a4fa666d9f787ccddf12b4d723ce'] = 'cocher ici'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_4351cfebe4b61d8aa5efa1d020710005'] = 'Voir'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_32b919d18cfaca89383f6000dcc9c031'] = 'Générer'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_fc43d9938b4e1a70dc72d81fd46e97af'] = 'Importer les numéros de suivi de colis'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_9b2fbcdd66ad2f216873427c8d33965b'] = 'Sélectionner un fichier CSV généré par Expeditor'; +$_MODULE['<{expeditor}prestashop>adminexpeditor_28dd16bcceda4431550c96dfc257dd22'] = 'Importer le fichier'; +$_MODULE['<{expeditor}prestashop>expeditor_b6bfaffe7e877d7de2268f069a2c1635'] = 'Expeditor Inet'; +$_MODULE['<{expeditor}prestashop>expeditor_e977fcf4b1bac64bce126a5864db8243'] = 'Gérer vos commandes entre Prestashop et votre logiciel Expeditor Inet'; +$_MODULE['<{expeditor}prestashop>expeditor_9d766be2c89b5af0010ac0c11dcddae7'] = 'Veuillez copier manuellement'; +$_MODULE['<{expeditor}prestashop>expeditor_85f280c4efbba6a4ac8efb56cdf72a76'] = 'Accès direct à l\'onglet Expeditor.'; +$_MODULE['<{expeditor}prestashop>expeditor_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuration'; +$_MODULE['<{expeditor}prestashop>expeditor_f5f55eb50a2db8b48aed3da1df57f2f9'] = 'Etat de commande (export)'; +$_MODULE['<{expeditor}prestashop>expeditor_4e99088cd7cf4998e33e9a04911a4e27'] = 'Choisissez l\'état de commande dans lequel les commandes sont exportables vers Expeditor.'; +$_MODULE['<{expeditor}prestashop>expeditor_9fcd9f7f541647a9c5141af5ae32a117'] = 'Etat de commande (import)'; +$_MODULE['<{expeditor}prestashop>expeditor_3f6ee88942727779a9e6dbcd2278ec48'] = 'Choisissez l\'état de commande dans lequel les commandes sont importable dans Prestashop'; +$_MODULE['<{expeditor}prestashop>expeditor_914419aa32f04011357d3b604a86d7eb'] = 'Transporteur'; +$_MODULE['<{expeditor}prestashop>expeditor_7f4782cb0b8d90abb246c7200270ee76'] = 'Code Transporteur'; +$_MODULE['<{expeditor}prestashop>expeditor_2a12a728b67541a12a38628cf619f92c'] = 'Choisissez un transporteur comme \"LaPoste\" ou \"Coliposte\"'; +$_MODULE['<{expeditor}prestashop>expeditor_dbdc5757d8de02c789ec39fa92346dbb'] = 'Multiplicateur de poids'; +$_MODULE['<{expeditor}prestashop>expeditor_c9cc8cce247e49bae79f15173ce97354'] = 'Sauvegarder'; +$_MODULE['<{expeditor}prestashop>expeditor_76d3886cc75c923cd86c5abbfc3ed596'] = 'Liste des commandes'; +$_MODULE['<{expeditor}prestashop>expeditor_1b9441f293cd7307b59296f616bb858a'] = 'Ce module a été développé par PrestaShop et ne peut être vendu que via'; +$_MODULE['<{expeditor}prestashop>expeditor_6df4dad510fb08e2e6df44b53cb2ce29'] = 'Merci de reporter les éventuels bugs à'; +$_MODULE['<{expeditor}prestashop>expeditor_d575acff7e1035a4212d2a53d5a8c115'] = 'ou en utilisant notre'; +$_MODULE['<{expeditor}prestashop>expeditor_23372c0d3713719764670087006fc1b6'] = 'formulaire de contact'; +$_MODULE['<{expeditor}prestashop>expeditor_a420f1ef5810312744f7e6095b694014'] = 'Etat de commande (import) non spécifier'; +$_MODULE['<{expeditor}prestashop>expeditor_d5ec7e558adfae2ff670dd94b194b4c0'] = 'Etat de commande (export) non spécifier'; +$_MODULE['<{expeditor}prestashop>expeditor_3f4107eab132edc2c5235c34af47cb5d'] = 'Vous devez spécifier un multiplicateur (0 est autorisé)'; +$_MODULE['<{expeditor}prestashop>expeditor_c6b7fad9600a27a49f1089c48554539f'] = 'Choisissez au moins un transporteur '; +$_MODULE['<{expeditor}prestashop>expeditor_740e53a0ed1b643f69c4aaa8ad4ae8d2'] = 'Code de transporteur invalide'; +$_MODULE['<{expeditor}prestashop>expeditor_c888438d14855d7d96a2724ee9c306bd'] = 'Configuration mise à jour'; +$_MODULE['<{expeditor}prestashop>expeditor_9b2bef340bf4cc155309585e34e32dc5'] = 'Télécharger le fichier de formatage pour l\'import des données'; diff --git a/modules/expeditor/getCsv.php b/modules/expeditor/getCsv.php new file mode 100644 index 00000000..7712d3bb --- /dev/null +++ b/modules/expeditor/getCsv.php @@ -0,0 +1,145 @@ +id_customer)); + $carrier = new Carrier($expeditor['id_carrier']); + + if ($carrier->external_module_name == 'socolissimo') + { + $delivery_info = Db::getInstance()->getRow('SELECT * FROM '._DB_PREFIX_.'socolissimo_delivery_info WHERE id_cart = '.intval($order->id_cart).' AND id_customer = '.intval($customer->id)); + if ($delivery_info['delivery_mode'] && !in_array($delivery_info['delivery_mode'], array('RDV', 'DOM', 'CORE'))) + $address = new Address(intval($order->id_address_invoice)); + else + $address = new Address(intval($order->id_address_delivery)); + } + else + $address = new Address(intval($order->id_address_delivery)); + + $country = new Country(intval($address->id_country)); + echo formatItem('EXP'.intval($order->id)); + /*if($delivery_info['delivery_mode'] && $delivery_info['delivery_mode'] == 'BPR') { + echo utf8_decode(formatItem(trim((!empty($address->company) ? $address->company.' - ' : '').$customer->lastname))); + } else {*/ + echo utf8_decode(formatItem(trim((!empty($address->company) ? $address->company.' - ' : (!empty($delivery_info['cecompanyname'])? $delivery_info['cecompanyname'].' - ': '')).$address->lastname))); + /*} + + if($delivery_info['delivery_mode'] && $delivery_info['delivery_mode'] == 'BPR') { + echo utf8_decode(formatItem($customer->firstname)); + } else {*/ + echo utf8_decode(formatItem($address->firstname)); + /*}*/ + + /*if($delivery_info['delivery_mode'] && $delivery_info['delivery_mode'] == 'BPR') { + $address->address2 = $address->address1; + $address->address1 = $address->lastname; + }*/ + + $address->address1 = str_replace(array("\n", "\r"), ' ', $address->address1); + $address->address2 = str_replace(array("\n", "\r"), ' ', $address->address2); + $address->other = str_replace(array("\n", "\r"), ' ', $address->other); + $address->address1 = str_replace(' ', ' ', $address->address1); + $address->address2 = str_replace(' ', ' ', $address->address2); + $address->other = str_replace(' ', ' ', $address->other); + + // Address line is limited to 35 chars + $wholeAddress = utf8_decode(trim($address->address1)); + if(strlen($wholeAddress) < 35 /*&& $delivery_info['delivery_mode'] && $delivery_info['delivery_mode'] != 'BPR'*/) { + echo formatItem(substr($wholeAddress, 0, 35)); + echo formatItem(substr($address->address2, 0, 35)); + echo formatItem(''); + echo formatItem(''); + } elseif(strlen($wholeAddress) < 70 && $delivery_info['delivery_mode'] /*&& $delivery_info['delivery_mode'] != 'BPR'*/) { + echo formatItem(substr($wholeAddress, 0, 35)); + echo formatItem(substr($wholeAddress, 35, 70)); + echo formatItem(substr($address->address2, 0, 35)); + echo formatItem(''); + } else { + echo formatItem(substr($wholeAddress, 0, 35)); + echo formatItem(substr($wholeAddress, 35, 70)); + echo formatItem(substr($wholeAddress, 70, 105)); + echo formatItem(substr($address->address2, 0, 35)); + } + + echo formatItem(str_replace(' ', '', $address->postcode)); + echo utf8_decode(formatItem($address->city)); + echo utf8_decode(formatItem($country->iso_code)); + echo formatItem($expeditor['weight']); + echo getStandardSize($expeditor['standard_size']); + //for socolissimo + if ($carrier->external_module_name == 'socolissimo') + { + $soCarrier = new Carrier(Configuration::get('SOCOLISSIMO_CARRIER_ID')); + if (Validate::isLoadedObject($soCarrier)) + { + echo utf8_decode(formatItem($delivery_info['delivery_mode'])); + if(empty($delivery_info['cephonenumber'])) { + if(empty($address->phone_mobile)) { + echo formatItem($address->phone); + } else { + echo formatItem($address->phone_mobile); + } + } else { + echo utf8_decode(formatItem($delivery_info['cephonenumber'])); + } + echo utf8_decode(formatItem($customer->email)); + if ($delivery_info['prid'] == 0) + echo formatItem(''); + else + echo utf8_decode(formatItem($delivery_info['prid'])); + echo utf8_decode(formatItem($delivery_info['cedoorcode1'])); + echo utf8_decode(formatItem($delivery_info['cedoorcode2'])); + } + } + else + { + echo formatItem(str_replace('CORE', 'COLD', Configuration::get('EXPEDITOR_CARRIER_CODES_'.intval($expeditor['id_carrier'])))); + echo formatItem(''); + echo formatItem(''); + echo formatItem(''); + echo formatItem(''); + echo formatItem(''); + } + echo formatItem(Configuration::get('PS_SHOP_NAME')); + echo formatItem(substr(trim(str_replace("\r", ' ', str_replace("\n", ' ', str_replace('|', '', utf8_decode($address->other))))), 0, 35)); + echo chr(13); // CR --> carriage return + echo chr(10); // LF --> new line +} + + +exit(); + +?> diff --git a/modules/expeditor/getFmt.php b/modules/expeditor/getFmt.php new file mode 100644 index 00000000..fa1184f6 --- /dev/null +++ b/modules/expeditor/getFmt.php @@ -0,0 +1,29 @@ + \ No newline at end of file diff --git a/modules/expeditor/logo.gif b/modules/expeditor/logo.gif new file mode 100644 index 00000000..aec92ebf Binary files /dev/null and b/modules/expeditor/logo.gif differ diff --git a/modules/exports/.hg/00changelog.i b/modules/exports/.hg/00changelog.i new file mode 100755 index 00000000..d3a83110 Binary files /dev/null and b/modules/exports/.hg/00changelog.i differ diff --git a/modules/exports/.hg/branch b/modules/exports/.hg/branch new file mode 100755 index 00000000..4ad96d51 --- /dev/null +++ b/modules/exports/.hg/branch @@ -0,0 +1 @@ +default diff --git a/modules/exports/.hg/cache/branchheads b/modules/exports/.hg/cache/branchheads new file mode 100755 index 00000000..99e7be93 --- /dev/null +++ b/modules/exports/.hg/cache/branchheads @@ -0,0 +1,2 @@ +f505c0c88c1966e5f7ec9c5b7498e432e829987f 0 +f505c0c88c1966e5f7ec9c5b7498e432e829987f default diff --git a/modules/exports/.hg/cache/tags b/modules/exports/.hg/cache/tags new file mode 100755 index 00000000..d4ea985d --- /dev/null +++ b/modules/exports/.hg/cache/tags @@ -0,0 +1,2 @@ +0 f505c0c88c1966e5f7ec9c5b7498e432e829987f + diff --git a/modules/exports/.hg/dirstate b/modules/exports/.hg/dirstate new file mode 100755 index 00000000..58f3191b Binary files /dev/null and b/modules/exports/.hg/dirstate differ diff --git a/modules/exports/.hg/hgrc b/modules/exports/.hg/hgrc new file mode 100755 index 00000000..c5593026 --- /dev/null +++ b/modules/exports/.hg/hgrc @@ -0,0 +1,2 @@ +[paths] +default = ssh://ewen@localhost//hg/exports diff --git a/modules/exports/.hg/requires b/modules/exports/.hg/requires new file mode 100755 index 00000000..c1674f2d --- /dev/null +++ b/modules/exports/.hg/requires @@ -0,0 +1,4 @@ +revlogv1 +fncache +store +dotencode diff --git a/modules/exports/.hg/store/00changelog.i b/modules/exports/.hg/store/00changelog.i new file mode 100755 index 00000000..ae0dfb8e Binary files /dev/null and b/modules/exports/.hg/store/00changelog.i differ diff --git a/modules/exports/.hg/store/00manifest.i b/modules/exports/.hg/store/00manifest.i new file mode 100755 index 00000000..0e39c9ef Binary files /dev/null and b/modules/exports/.hg/store/00manifest.i differ diff --git a/modules/exports/.hg/store/data/_cron_export.php.i b/modules/exports/.hg/store/data/_cron_export.php.i new file mode 100755 index 00000000..8809a256 Binary files /dev/null and b/modules/exports/.hg/store/data/_cron_export.php.i differ diff --git a/modules/exports/.hg/store/data/config.php.i b/modules/exports/.hg/store/data/config.php.i new file mode 100755 index 00000000..541ca5b5 Binary files /dev/null and b/modules/exports/.hg/store/data/config.php.i differ diff --git a/modules/exports/.hg/store/data/config.xml.i b/modules/exports/.hg/store/data/config.xml.i new file mode 100755 index 00000000..5ee4cc71 Binary files /dev/null and b/modules/exports/.hg/store/data/config.xml.i differ diff --git a/modules/exports/.hg/store/data/cron.php.i b/modules/exports/.hg/store/data/cron.php.i new file mode 100755 index 00000000..c5f254d2 Binary files /dev/null and b/modules/exports/.hg/store/data/cron.php.i differ diff --git a/modules/exports/.hg/store/data/exports.php.i b/modules/exports/.hg/store/data/exports.php.i new file mode 100755 index 00000000..9c12d987 Binary files /dev/null and b/modules/exports/.hg/store/data/exports.php.i differ diff --git a/modules/exports/.hg/store/data/exports/index.php.i b/modules/exports/.hg/store/data/exports/index.php.i new file mode 100755 index 00000000..7a8a3c8c Binary files /dev/null and b/modules/exports/.hg/store/data/exports/index.php.i differ diff --git a/modules/exports/.hg/store/data/exports/privatesales.php.i b/modules/exports/.hg/store/data/exports/privatesales.php.i new file mode 100755 index 00000000..d51b93c4 Binary files /dev/null and b/modules/exports/.hg/store/data/exports/privatesales.php.i differ diff --git a/modules/exports/.hg/store/data/exports/users.php.i b/modules/exports/.hg/store/data/exports/users.php.i new file mode 100755 index 00000000..2777fb75 Binary files /dev/null and b/modules/exports/.hg/store/data/exports/users.php.i differ diff --git a/modules/exports/.hg/store/data/exports/~2ehtaccess.i b/modules/exports/.hg/store/data/exports/~2ehtaccess.i new file mode 100755 index 00000000..c74ad7d1 Binary files /dev/null and b/modules/exports/.hg/store/data/exports/~2ehtaccess.i differ diff --git a/modules/exports/.hg/store/data/fr.php.i b/modules/exports/.hg/store/data/fr.php.i new file mode 100755 index 00000000..2050eecb Binary files /dev/null and b/modules/exports/.hg/store/data/fr.php.i differ diff --git a/modules/exports/.hg/store/data/index.php.i b/modules/exports/.hg/store/data/index.php.i new file mode 100755 index 00000000..7a8a3c8c Binary files /dev/null and b/modules/exports/.hg/store/data/index.php.i differ diff --git a/modules/exports/.hg/store/data/logo.gif.i b/modules/exports/.hg/store/data/logo.gif.i new file mode 100755 index 00000000..a5ab3fa9 Binary files /dev/null and b/modules/exports/.hg/store/data/logo.gif.i differ diff --git a/modules/exports/.hg/store/fncache b/modules/exports/.hg/store/fncache new file mode 100755 index 00000000..0bd90387 --- /dev/null +++ b/modules/exports/.hg/store/fncache @@ -0,0 +1,12 @@ +data/exports/index.php.i +data/index.php.i +data/config.xml.i +data/exports.php.i +data/config.php.i +data/exports/.htaccess.i +data/exports/privatesales.php.i +data/cron.php.i +data/exports/users.php.i +data/CronExport.php.i +data/logo.gif.i +data/fr.php.i diff --git a/modules/exports/.hg/store/undo b/modules/exports/.hg/store/undo new file mode 100755 index 00000000..aaa2097f Binary files /dev/null and b/modules/exports/.hg/store/undo differ diff --git a/modules/exports/.hg/undo.bookmarks b/modules/exports/.hg/undo.bookmarks new file mode 100755 index 00000000..e69de29b diff --git a/modules/exports/.hg/undo.branch b/modules/exports/.hg/undo.branch new file mode 100755 index 00000000..331d858c --- /dev/null +++ b/modules/exports/.hg/undo.branch @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/modules/exports/.hg/undo.desc b/modules/exports/.hg/undo.desc new file mode 100755 index 00000000..dd8f8bf5 --- /dev/null +++ b/modules/exports/.hg/undo.desc @@ -0,0 +1,3 @@ +0 +pull +ssh://ewen@localhost//hg/exports diff --git a/modules/exports/.hg/undo.dirstate b/modules/exports/.hg/undo.dirstate new file mode 100755 index 00000000..e69de29b diff --git a/modules/exports/CronExport.php b/modules/exports/CronExport.php new file mode 100755 index 00000000..a535242f --- /dev/null +++ b/modules/exports/CronExport.php @@ -0,0 +1,59 @@ +self = $self; + + $keys = array( + 'sep', + 'headers', + 'dest_path', + 'postfix', + 'params', + ); + + global $config; + for($i=0, $l=count($keys); $i<$l; $i++) { + if(isset($params[$keys[$i]])) { + $this->{$keys[$i]} = $params[$keys[$i]]; + } elseif(isset($config[$this->self][$keys[$i]])) { + $this->{$keys[$i]} = $config[$this->self][$keys[$i]]; + } + } + } + + protected function preProcess() {} + + protected function process() { + // Do stuff here + } + + protected function postProcess() {} + + protected function w($line=array()) { + fputcsv($this->file, array_values($line), $this->sep); + } + + public function run() { + $this->preProcess(); + $this->filename = _PS_ROOT_DIR_.$this->dest_path.'/'.date('Y-m-d', mktime()).$this->postfix.'.csv'; + touch($this->filename); + $this->filename = realpath($this->filename); + $this->file = fopen($this->filename, 'w'); + $this->w($this->headers); + $this->process(); + fclose($this->file); + $this->postProcess(); + } +} diff --git a/modules/exports/config.php b/modules/exports/config.php new file mode 100755 index 00000000..fd5a791b --- /dev/null +++ b/modules/exports/config.php @@ -0,0 +1,57 @@ + 'homeplanete.com', + + 'privatesales' => array( + 'dest_path' => '/../extracts/daily', + 'headers' => array( + 'id_sale', + 'sale_title', + 'id_order', + 'id_customer', + 'gender', + 'email', + 'firstname', + 'lastname', + 'shipping_firstname', + 'shipping_lastname', + 'shipping_street', + 'shipping_street2', + 'shipping_postcode', + 'shipping_city', + 'shipping_phone', + 'shipping_phone_mobile', + 'shipping_country', + 'id_product', + 'id_product_attribute', + 'order_product_name', + 'product_quantity', + 'product_price_base_wo_taxes', + 'tax_rate', + 'product_name', + 'product_combination', + 'product_price_wo_taxes', + 'product_price', + 'wholesale_price', + 'combination_wholesale_price', + 'supplier_reference', + 'total_shipping', + 'date', + 'invoice_number', + 'payment_type', + ), + ), + + 'users' => array( + 'dest_path' => '/../extracts/weekly', + 'headers' => array( + 'email', + 'sponsor', + 'date_add', + 'total_orders', + 'newsletter', + 'optin', + ), + ), +); diff --git a/modules/exports/cron.php b/modules/exports/cron.php new file mode 100755 index 00000000..59d09902 --- /dev/null +++ b/modules/exports/cron.php @@ -0,0 +1,19 @@ + 1) { + require(dirname(__FILE__).'/exports/'.$argv[1].'.php'); + $e = new CronExport($argv[1]); + $e->run(); +} +exit; diff --git a/modules/exports/en.php b/modules/exports/en.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/exports/es.php b/modules/exports/es.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/exports/exports.php b/modules/exports/exports.php new file mode 100755 index 00000000..31a12ef8 --- /dev/null +++ b/modules/exports/exports.php @@ -0,0 +1,70 @@ +name = 'exports'; + $this->displayName = $this->l('Exports'); + $this->description = $this->l('Adds an automated export feature to Prestashop'); + $this->tab = 'administration'; + $this->version = '1.0'; + $this->author = 'Antadis'; + + parent::__construct(); + } + + public function install() { + if (!parent::install() OR !$this->registerHook('privatesales_end')) { + return FALSE; + } + return TRUE; + } + + public function hookPrivateSales_End($params) { + include_once(dirname(__FILE__).'/exports/privatesales.php'); + $e = new CronExport('privatesales', array( + 'headers' => array( + 'id_sale', + 'sale_title', + 'id_order', + 'id_customer', + 'gender', + 'email', + 'firstname', + 'lastname', + 'shipping_firstname', + 'shipping_lastname', + 'shipping_street', + 'shipping_street2', + 'shipping_postcode', + 'shipping_city', + 'shipping_phone', + 'shipping_phone_mobile', + 'other_info', + 'shipping_country', + 'id_product', + 'id_product_attribute', + 'order_product_name', + 'product_quantity', + 'product_price_base_wo_taxes', + 'tax_rate', + 'product_name', + 'product_combination', + 'product_price_wo_taxes', + 'product_price', + 'wholesale_price', + 'combination_wholesale_price', + 'supplier_reference', + 'quantity_refunded', + 'quantity_returned', + 'total_shipping', + 'date', + 'invoice_number', + 'payment_type', + 'order_state', + ), + 'postfix' => '_'.$params['sale']->id.'_end', + 'dest_path' => '/../extracts/sales', + 'params' => $params, + )); + $e->run(); + } +} diff --git a/modules/exports/exports/index.php b/modules/exports/exports/index.php new file mode 100755 index 00000000..a344ca6f --- /dev/null +++ b/modules/exports/exports/index.php @@ -0,0 +1,37 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 6594 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; +?> \ No newline at end of file diff --git a/modules/exports/exports/privatesales.php b/modules/exports/exports/privatesales.php new file mode 100755 index 00000000..e8ddc0ee --- /dev/null +++ b/modules/exports/exports/privatesales.php @@ -0,0 +1,599 @@ +params['sale'])) { + $sale = $this->params['sale']; + $products = $sale->getProducts(); + + if(count($products) > 0) { + + $insert = ' + INSERT INTO `'._DB_PREFIX_.'category_family_export` + SELECT cp.`id_product`, + ( + SELECT asso.`id_category_family` + FROM `'._DB_PREFIX_.'category_product` cp2 + LEFT JOIN `'._DB_PREFIX_.'category` c2 ON c2.`id_category` = cp2.`id_category` + RIGHT JOIN `'._DB_PREFIX_.'category_family_association` asso ON c2.`id_category` = asso.`id_category` + WHERE cp2.`id_product` = cp.`id_product` + ORDER BY c2.`level_depth` DESC + LIMIT 1 + ) as `id_category_family` + FROM `'._DB_PREFIX_.'category_product` cp + WHERE cp.`id_product` IN ('.implode(', ', $products).') + GROUP BY cp.`id_product` + ON DUPLICATE KEY UPDATE + `id_category_family` = VALUES(`id_category_family`)'; + + Db::getInstance()->execute($insert); + + $query = ' + SELECT + '.(int) $sale->id.' AS id_sale, + "'.addslashes($sale->title[$id_lang]).'" AS `sale_title`, + o.id_order AS id_order, + c.id_customer AS id_customer, + IF(c.id_gender = 1, "M.", IF(c.id_gender = 2, "Mme", "")) AS gender, + c.email AS email, + c.firstname AS firstname, + c.lastname AS lastname, + a.firstname AS shipping_firstname, + a.lastname AS shipping_lastname, + a.address1 AS shipping_street, + a.address2 AS shipping_street2, + a.postcode AS shipping_postcode, + a.city AS shipping_city, + a.phone AS shipping_phone, + a.phone_mobile AS shipping_phone_mobile, + a.other AS other_info, + l.name AS shipping_country, + d.product_id AS id_product, + d.product_attribute_id AS id_product_attribute, + d.product_name AS order_product_name, + d.product_quantity AS product_quantity, + d.product_price AS product_price_base_wo_taxes, + d.tax_rate AS tax_rate, + p.name AS product_name, + IF(d.product_attribute_id=0,"",REPLACE(d.product_name, CONCAT(p.name, " - "), "")) AS product_combination, + ROUND((d.product_price * (1 - d.reduction_percent / 100) - d.reduction_amount), 6) AS product_price_wo_taxes, + ROUND((d.product_price * (1 - d.reduction_percent / 100) - d.reduction_amount) * (1 + d.tax_rate / 100), 6) AS product_price, + pr.wholesale_price AS wholesale_price, + pa.wholesale_price AS combination_wholesale_price, + d.product_supplier_reference AS supplier_reference, + d.product_quantity_refunded AS quantity_refunded, + d.product_quantity_return AS quantity_returned, + o.total_shipping AS total_shipping, + IF( + (SELECT COUNT(id_order_detail) = 1 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.`id_order`) = 1, + 1, + (SELECT COUNT(id_order_detail) = 0 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.id_order + AND product_id NOT IN ('.implode(', ', $products).')) + ) AS `single`, + o.date_add AS `date`, + o.invoice_number AS invoice_number, + o.payment AS payment_type, + (SELECT hl.`name` FROM `'._DB_PREFIX_.'order_history` h, `'._DB_PREFIX_.'order_state_lang` hl WHERE h.id_order = o.id_order AND hl.id_lang = 2 and h.id_order_state = hl.id_order_state ORDER BY h.date_add DESC LIMIT 1) AS order_state, + col.delivery_mode, + IF(a.id_country = 6, "ES", "FR") AS version, + IF( + (SELECT count(`id_category_family`) + FROM `'._DB_PREFIX_.'category_family_export` export + WHERE export.`id_product` = d.`product_id` ) = 1, + ( + SELECT fl1.`name` + FROM `ps_category_family_lang` fl1 + WHERE fl1.`id_category_family` = ( + SELECT cf1.`id_parent` + FROM `ps_category_family` cf1 + LEFT JOIN `ps_category_family_export` export2 ON (export2.`id_category_family` = cf1.`id_category_family`) + WHERE export2.`id_product` = d.`product_id` + ) + AND fl1.`id_lang` = 2 + ), + 0 + ) as `domaine`, + IF( + (SELECT count(`id_category_family`) + FROM `'._DB_PREFIX_.'category_family_export` export + WHERE export.`id_product` = d.`product_id` ) = 1, + (SELECT fl.`name` + FROM `'._DB_PREFIX_.'category_family_export` export + LEFT JOIN `'._DB_PREFIX_.'category_family_lang` fl ON (fl.`id_category_family` = export.`id_category_family` AND fl.`id_lang` = 2) + WHERE export.`id_product` = d.`product_id`), + 0 + ) AS `id_category_family` + FROM + `'._DB_PREFIX_.'orders` o, + `'._DB_PREFIX_.'customer` c, + `'._DB_PREFIX_.'address` a, + `'._DB_PREFIX_.'country_lang` l, + `'._DB_PREFIX_.'product` pr, + `'._DB_PREFIX_.'product_lang` p, + `'._DB_PREFIX_.'order_detail` d + LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (pa.id_product_attribute = d.product_attribute_id) + LEFT JOIN `'._DB_PREFIX_.'orders` o1 ON (o1.id_order = d.id_order) + LEFT JOIN `'._DB_PREFIX_.'socolissimo_delivery_info` col ON (col.id_cart = o1.id_cart) + WHERE c.id_customer = o.id_customer + AND l.id_country = a.id_country + AND l.id_lang = 2 + AND o.id_address_delivery = a.id_address + AND d.id_order = o.id_order + AND p.id_product = d.product_id + AND pr.id_product = d.product_id + AND p.id_lang = 2 + AND (d.`product_id` = '.implode(' OR d.`product_id` = ', $products).') + '.(isset($this->params['date_start'])? ' AND o.`date_add` >= "'.$this->params['date_start'].'"': '').' + '.(isset($this->params['date_end'])? ' AND o.`date_add` <= "'.$this->params['date_end'].'"': '').' + '; + + + foreach(Db::getInstance()->ExecuteS($query) as $line) { + $this->w($line); + } + + $query = ' + SELECT + '.(int) $sale->id.' AS id_sale, + "'.addslashes($sale->title[$id_lang]).'" AS `sale_title`, + o.id_order AS id_order, + c.id_customer AS id_customer, + IF(c.id_gender = 1, "M.", IF(c.id_gender = 2, "Mme", "")) AS gender, + c.email AS email, + c.firstname AS firstname, + c.lastname AS lastname, + a.firstname AS shipping_firstname, + a.lastname AS shipping_lastname, + a.address1 AS shipping_street, + a.address2 AS shipping_street2, + a.postcode AS shipping_postcode, + a.city AS shipping_city, + a.phone AS shipping_phone, + a.phone_mobile AS shipping_phone_mobile, + a.other AS other_info, + l.name AS shipping_country, + od.id_discount AS id_product, + 0 AS id_product_attribute, + od.name AS order_product_name, + 1 AS product_quantity, + 0-od.value AS product_price_base_wo_taxes, + 0 AS tax_rate, + od.name AS product_name, + "" AS product_combination, + 0-od.value AS product_price_wo_taxes, + 0-od.value AS product_price, + 0 AS wholesale_price, + 0 AS combination_wholesale_price, + "DISCOUNT" AS supplier_reference, + "" AS quantity_refunded, + "" AS quantity_returned, + 0 AS total_shipping, + IF( + (SELECT COUNT(id_order_detail) = 1 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.`id_order`) = 1, + 1, + (SELECT COUNT(id_order_detail) = 0 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.id_order + AND product_id NOT IN ('.implode(', ', $products).')) + ) AS `single`, + o.date_add AS `date`, + o.invoice_number AS invoice_number, + o.payment AS payment_type, + (SELECT hl.`name` FROM `'._DB_PREFIX_.'order_history` h, `'._DB_PREFIX_.'order_state_lang` hl WHERE h.id_order = o.id_order AND hl.id_lang = 2 and h.id_order_state = hl.id_order_state ORDER BY h.date_add DESC LIMIT 1) AS order_state, + col.delivery_mode, + IF(a.id_country = 6, "ES", "FR") AS version + FROM + `'._DB_PREFIX_.'orders` o, + `'._DB_PREFIX_.'order_discount` od, + `'._DB_PREFIX_.'customer` c, + `'._DB_PREFIX_.'address` a, + `'._DB_PREFIX_.'country_lang` l, + `'._DB_PREFIX_.'order_detail` d + LEFT JOIN `'._DB_PREFIX_.'orders` o1 ON (o1.id_order = d.id_order) + LEFT JOIN `'._DB_PREFIX_.'socolissimo_delivery_info` col ON (col.id_cart = o1.id_cart) + WHERE c.id_customer = o.id_customer + AND l.id_country = a.id_country + AND l.id_lang = 2 + AND o.id_address_delivery = a.id_address + AND d.id_order = o.id_order + AND od.id_order = o.id_order + AND (d.`product_id` = '.implode(' OR d.`product_id` = ', $products).') + '.(isset($this->params['date_start'])? ' AND o.`date_add` >= "'.$this->params['date_start'].'"': '').' + '.(isset($this->params['date_end'])? ' AND o.`date_add` <= "'.$this->params['date_end'].'"': '').' + GROUP BY c.id_customer, od.id_discount'; + + foreach(Db::getInstance()->ExecuteS($query) as $line) { + $this->w($line); + } + + $query = ' + SELECT + '.(int) $sale->id.' AS id_sale, + "'.addslashes($sale->title[$id_lang]).'" AS `sale_title`, + o.id_order AS id_order, + c.id_customer AS id_customer, + IF(c.id_gender = 1, "M.", IF(c.id_gender = 2, "Mme", "")) AS gender, + c.email AS email, + c.firstname AS firstname, + c.lastname AS lastname, + a.firstname AS shipping_firstname, + a.lastname AS shipping_lastname, + a.address1 AS shipping_street, + a.address2 AS shipping_street2, + a.postcode AS shipping_postcode, + a.city AS shipping_city, + a.phone AS shipping_phone, + a.phone_mobile AS shipping_phone_mobile, + a.other AS other_info, + l.name AS shipping_country, + ca.id_carrier AS id_product, + 0 AS id_product_attribute, + ca.name AS order_product_name, + 1 AS product_quantity, + o.total_shipping / (1 + o.carrier_tax_rate / 100) AS product_price_base_wo_taxes, + o.carrier_tax_rate AS tax_rate, + ca.name AS product_name, + "" AS product_combination, + o.total_shipping / (1 + o.carrier_tax_rate / 100) AS product_price_wo_taxes, + o.total_shipping AS product_price, + 0 AS wholesale_price, + 0 AS combination_wholesale_price, + "SHIPPING" AS supplier_reference, + "" AS quantity_refunded, + "" AS quantity_returned, + 0 AS total_shipping, + IF( + (SELECT COUNT(id_order_detail) = 1 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.`id_order`) = 1, + 1, + (SELECT COUNT(id_order_detail) = 0 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.id_order + AND product_id NOT IN ('.implode(', ', $products).')) + ) AS `single`, + o.date_add AS `date`, + o.invoice_number AS invoice_number, + o.payment AS payment_type, + (SELECT hl.`name` FROM `'._DB_PREFIX_.'order_history` h, `'._DB_PREFIX_.'order_state_lang` hl WHERE h.id_order = o.id_order AND hl.id_lang = 2 and h.id_order_state = hl.id_order_state ORDER BY h.date_add DESC LIMIT 1) AS order_state, + col.delivery_mode, + IF(a.id_country = 6, "ES", "FR") AS version + FROM + `'._DB_PREFIX_.'orders` o, + `'._DB_PREFIX_.'carrier` ca, + `'._DB_PREFIX_.'customer` c, + `'._DB_PREFIX_.'address` a, + `'._DB_PREFIX_.'country_lang` l, + `'._DB_PREFIX_.'order_detail` d + LEFT JOIN `'._DB_PREFIX_.'orders` o1 ON (o1.id_order = d.id_order) + LEFT JOIN `'._DB_PREFIX_.'socolissimo_delivery_info` col ON (col.id_cart = o1.id_cart) + WHERE c.id_customer = o.id_customer + AND l.id_country = a.id_country + AND l.id_lang = 2 + AND o.id_address_delivery = a.id_address + AND o.id_carrier = ca.id_carrier + AND d.id_order = o.id_order + AND (d.`product_id` = '.implode(' OR d.`product_id` = ', $products).') + '.(isset($this->params['date_start'])? ' AND o.`date_add` >= "'.$this->params['date_start'].'"': '').' + '.(isset($this->params['date_end'])? ' AND o.`date_add` <= "'.$this->params['date_end'].'"': '').' + GROUP BY o.id_order'; + + foreach(Db::getInstance()->ExecuteS($query) as $line) { + $this->w($line); + } + } + } else { + $sales = Sale::getSales(TRUE, NULL, NULL, 'current'); + foreach($sales as $sale) { + $products = $sale->getProducts(); + + if(count($products) > 0) { + $query = ' + SELECT + '.(int) $sale->id.' AS id_sale, + "'.addslashes($sale->title[$id_lang]).'" AS `sale_title`, + o.id_order AS id_order, + c.id_customer AS id_customer, + IF(c.id_gender = 1, "M.", IF(c.id_gender = 2, "Mme", "")) AS gender, + c.email AS email, + c.firstname AS firstname, + c.lastname AS lastname, + a.firstname AS shipping_firstname, + a.lastname AS shipping_lastname, + a.address1 AS shipping_street, + a.address2 AS shipping_street2, + a.postcode AS shipping_postcode, + a.city AS shipping_city, + a.phone AS shipping_phone, + a.phone_mobile AS shipping_phone_mobile, + a.other AS other_info, + l.name AS shipping_country, + d.product_id AS id_product, + d.product_attribute_id AS id_product_attribute, + d.product_name AS order_product_name, + d.product_quantity AS product_quantity, + d.product_price AS product_price_base_wo_taxes, + d.tax_rate AS tax_rate, + p.name AS product_name, + IF(d.product_attribute_id=0,"",REPLACE(d.product_name, CONCAT(p.name, " - "), "")) AS product_combination, + ROUND((d.product_price * (1 - d.reduction_percent / 100) - d.reduction_amount), 6) AS product_price_wo_taxes, + ROUND((d.product_price * (1 - d.reduction_percent / 100) - d.reduction_amount) * (1 + d.tax_rate / 100), 6) AS product_price, + pr.wholesale_price AS wholesale_price, + pa.wholesale_price AS combination_wholesale_price, + d.product_supplier_reference AS supplier_reference, + d.product_quantity_refunded AS quantity_refunded, + d.product_quantity_return AS quantity_returned, + o.total_shipping AS total_shipping, + IF( + (SELECT COUNT(id_order_detail) = 1 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.`id_order`) = 1, + 1, + (SELECT COUNT(id_order_detail) = 0 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.id_order + AND product_id NOT IN ('.implode(', ', $products).')) + ) AS `single`, + o.date_add AS `date`, + o.invoice_number AS invoice_number, + o.payment AS payment_type, + (SELECT hl.`name` FROM `'._DB_PREFIX_.'order_history` h, `'._DB_PREFIX_.'order_state_lang` hl WHERE h.id_order = o.id_order AND hl.id_lang = 2 and h.id_order_state = hl.id_order_state ORDER BY h.date_add DESC LIMIT 1) AS order_state + FROM + `'._DB_PREFIX_.'orders` o, + `'._DB_PREFIX_.'customer` c, + `'._DB_PREFIX_.'address` a, + `'._DB_PREFIX_.'country_lang` l, + `'._DB_PREFIX_.'product` pr, + `'._DB_PREFIX_.'product_lang` p, + `'._DB_PREFIX_.'order_detail` d + LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON pa.id_product_attribute = d.product_attribute_id + WHERE c.id_customer = o.id_customer + AND l.id_country = a.id_country + AND l.id_lang = 2 + AND o.id_address_delivery = a.id_address + AND d.id_order = o.id_order + AND p.id_product = d.product_id + AND pr.id_product = d.product_id + AND p.id_lang = 2 + AND (d.`product_id` = '.implode(' OR d.`product_id` = ', $products).') + '.(isset($this->params['date_start'])? ' AND o.`date_add` >= "'.$this->params['date_start'].'"': '').' + '.(isset($this->params['date_end'])? ' AND o.`date_add` <= "'.$this->params['date_end'].'"': '').' + '; + + foreach(Db::getInstance()->ExecuteS($query) as $line) { + $this->w($line); + } + + $query = ' + SELECT + '.(int) $sale->id.' AS id_sale, + "'.addslashes($sale->title[$id_lang]).'" AS `sale_title`, + o.id_order AS id_order, + c.id_customer AS id_customer, + IF(c.id_gender = 1, "M.", IF(c.id_gender = 2, "Mme", "")) AS gender, + c.email AS email, + c.firstname AS firstname, + c.lastname AS lastname, + a.firstname AS shipping_firstname, + a.lastname AS shipping_lastname, + a.address1 AS shipping_street, + a.address2 AS shipping_street2, + a.postcode AS shipping_postcode, + a.city AS shipping_city, + a.phone AS shipping_phone, + a.phone_mobile AS shipping_phone_mobile, + a.other AS other_info, + l.name AS shipping_country, + od.id_discount AS id_product, + 0 AS id_product_attribute, + od.name AS order_product_name, + 1 AS product_quantity, + 0-od.value AS product_price_base_wo_taxes, + 0 AS tax_rate, + od.name AS product_name, + "" AS product_combination, + 0-od.value AS product_price_wo_taxes, + 0-od.value AS product_price, + 0 AS wholesale_price, + 0 AS combination_wholesale_price, + "DISCOUNT" AS supplier_reference, + "" AS quantity_refunded, + "" AS quantity_returned, + 0 AS total_shipping, + IF( + (SELECT COUNT(id_order_detail) = 1 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.`id_order`) = 1, + 1, + (SELECT COUNT(id_order_detail) = 0 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.id_order + AND product_id NOT IN ('.implode(', ', $products).')) + ) AS `single`, + o.date_add AS `date`, + o.invoice_number AS invoice_number, + o.payment AS payment_type, + (SELECT hl.`name` FROM `'._DB_PREFIX_.'order_history` h, `'._DB_PREFIX_.'order_state_lang` hl WHERE h.id_order = o.id_order AND hl.id_lang = 2 and h.id_order_state = hl.id_order_state ORDER BY h.date_add DESC LIMIT 1) AS order_state + FROM + `'._DB_PREFIX_.'orders` o, + `'._DB_PREFIX_.'order_discount` od, + `'._DB_PREFIX_.'customer` c, + `'._DB_PREFIX_.'address` a, + `'._DB_PREFIX_.'country_lang` l, + `'._DB_PREFIX_.'order_detail` d + WHERE c.id_customer = o.id_customer + AND l.id_country = a.id_country + AND l.id_lang = 2 + AND o.id_address_delivery = a.id_address + AND d.id_order = o.id_order + AND od.id_order = o.id_order + AND (d.`product_id` = '.implode(' OR d.`product_id` = ', $products).') + '.(isset($this->params['date_start'])? ' AND o.`date_add` >= "'.$this->params['date_start'].'"': '').' + '.(isset($this->params['date_end'])? ' AND o.`date_add` <= "'.$this->params['date_end'].'"': '').' + GROUP BY c.id_customer, od.id_discount'; + + foreach(Db::getInstance()->ExecuteS($query) as $line) { + $this->w($line); + } + + $query = ' + SELECT + '.(int) $sale->id.' AS id_sale, + "'.addslashes($sale->title[$id_lang]).'" AS `sale_title`, + o.id_order AS id_order, + c.id_customer AS id_customer, + IF(c.id_gender = 1, "M.", IF(c.id_gender = 2, "Mme", "")) AS gender, + c.email AS email, + c.firstname AS firstname, + c.lastname AS lastname, + a.firstname AS shipping_firstname, + a.lastname AS shipping_lastname, + a.address1 AS shipping_street, + a.address2 AS shipping_street2, + a.postcode AS shipping_postcode, + a.city AS shipping_city, + a.phone AS shipping_phone, + a.phone_mobile AS shipping_phone_mobile, + a.other AS other_info, + l.name AS shipping_country, + ca.id_carrier AS id_product, + 0 AS id_product_attribute, + ca.name AS order_product_name, + 1 AS product_quantity, + o.total_shipping / (1 + o.carrier_tax_rate / 100) AS product_price_base_wo_taxes, + o.carrier_tax_rate AS tax_rate, + ca.name AS product_name, + "" AS product_combination, + o.total_shipping / (1 + o.carrier_tax_rate / 100) AS product_price_wo_taxes, + o.total_shipping AS product_price, + 0 AS wholesale_price, + 0 AS combination_wholesale_price, + "SHIPPING" AS supplier_reference, + "" AS quantity_refunded, + "" AS quantity_returned, + 0 AS total_shipping, + IF( + (SELECT COUNT(id_order_detail) = 1 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.`id_order`) = 1, + 1, + (SELECT COUNT(id_order_detail) = 0 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.id_order + AND product_id NOT IN ('.implode(', ', $products).')) + ) AS `single`, + o.date_add AS `date`, + o.invoice_number AS invoice_number, + o.payment AS payment_type, + (SELECT hl.`name` FROM `'._DB_PREFIX_.'order_history` h, `'._DB_PREFIX_.'order_state_lang` hl WHERE h.id_order = o.id_order AND hl.id_lang = 2 and h.id_order_state = hl.id_order_state ORDER BY h.date_add DESC LIMIT 1) AS order_state + FROM + `'._DB_PREFIX_.'orders` o, + `'._DB_PREFIX_.'carrier` ca, + `'._DB_PREFIX_.'customer` c, + `'._DB_PREFIX_.'address` a, + `'._DB_PREFIX_.'country_lang` l, + `'._DB_PREFIX_.'order_detail` d + WHERE c.id_customer = o.id_customer + AND l.id_country = a.id_country + AND l.id_lang = 2 + AND o.id_address_delivery = a.id_address + AND o.id_carrier = ca.id_carrier + AND d.id_order = o.id_order + AND (d.`product_id` = '.implode(' OR d.`product_id` = ', $products).') + '.(isset($this->params['date_start'])? ' AND o.`date_add` >= "'.$this->params['date_start'].'"': '').' + '.(isset($this->params['date_end'])? ' AND o.`date_add` <= "'.$this->params['date_end'].'"': '').' + GROUP BY o.id_order'; + + foreach(Db::getInstance()->ExecuteS($query) as $line) { + $this->w($line); + } + } + } + } + } +} + +if(($id_sale = (int) Tools::getValue('id_sale')) +&& Tools::getValue('adtoken') === Tools::encrypt('PrivateSalesDirectExtract'.$id_sale)) { + $sale = new Sale($id_sale); + $e = new CronExport('privatesales', array( + 'headers' => array( + 'id_sale', + 'sale_title', + 'id_order', + 'id_customer', + 'gender', + 'email', + 'firstname', + 'lastname', + 'shipping_firstname', + 'shipping_lastname', + 'shipping_street', + 'shipping_street2', + 'shipping_postcode', + 'shipping_city', + 'shipping_phone', + 'shipping_phone_mobile', + 'other_info', + 'shipping_country', + 'id_product', + 'id_product_attribute', + 'order_product_name', + 'product_quantity', + 'product_price_base_wo_taxes', + 'tax_rate', + 'product_name', + 'product_combination', + 'product_price_wo_taxes', + 'product_price', + 'wholesale_price', + 'combination_wholesale_price', + 'supplier_reference', + 'quantity_refunded', + 'quantity_returned', + 'total_shipping', + 'single', + 'date', + 'invoice_number', + 'payment_type', + 'order_state', + 'delivery_mode', + 'version', + 'family', + 'domaine', + ), + 'postfix' => '_'.$id_sale.'_manual', + 'dest_path' => '/../extracts/sales', + 'params' => array( + 'sale' => $sale, + ), + )); + $e->run(); + + header('Content-Type: application/force-download; name="'.basename($e->filename).'"'); + header("Content-Transfer-Encoding: binary"); + header('Content-Disposition: attachment; filename="'.basename($e->filename).'"'); + header('Expires: 0'); + header('Cache-Control: no-cache, must-revalidate'); + header('Pragma: no-cache'); + echo file_get_contents($e->filename); + unlink($e->filename); + exit; +} diff --git a/modules/exports/exports/privatesales_accepted.php b/modules/exports/exports/privatesales_accepted.php new file mode 100755 index 00000000..948f57c1 --- /dev/null +++ b/modules/exports/exports/privatesales_accepted.php @@ -0,0 +1,540 @@ +params['sale'])) { + $sale = $this->params['sale']; + $products = $sale->getProducts(); + + if(count($products) > 0) { + $query = ' + SELECT + '.(int) $sale->id.' AS id_sale, + "'.addslashes($sale->title[$id_lang]).'" AS `sale_title`, + o.id_order AS id_order, + c.id_customer AS id_customer, + IF(c.id_gender = 1, "M.", IF(c.id_gender = 2, "Mme", "")) AS gender, + c.email AS email, + c.firstname AS firstname, + c.lastname AS lastname, + a.firstname AS shipping_firstname, + a.lastname AS shipping_lastname, + a.address1 AS shipping_street, + a.address2 AS shipping_street2, + a.postcode AS shipping_postcode, + a.city AS shipping_city, + a.phone AS shipping_phone, + a.phone_mobile AS shipping_phone_mobile, + a.other AS other_info, + l.name AS shipping_country, + d.product_id AS id_product, + d.product_attribute_id AS id_product_attribute, + d.product_name AS order_product_name, + d.product_quantity AS product_quantity, + d.product_price AS product_price_base_wo_taxes, + d.tax_rate AS tax_rate, + p.name AS product_name, + IF(d.product_attribute_id=0,"",REPLACE(d.product_name, CONCAT(p.name, " - "), "")) AS product_combination, + ROUND((d.product_price * (1 - d.reduction_percent / 100) - d.reduction_amount), 6) AS product_price_wo_taxes, + ROUND((d.product_price * (1 - d.reduction_percent / 100) - d.reduction_amount) * (1 + d.tax_rate / 100), 6) AS product_price, + pr.wholesale_price AS wholesale_price, + pa.wholesale_price AS combination_wholesale_price, + d.product_supplier_reference AS supplier_reference, + d.product_quantity_refunded AS quantity_refunded, + d.product_quantity_return AS quantity_returned, + o.total_shipping AS total_shipping, + IF( + (SELECT COUNT(id_order_detail) = 1 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.`id_order`) = 1, + 1, + (SELECT COUNT(id_order_detail) = 0 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.id_order + AND product_id NOT IN ('.implode(', ', $products).')) + ) AS `single`, + o.date_add AS `date`, + o.invoice_number AS invoice_number, + o.payment AS payment_type, + (SELECT hl.`name` FROM `'._DB_PREFIX_.'order_history` h, `'._DB_PREFIX_.'order_state_lang` hl WHERE h.id_order = o.id_order AND hl.id_lang = 2 and h.id_order_state = hl.id_order_state ORDER BY h.date_add DESC LIMIT 1) AS order_state, + IF(a.id_country = 6, "ES", "FR") AS version + FROM + `'._DB_PREFIX_.'orders` o, + `'._DB_PREFIX_.'customer` c, + `'._DB_PREFIX_.'address` a, + `'._DB_PREFIX_.'country_lang` l, + `'._DB_PREFIX_.'product` pr, + `'._DB_PREFIX_.'product_lang` p, + `'._DB_PREFIX_.'order_detail` d + LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON pa.id_product_attribute = d.product_attribute_id + WHERE c.id_customer = o.id_customer + AND (SELECT h.`id_order_state` FROM `'._DB_PREFIX_.'order_history` h WHERE h.id_order = o.id_order ORDER BY h.date_add DESC LIMIT 1) = 2 + AND l.id_country = a.id_country + AND l.id_lang = 2 + AND o.id_address_delivery = a.id_address + AND d.id_order = o.id_order + AND p.id_product = d.product_id + AND pr.id_product = d.product_id + AND p.id_lang = 2 + AND (d.`product_id` = '.implode(' OR d.`product_id` = ', $products).') + '.(isset($this->params['date_start'])? ' AND o.`date_add` >= "'.$this->params['date_start'].'"': '').' + '.(isset($this->params['date_end'])? ' AND o.`date_add` <= "'.$this->params['date_end'].'"': '').' + '; + + foreach(Db::getInstance()->ExecuteS($query) as $line) { + $this->w($line); + } + + $query = ' + SELECT + '.(int) $sale->id.' AS id_sale, + "'.addslashes($sale->title[$id_lang]).'" AS `sale_title`, + o.id_order AS id_order, + c.id_customer AS id_customer, + IF(c.id_gender = 1, "M.", IF(c.id_gender = 2, "Mme", "")) AS gender, + c.email AS email, + c.firstname AS firstname, + c.lastname AS lastname, + a.firstname AS shipping_firstname, + a.lastname AS shipping_lastname, + a.address1 AS shipping_street, + a.address2 AS shipping_street2, + a.postcode AS shipping_postcode, + a.city AS shipping_city, + a.phone AS shipping_phone, + a.phone_mobile AS shipping_phone_mobile, + a.other AS other_info, + l.name AS shipping_country, + od.id_discount AS id_product, + 0 AS id_product_attribute, + od.name AS order_product_name, + 1 AS product_quantity, + 0-od.value AS product_price_base_wo_taxes, + 0 AS tax_rate, + od.name AS product_name, + "" AS product_combination, + 0-od.value AS product_price_wo_taxes, + 0-od.value AS product_price, + 0 AS wholesale_price, + 0 AS combination_wholesale_price, + "DISCOUNT" AS supplier_reference, + "" AS quantity_refunded, + "" AS quantity_returned, + 0 AS total_shipping, + IF( + (SELECT COUNT(id_order_detail) = 1 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.`id_order`) = 1, + 1, + (SELECT COUNT(id_order_detail) = 0 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.id_order + AND product_id NOT IN ('.implode(', ', $products).')) + ) AS `single`, + o.date_add AS `date`, + o.invoice_number AS invoice_number, + o.payment AS payment_type, + (SELECT hl.`name` FROM `'._DB_PREFIX_.'order_history` h, `'._DB_PREFIX_.'order_state_lang` hl WHERE h.id_order = o.id_order AND hl.id_lang = 2 and h.id_order_state = hl.id_order_state ORDER BY h.date_add DESC LIMIT 1) AS order_state, + IF(a.id_country = 6, "ES", "FR") AS version + FROM + `'._DB_PREFIX_.'orders` o, + `'._DB_PREFIX_.'order_discount` od, + `'._DB_PREFIX_.'customer` c, + `'._DB_PREFIX_.'address` a, + `'._DB_PREFIX_.'country_lang` l, + `'._DB_PREFIX_.'order_detail` d + WHERE c.id_customer = o.id_customer + AND (SELECT h.`id_order_state` FROM `'._DB_PREFIX_.'order_history` h WHERE h.id_order = o.id_order ORDER BY h.date_add DESC LIMIT 1) = 2 + AND l.id_country = a.id_country + AND l.id_lang = 2 + AND o.id_address_delivery = a.id_address + AND d.id_order = o.id_order + AND od.id_order = o.id_order + AND (d.`product_id` = '.implode(' OR d.`product_id` = ', $products).') + '.(isset($this->params['date_start'])? ' AND o.`date_add` >= "'.$this->params['date_start'].'"': '').' + '.(isset($this->params['date_end'])? ' AND o.`date_add` <= "'.$this->params['date_end'].'"': '').' + GROUP BY c.id_customer, od.id_discount'; + + foreach(Db::getInstance()->ExecuteS($query) as $line) { + $this->w($line); + } + + $query = ' + SELECT + '.(int) $sale->id.' AS id_sale, + "'.addslashes($sale->title[$id_lang]).'" AS `sale_title`, + o.id_order AS id_order, + c.id_customer AS id_customer, + IF(c.id_gender = 1, "M.", IF(c.id_gender = 2, "Mme", "")) AS gender, + c.email AS email, + c.firstname AS firstname, + c.lastname AS lastname, + a.firstname AS shipping_firstname, + a.lastname AS shipping_lastname, + a.address1 AS shipping_street, + a.address2 AS shipping_street2, + a.postcode AS shipping_postcode, + a.city AS shipping_city, + a.phone AS shipping_phone, + a.phone_mobile AS shipping_phone_mobile, + a.other AS other_info, + l.name AS shipping_country, + ca.id_carrier AS id_product, + 0 AS id_product_attribute, + ca.name AS order_product_name, + 1 AS product_quantity, + o.total_shipping / (1 + o.carrier_tax_rate / 100) AS product_price_base_wo_taxes, + o.carrier_tax_rate AS tax_rate, + ca.name AS product_name, + "" AS product_combination, + o.total_shipping / (1 + o.carrier_tax_rate / 100) AS product_price_wo_taxes, + o.total_shipping AS product_price, + 0 AS wholesale_price, + 0 AS combination_wholesale_price, + "SHIPPING" AS supplier_reference, + "" AS quantity_refunded, + "" AS quantity_returned, + 0 AS total_shipping, + IF( + (SELECT COUNT(id_order_detail) = 1 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.`id_order`) = 1, + 1, + (SELECT COUNT(id_order_detail) = 0 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.id_order + AND product_id NOT IN ('.implode(', ', $products).')) + ) AS `single`, + o.date_add AS `date`, + o.invoice_number AS invoice_number, + o.payment AS payment_type, + (SELECT hl.`name` FROM `'._DB_PREFIX_.'order_history` h, `'._DB_PREFIX_.'order_state_lang` hl WHERE h.id_order = o.id_order AND hl.id_lang = 2 and h.id_order_state = hl.id_order_state ORDER BY h.date_add DESC LIMIT 1) AS order_state, + IF(a.id_country = 6, "ES", "FR") AS version + FROM + `'._DB_PREFIX_.'orders` o, + `'._DB_PREFIX_.'carrier` ca, + `'._DB_PREFIX_.'customer` c, + `'._DB_PREFIX_.'address` a, + `'._DB_PREFIX_.'country_lang` l, + `'._DB_PREFIX_.'order_detail` d + WHERE c.id_customer = o.id_customer + AND (SELECT h.`id_order_state` FROM `'._DB_PREFIX_.'order_history` h WHERE h.id_order = o.id_order ORDER BY h.date_add DESC LIMIT 1) = 2 + AND l.id_country = a.id_country + AND l.id_lang = 2 + AND o.id_address_delivery = a.id_address + AND o.id_carrier = ca.id_carrier + AND d.id_order = o.id_order + AND (d.`product_id` = '.implode(' OR d.`product_id` = ', $products).') + '.(isset($this->params['date_start'])? ' AND o.`date_add` >= "'.$this->params['date_start'].'"': '').' + '.(isset($this->params['date_end'])? ' AND o.`date_add` <= "'.$this->params['date_end'].'"': '').' + GROUP BY o.id_order'; + + foreach(Db::getInstance()->ExecuteS($query) as $line) { + $this->w($line); + } + } + } else { + $sales = Sale::getSales(TRUE, NULL, NULL, 'current'); + foreach($sales as $sale) { + $products = $sale->getProducts(); + + if(count($products) > 0) { + $query = ' + SELECT + '.(int) $sale->id.' AS id_sale, + "'.addslashes($sale->title[$id_lang]).'" AS `sale_title`, + o.id_order AS id_order, + c.id_customer AS id_customer, + IF(c.id_gender = 1, "M.", IF(c.id_gender = 2, "Mme", "")) AS gender, + c.email AS email, + c.firstname AS firstname, + c.lastname AS lastname, + a.firstname AS shipping_firstname, + a.lastname AS shipping_lastname, + a.address1 AS shipping_street, + a.address2 AS shipping_street2, + a.postcode AS shipping_postcode, + a.city AS shipping_city, + a.phone AS shipping_phone, + a.phone_mobile AS shipping_phone_mobile, + a.other AS other_info, + l.name AS shipping_country, + d.product_id AS id_product, + d.product_attribute_id AS id_product_attribute, + d.product_name AS order_product_name, + d.product_quantity AS product_quantity, + d.product_price AS product_price_base_wo_taxes, + d.tax_rate AS tax_rate, + p.name AS product_name, + IF(d.product_attribute_id=0,"",REPLACE(d.product_name, CONCAT(p.name, " - "), "")) AS product_combination, + ROUND((d.product_price * (1 - d.reduction_percent / 100) - d.reduction_amount), 6) AS product_price_wo_taxes, + ROUND((d.product_price * (1 - d.reduction_percent / 100) - d.reduction_amount) * (1 + d.tax_rate / 100), 6) AS product_price, + pr.wholesale_price AS wholesale_price, + pa.wholesale_price AS combination_wholesale_price, + d.product_supplier_reference AS supplier_reference, + d.product_quantity_refunded AS quantity_refunded, + d.product_quantity_return AS quantity_returned, + o.total_shipping AS total_shipping, + IF( + (SELECT COUNT(id_order_detail) = 1 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.`id_order`) = 1, + 1, + (SELECT COUNT(id_order_detail) = 0 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.id_order + AND product_id NOT IN ('.implode(', ', $products).')) + ) AS `single`, + o.date_add AS `date`, + o.invoice_number AS invoice_number, + o.payment AS payment_type, + (SELECT hl.`name` FROM `'._DB_PREFIX_.'order_history` h, `'._DB_PREFIX_.'order_state_lang` hl WHERE h.id_order = o.id_order AND hl.id_lang = 2 and h.id_order_state = hl.id_order_state ORDER BY h.date_add DESC LIMIT 1) AS order_state + FROM + `'._DB_PREFIX_.'orders` o, + `'._DB_PREFIX_.'customer` c, + `'._DB_PREFIX_.'address` a, + `'._DB_PREFIX_.'country_lang` l, + `'._DB_PREFIX_.'product` pr, + `'._DB_PREFIX_.'product_lang` p, + `'._DB_PREFIX_.'order_detail` d + LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON pa.id_product_attribute = d.product_attribute_id + WHERE c.id_customer = o.id_customer + AND l.id_country = a.id_country + AND l.id_lang = 2 + AND o.id_address_delivery = a.id_address + AND d.id_order = o.id_order + AND p.id_product = d.product_id + AND pr.id_product = d.product_id + AND p.id_lang = 2 + AND (d.`product_id` = '.implode(' OR d.`product_id` = ', $products).') + '.(isset($this->params['date_start'])? ' AND o.`date_add` >= "'.$this->params['date_start'].'"': '').' + '.(isset($this->params['date_end'])? ' AND o.`date_add` <= "'.$this->params['date_end'].'"': '').' + '; + + foreach(Db::getInstance()->ExecuteS($query) as $line) { + $this->w($line); + } + + $query = ' + SELECT + '.(int) $sale->id.' AS id_sale, + "'.addslashes($sale->title[$id_lang]).'" AS `sale_title`, + o.id_order AS id_order, + c.id_customer AS id_customer, + IF(c.id_gender = 1, "M.", IF(c.id_gender = 2, "Mme", "")) AS gender, + c.email AS email, + c.firstname AS firstname, + c.lastname AS lastname, + a.firstname AS shipping_firstname, + a.lastname AS shipping_lastname, + a.address1 AS shipping_street, + a.address2 AS shipping_street2, + a.postcode AS shipping_postcode, + a.city AS shipping_city, + a.phone AS shipping_phone, + a.phone_mobile AS shipping_phone_mobile, + a.other AS other_info, + l.name AS shipping_country, + od.id_discount AS id_product, + 0 AS id_product_attribute, + od.name AS order_product_name, + 1 AS product_quantity, + 0-od.value AS product_price_base_wo_taxes, + 0 AS tax_rate, + od.name AS product_name, + "" AS product_combination, + 0-od.value AS product_price_wo_taxes, + 0-od.value AS product_price, + 0 AS wholesale_price, + 0 AS combination_wholesale_price, + "DISCOUNT" AS supplier_reference, + "" AS quantity_refunded, + "" AS quantity_returned, + 0 AS total_shipping, + IF( + (SELECT COUNT(id_order_detail) = 1 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.`id_order`) = 1, + 1, + (SELECT COUNT(id_order_detail) = 0 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.id_order + AND product_id NOT IN ('.implode(', ', $products).')) + ) AS `single`, + o.date_add AS `date`, + o.invoice_number AS invoice_number, + o.payment AS payment_type, + (SELECT hl.`name` FROM `'._DB_PREFIX_.'order_history` h, `'._DB_PREFIX_.'order_state_lang` hl WHERE h.id_order = o.id_order AND hl.id_lang = 2 and h.id_order_state = hl.id_order_state ORDER BY h.date_add DESC LIMIT 1) AS order_state + FROM + `'._DB_PREFIX_.'orders` o, + `'._DB_PREFIX_.'order_discount` od, + `'._DB_PREFIX_.'customer` c, + `'._DB_PREFIX_.'address` a, + `'._DB_PREFIX_.'country_lang` l, + `'._DB_PREFIX_.'order_detail` d + WHERE c.id_customer = o.id_customer + AND l.id_country = a.id_country + AND l.id_lang = 2 + AND o.id_address_delivery = a.id_address + AND d.id_order = o.id_order + AND od.id_order = o.id_order + AND (d.`product_id` = '.implode(' OR d.`product_id` = ', $products).') + '.(isset($this->params['date_start'])? ' AND o.`date_add` >= "'.$this->params['date_start'].'"': '').' + '.(isset($this->params['date_end'])? ' AND o.`date_add` <= "'.$this->params['date_end'].'"': '').' + GROUP BY c.id_customer, od.id_discount'; + + foreach(Db::getInstance()->ExecuteS($query) as $line) { + $this->w($line); + } + + $query = ' + SELECT + '.(int) $sale->id.' AS id_sale, + "'.addslashes($sale->title[$id_lang]).'" AS `sale_title`, + o.id_order AS id_order, + c.id_customer AS id_customer, + IF(c.id_gender = 1, "M.", IF(c.id_gender = 2, "Mme", "")) AS gender, + c.email AS email, + c.firstname AS firstname, + c.lastname AS lastname, + a.firstname AS shipping_firstname, + a.lastname AS shipping_lastname, + a.address1 AS shipping_street, + a.address2 AS shipping_street2, + a.postcode AS shipping_postcode, + a.city AS shipping_city, + a.phone AS shipping_phone, + a.phone_mobile AS shipping_phone_mobile, + a.other AS other_info, + l.name AS shipping_country, + ca.id_carrier AS id_product, + 0 AS id_product_attribute, + ca.name AS order_product_name, + 1 AS product_quantity, + o.total_shipping / (1 + o.carrier_tax_rate / 100) AS product_price_base_wo_taxes, + o.carrier_tax_rate AS tax_rate, + ca.name AS product_name, + "" AS product_combination, + o.total_shipping / (1 + o.carrier_tax_rate / 100) AS product_price_wo_taxes, + o.total_shipping AS product_price, + 0 AS wholesale_price, + 0 AS combination_wholesale_price, + "SHIPPING" AS supplier_reference, + "" AS quantity_refunded, + "" AS quantity_returned, + 0 AS total_shipping, + IF( + (SELECT COUNT(id_order_detail) = 1 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.`id_order`) = 1, + 1, + (SELECT COUNT(id_order_detail) = 0 + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = o.id_order + AND product_id NOT IN ('.implode(', ', $products).')) + ) AS `single`, + o.date_add AS `date`, + o.invoice_number AS invoice_number, + o.payment AS payment_type, + (SELECT hl.`name` FROM `'._DB_PREFIX_.'order_history` h, `'._DB_PREFIX_.'order_state_lang` hl WHERE h.id_order = o.id_order AND hl.id_lang = 2 and h.id_order_state = hl.id_order_state ORDER BY h.date_add DESC LIMIT 1) AS order_state + FROM + `'._DB_PREFIX_.'orders` o, + `'._DB_PREFIX_.'carrier` ca, + `'._DB_PREFIX_.'customer` c, + `'._DB_PREFIX_.'address` a, + `'._DB_PREFIX_.'country_lang` l, + `'._DB_PREFIX_.'order_detail` d + WHERE c.id_customer = o.id_customer + AND l.id_country = a.id_country + AND l.id_lang = 2 + AND o.id_address_delivery = a.id_address + AND o.id_carrier = ca.id_carrier + AND d.id_order = o.id_order + AND (d.`product_id` = '.implode(' OR d.`product_id` = ', $products).') + '.(isset($this->params['date_start'])? ' AND o.`date_add` >= "'.$this->params['date_start'].'"': '').' + '.(isset($this->params['date_end'])? ' AND o.`date_add` <= "'.$this->params['date_end'].'"': '').' + GROUP BY o.id_order'; + + foreach(Db::getInstance()->ExecuteS($query) as $line) { + $this->w($line); + } + } + } + } + } +} + +if(($id_sale = (int) Tools::getValue('id_sale')) +&& Tools::getValue('adtoken') === Tools::encrypt('PrivateSalesDirectExtract'.$id_sale)) { + $sale = new Sale($id_sale); + $e = new CronExport('privatesales', array( + 'headers' => array( + 'id_sale', + 'sale_title', + 'id_order', + 'id_customer', + 'gender', + 'email', + 'firstname', + 'lastname', + 'shipping_firstname', + 'shipping_lastname', + 'shipping_street', + 'shipping_street2', + 'shipping_postcode', + 'shipping_city', + 'shipping_phone', + 'shipping_phone_mobile', + 'other_info', + 'shipping_country', + 'id_product', + 'id_product_attribute', + 'order_product_name', + 'product_quantity', + 'product_price_base_wo_taxes', + 'tax_rate', + 'product_name', + 'product_combination', + 'product_price_wo_taxes', + 'product_price', + 'wholesale_price', + 'combination_wholesale_price', + 'supplier_reference', + 'quantity_refunded', + 'quantity_returned', + 'total_shipping', + 'single', + 'date', + 'invoice_number', + 'payment_type', + 'order_state', + ), + 'postfix' => '_'.$id_sale.'_manual', + 'dest_path' => '/../extracts/sales', + 'params' => array( + 'sale' => $sale, + ), + )); + $e->run(); + + header('Content-Type: application/force-download; name="'.basename($e->filename).'"'); + header("Content-Transfer-Encoding: binary"); + header('Content-Disposition: attachment; filename="'.basename($e->filename).'"'); + header('Expires: 0'); + header('Cache-Control: no-cache, must-revalidate'); + header('Pragma: no-cache'); + echo file_get_contents($e->filename); + unlink($e->filename); + exit; +} diff --git a/modules/exports/exports/users.php b/modules/exports/exports/users.php new file mode 100755 index 00000000..87513f7d --- /dev/null +++ b/modules/exports/exports/users.php @@ -0,0 +1,46 @@ +ExecuteS(' + SELECT `id_customer` + FROM `'._DB_PREFIX_.'customer` + WHERE `date_add` < NOW() + '); + + foreach($users as $user) { + $customer = new Customer((int) $user['id_customer']); + + $sponsor = Db::getInstance()->ExecuteS(' + SELECT c.`email` + FROM `'._DB_PREFIX_.'customer` c + LEFT JOIN `'._DB_PREFIX_.'invite` r + ON r.`id_sponsor` = c.`id_customer` + WHERE r.`id_customer` = '.$user['id_customer'] + ); + + if(count($sponsor) > 0) { + $sponsor_email = $sponsor[0]['email']; + } else { + $sponsor_email = ''; + } + + $stats = $customer->getStats(); + + $line = array( + $customer->email, + $sponsor_email, + $customer->date_add, + ($stats['total_orders'] === NULL? 0.0: $stats['total_orders']), + $customer->newsletter, + $customer->optin, + ); + + $this->w($line); + } + } +} diff --git a/modules/exports/fr.php b/modules/exports/fr.php new file mode 100755 index 00000000..328893f2 --- /dev/null +++ b/modules/exports/fr.php @@ -0,0 +1,6 @@ +exports_66f453635e90471db1a336ccc17cc7de'] = 'Exports'; +$_MODULE['<{exports}prestashop>exports_9fdd21b4210a2c19fedcae7bd8531169'] = 'Ajoute une fonctionnalité d\'export automatique à Prestashop'; diff --git a/modules/exports/index.php b/modules/exports/index.php new file mode 100755 index 00000000..a344ca6f --- /dev/null +++ b/modules/exports/index.php @@ -0,0 +1,37 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 6594 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; +?> \ No newline at end of file diff --git a/modules/exports/logo.gif b/modules/exports/logo.gif new file mode 100755 index 00000000..659aace8 Binary files /dev/null and b/modules/exports/logo.gif differ diff --git a/modules/expresscart/ajax.php b/modules/expresscart/ajax.php new file mode 100755 index 00000000..e13315a3 --- /dev/null +++ b/modules/expresscart/ajax.php @@ -0,0 +1,200 @@ +preProcess(); + + +function formatQuantityDiscounts($specificPrices, $price, $taxRate) { + foreach($specificPrices as $key => &$row) { + $row['quantity'] = &$row['from_quantity']; + // The price may be directly set + if ($row['price'] != 0) { + $cur_price = (Product::$_taxCalculationMethod == PS_TAX_EXC? $row['price']: $row['price'] * (1 + $taxRate / 100)); + if($row['reduction_type'] == 'amount') { + $cur_price = Product::$_taxCalculationMethod == PS_TAX_INC? $cur_price - $row['reduction']: $cur_price - ($row['reduction'] / (1 + $taxRate / 100)); + } else { + $cur_price = $cur_price * ( 1 - ($row['reduction'])); + } + $row['real_value'] = $price - $cur_price; + } else { + global $cookie; + $id_currency = (int) $cookie->id_currency; + + if($row['reduction_type'] == 'amount') { + $reduction_amount = $row['reduction']; + if(!$row['id_currency']) { + $reduction_amount = Tools::convertPrice($reduction_amount, $id_currency); + } + + $row['real_value'] = Product::$_taxCalculationMethod == PS_TAX_INC? $reduction_amount: $reduction_amount / (1 + $taxRate / 100); + } else { + $row['real_value'] = $row['reduction'] * 100; + } + } + $row['nextQuantity'] = (isset($specificPrices[$key + 1])? (int)($specificPrices[$key + 1]['from_quantity']): -1); + } + return $specificPrices; +} + +$result = ''; + +if($id_product = (int) Tools::getValue('id_product')) { + $product = new Product($id_product, true, (int) $cookie->id_lang); + if(Validate::isLoadedObject($product)) { + $ecotax_rate = (float) Tax::getProductEcotaxRate($cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); + $ecotaxTaxAmount = Tools::ps_round($product->ecotax, 2); + if(Product::$_taxCalculationMethod == PS_TAX_INC && (int) Configuration::get('PS_TAX')) { + $ecotaxTaxAmount = Tools::ps_round($ecotaxTaxAmount * (1 + $ecotax_rate / 100), 2); + } + + $id_customer = (isset($cookie->id_customer) && $cookie->id_customer)? (int) $cookie->id_customer: 0; + $id_group = $id_customer ? (int) Customer::getDefaultGroupId($id_customer): _PS_DEFAULT_CUSTOMER_GROUP_; + $id_country = (int) ($id_customer? Customer::getCurrentCountry($id_customer): Configuration::get('PS_COUNTRY_DEFAULT')); + $ps_language = new Language((int) $cookie->id_lang); + + $group_reduction = GroupReduction::getValueForProduct($product->id, $id_group); + if($group_reduction == 0) { + $group_reduction = Group::getReduction((int) $cookie->id_customer) / 100; + } + + $tax = (float) Tax::getProductTaxRate((int) $product->id, $cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); + + $productPriceWithTax = Product::getPriceStatic($product->id, TRUE, NULL, 6); + if(Product::$_taxCalculationMethod == PS_TAX_INC) { + $productPriceWithTax = Tools::ps_round($productPriceWithTax, 2); + } + $productPriceWithoutEcoTax = (float) ($productPriceWithTax - $product->ecotax); + + $colors = array(); + $attributesGroups = $product->getAttributesGroups((int) $cookie->id_lang); + if(is_array($attributesGroups) && $attributesGroups) { + $groups = array(); + $combinationImages = $product->getCombinationImages((int) $cookie->id_lang); + foreach($attributesGroups as $k => $row) { + /* Color management */ + if(((isset($row['attribute_color']) && $row['attribute_color']) || (file_exists(_PS_COL_IMG_DIR_.$row['id_attribute'].'.jpg'))) && $row['id_attribute_group'] == $product->id_color_default) { + $colors[$row['id_attribute']]['value'] = $row['attribute_color']; + $colors[$row['id_attribute']]['name'] = $row['attribute_name']; + if(!isset($colors[$row['id_attribute']]['attributes_quantity'])) { + $colors[$row['id_attribute']]['attributes_quantity'] = 0; + } + $colors[$row['id_attribute']]['attributes_quantity'] += (int)($row['quantity']); + } + + if(!isset($groups[$row['id_attribute_group']])) { + $groups[$row['id_attribute_group']] = array( + 'name' => $row['public_group_name'], + 'is_color_group' => $row['is_color_group'], + 'default' => -1, + ); + } + + $groups[$row['id_attribute_group']]['attributes'][$row['id_attribute']] = $row['attribute_name']; + if($row['default_on'] && $groups[$row['id_attribute_group']]['default'] == -1) { + $groups[$row['id_attribute_group']]['default'] = (int)($row['id_attribute']); + } + if(!isset($groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']])) { + $groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']] = 0; + } + $groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']] += (int)($row['quantity']); + + $combinations[$row['id_product_attribute']]['attributes_values'][$row['id_attribute_group']] = $row['attribute_name']; + $combinations[$row['id_product_attribute']]['attributes'][] = (int) $row['id_attribute']; + $combinations[$row['id_product_attribute']]['price'] = (float) $row['price']; + $combinations[$row['id_product_attribute']]['ecotax'] = (float) $row['ecotax']; + $combinations[$row['id_product_attribute']]['weight'] = (float) $row['weight']; + $combinations[$row['id_product_attribute']]['quantity'] = (int) $row['quantity']; + $combinations[$row['id_product_attribute']]['reference'] = $row['reference']; + $combinations[$row['id_product_attribute']]['ean13'] = $row['ean13']; + $combinations[$row['id_product_attribute']]['unit_impact'] = $row['unit_price_impact']; + $combinations[$row['id_product_attribute']]['minimal_quantity'] = $row['minimal_quantity']; + $combinations[$row['id_product_attribute']]['id_image'] = isset($combinationImages[$row['id_product_attribute']][0]['id_image'])? $combinationImages[$row['id_product_attribute']][0]['id_image']: -1; + } + + //wash attributes list (if some attributes are unavailables and if allowed to wash it) + if(!Product::isAvailableWhenOutOfStock($product->out_of_stock) && Configuration::get('PS_DISP_UNAVAILABLE_ATTR') == 0) { + foreach($groups as &$group) { + foreach($group['attributes_quantity'] as $key => &$quantity) { + if(!$quantity) { + unset($group['attributes'][$key]); + } + } + } + + foreach($colors as $key => $color) { + if(!$color['attributes_quantity']) { + unset($colors[$key]); + } + } + } + + foreach($groups as &$group) { + natcasesort($group['attributes']); + } + + foreach($combinations as $id_product_attribute => $comb) { + $attributeList = ''; + foreach($comb['attributes'] as $id_attribute) { + $attributeList .= '\''.(int) $id_attribute.'\','; + } + $attributeList = rtrim($attributeList, ','); + $combinations[$id_product_attribute]['list'] = $attributeList; + } + + $smarty->assign(array( + 'groups' => $groups, + 'combinaisons' => $combinations, /* Kept for compatibility purpose only */ + 'combinations' => $combinations, + 'colors' => (sizeof($colors) && $product->id_color_default)? $colors: FALSE, + 'combinationImages' => $combinationImages, + )); + } + + $smarty->assign(array( + 'cartex' => Module::isInstalled('blockcartex'), + 'product' => $product, + 'quantity_discounts' => formatQuantityDiscounts(SpecificPrice::getQuantityDiscounts((int) $product->id, (int) Shop::getCurrentShop(), (int) $cookie->id_currency, $id_country, $id_group), $product->getPrice(Product::$_taxCalculationMethod == PS_TAX_INC, FALSE), (float) $tax), + 'ecotax_tax_inc' => $ecotaxTaxAmount, + 'tax_rate' => $tax, + 'ecotax_tax_exc' => Tools::ps_round($product->ecotax, 2), + 'ecotaxTax_rate' => $ecotax_rate, + 'product_manufacturer' => new Manufacturer((int) $product->id_manufacturer, $cookie->id_lang), + 'static_token' => Tools::getToken(FALSE), + 'token' => Tools::getToken(), + 'lang_iso' => $ps_language->iso_code, + 'productPriceWithoutEcoTax' => (float) $productPriceWithoutEcoTax, + 'PS_CATALOG_MODE' => (bool) Configuration::get('PS_CATALOG_MODE'), + 'allow_oosp' => $product->isAvailableWhenOutOfStock((int) $product->out_of_stock), + 'last_qties' => (int) Configuration::get('PS_LAST_QTIES'), + 'group_reduction' => (1 - $group_reduction), + 'ENT_NOQUOTES' => ENT_NOQUOTES, + 'priceDisplay' => Product::getTaxCalculationMethod(), + 'roundMode' => (int) Configuration::get('PS_PRICE_ROUND_MODE'), + 'outOfStockAllowed' => (int) Configuration::get('PS_ORDER_OUT_OF_STOCK'), + 'tax_enabled' => Configuration::get('PS_TAX'), + 'display_qties' => (int) Configuration::get('PS_DISPLAY_QTIES'), + 'display_ht' => !Tax::excludeTaxeOption(), + 'ecotax' => ($product->ecotax > 0? Tools::convertPrice((float) $product->ecotax): 0), + 'currencySign' => $currency->sign, + 'currencyRate' => $currency->conversion_rate, + 'currencyFormat' => $currency->format, + 'currencyBlank' => $currency->blank, + 'priceDisplayPrecision' => _PS_PRICE_DISPLAY_PRECISION_, + 'no_tax' => Tax::excludeTaxeOption() || !Tax::getProductTaxRate((int) $product->id, $cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}), + 'customizationFields' => ($product->customizable? $product->getCustomizationFields((int) $cookie->id_lang): FALSE), + 'packItems' => $product->cache_is_pack? Pack::getItemTable($product->id, (int) $cookie->id_lang, TRUE): array(), + 'packs' => Pack::getPacksTable($product->id, (int) $cookie->id_lang, TRUE, 1), + 'virtual' => ProductDownload::getIdFromIdProduct((int) $product->id), + )); + $result = $smarty->fetch(file_exists(_PS_THEME_DIR_.'modules/expresscart/product.tpl')? '../../themes/'._THEME_NAME_.'/modules/expresscart/product.tpl': 'product.tpl', __FILE__); + } else { + $smarty->assign('error', 'product_missing'); + $result = $smarty->fetch(file_exists(_PS_THEME_DIR_.'modules/expresscart/error.tpl')? '../../themes/'._THEME_NAME_.'/modules/expresscart/error.tpl': 'error.tpl', __FILE__); + } +} else { + $smarty->assign('error', 'product_missing'); + $result = $smarty->fetch(file_exists(_PS_THEME_DIR_.'modules/expresscart/error.tpl')? '../../themes/'._THEME_NAME_.'/modules/expresscart/error.tpl': 'error.tpl', __FILE__); +} + +echo $result; diff --git a/modules/expresscart/arrow.png b/modules/expresscart/arrow.png new file mode 100755 index 00000000..39f551e9 Binary files /dev/null and b/modules/expresscart/arrow.png differ diff --git a/modules/expresscart/en.php b/modules/expresscart/en.php new file mode 100644 index 00000000..e69de29b diff --git a/modules/expresscart/error.tpl b/modules/expresscart/error.tpl new file mode 100755 index 00000000..9daf4503 --- /dev/null +++ b/modules/expresscart/error.tpl @@ -0,0 +1,7 @@ ++{if $error == 'product_missing'} +{l s='Request error, product not found.' mod='expresscart'} +{else} +{l s='An unknown error happened.' mod='expresscart'} +{/if} +
diff --git a/modules/expresscart/es.php b/modules/expresscart/es.php new file mode 100644 index 00000000..1715b9c3 --- /dev/null +++ b/modules/expresscart/es.php @@ -0,0 +1,34 @@ +error_68b400b859530b4eb3f678a3181999b7'] = 'Error de petición, el producto no ha sido encontrado.'; +$_MODULE['<{expresscart}prestashop>error_dde34cf46c8681ac773d29f8a154b023'] = 'Se ha producido un error.'; +$_MODULE['<{expresscart}prestashop>expresscart_28f9a42881ef5b8582dab0adf8da399a'] = 'Cesta express'; +$_MODULE['<{expresscart}prestashop>expresscart_f4e52ae1c73ac790d59f53353d023a44'] = 'Introduce una funcionalidad para añadir de forma express a tu cesta en la lista de productos'; +$_MODULE['<{expresscart}prestashop>header_24c8f2bf368ff9e185df64315edd5919'] = 'Compra express'; +$_MODULE['<{expresscart}prestashop>product_e4aae275fc6b4d57daab4431b8bf736c'] = 'Este producto no existe en esta variante.'; +$_MODULE['<{expresscart}prestashop>product_bc0f7082192ef02e934a036cf4991789'] = 'Stock agotado'; +$_MODULE['<{expresscart}prestashop>product_9173701581f0213f0104e064479e4ca3'] = 'pero aún queda stock de otras características'; +$_MODULE['<{expresscart}prestashop>product_78a2d6a3d6741d9d2cbff658d5df7cd8'] = 'Enviando, por favor espere...'; +$_MODULE['<{expresscart}prestashop>product_c1f25211403ec7459f265788cdbee403'] = 'Completa todos los campos, y guarda tu personalización'; +$_MODULE['<{expresscart}prestashop>product_98b0a68a7e4c7b265a5ca9a0b733d96e'] = 'Escoge un color :'; +$_MODULE['<{expresscart}prestashop>product_ea23e12cae068315b351f8d36d432d76'] = 'Código :'; +$_MODULE['<{expresscart}prestashop>product_2c59ffd0a6631127450d729861975719'] = 'Cantidad :'; +$_MODULE['<{expresscart}prestashop>product_07d814a3df5cfd2d637e77b215519034'] = 'Tienes que añadir un mínimo '; +$_MODULE['<{expresscart}prestashop>product_f3bbad73b35f19730399b3da21c3ef32'] = ' cantidades para comprar este producto.'; +$_MODULE['<{expresscart}prestashop>product_2899c37ef52d87fe2f4a1fe58220be2a'] = 'Precio aconsejado :'; +$_MODULE['<{expresscart}prestashop>product_588907ab2d492aca0b07b5bf9c931eea'] = 'Rebajado'; +$_MODULE['<{expresscart}prestashop>product_800e90e940e7f1fb938b0fda5137f38c'] = 'Rebajado !'; +$_MODULE['<{expresscart}prestashop>product_ca2bf12169883f4982d8fe34b7e3c618'] = 'Precio rebajado !'; +$_MODULE['<{expresscart}prestashop>product_9e383b9c67ba8412eea358abe821961e'] = 'Precio Bébé Boutik : '; +$_MODULE['<{expresscart}prestashop>product_887ee91702c962a70b87cbef07bbcaec'] = 'sin IVA'; +$_MODULE['<{expresscart}prestashop>product_ae0f500600029a1a5426495e82204ba6'] = '(descuento de'; +$_MODULE['<{expresscart}prestashop>product_9371d7a2e3ae86a00aab4771e39d255d'] = ')'; +$_MODULE['<{expresscart}prestashop>product_7bb63c7de5a5ee79356083a12f21e1e8'] = 'en vez de'; +$_MODULE['<{expresscart}prestashop>product_d436eb0fd9de10b54a828ce6435f7e81'] = 'del cuál'; +$_MODULE['<{expresscart}prestashop>product_f85524c253c150e88136df3999ac3fd4'] = 'de ecoparticipación'; +$_MODULE['<{expresscart}prestashop>product_a134618182b99ff9151d7e0b6b92410a'] = '(no se incluirá en la reducción)'; +$_MODULE['<{expresscart}prestashop>product_fe3838c7c11aa406dd956566e17360d5'] = 'por'; +$_MODULE['<{expresscart}prestashop>product_2d0f6b8300be19cf35e89e66f0677f95'] = 'Añadir a la cesta'; +$_MODULE['<{expresscart}prestashop>product_8c751c4aab0db0b811cdfbddf0b4ea56'] = 'Disponibilidad :'; diff --git a/modules/expresscart/expresscart.php b/modules/expresscart/expresscart.php new file mode 100755 index 00000000..7b78ec3d --- /dev/null +++ b/modules/expresscart/expresscart.php @@ -0,0 +1,30 @@ +name = 'expresscart'; + $this->tab = 'front_office_features'; + $this->version = '1.0'; + + parent::__construct(); + + $this->displayName = $this->l('Express Cart'); + $this->description = $this->l('Adds a quick add-to-cart feature to the product list.'); + } + + public function install() { + if(!parent::install() + OR !$this->registerHook('header')) { + return FALSE; + } + + return TRUE; + } + + public function hookHeader() { + if($id_category = Tools::getValue('id_category')) { + global $smarty; + $smarty->assign('id_category', $id_category); + return $this->display(__FILE__, 'header.tpl'); + } + } +} diff --git a/modules/expresscart/fr.php b/modules/expresscart/fr.php new file mode 100755 index 00000000..1b7f464e --- /dev/null +++ b/modules/expresscart/fr.php @@ -0,0 +1,34 @@ +error_68b400b859530b4eb3f678a3181999b7'] = 'Erreur de requête, le produit n\'a pas été trouvé.'; +$_MODULE['<{expresscart}prestashop>error_dde34cf46c8681ac773d29f8a154b023'] = 'Une erreur s\'est produite.'; +$_MODULE['<{expresscart}prestashop>expresscart_28f9a42881ef5b8582dab0adf8da399a'] = 'Panier express'; +$_MODULE['<{expresscart}prestashop>expresscart_f4e52ae1c73ac790d59f53353d023a44'] = 'Ajoute une fonctionnalité d\'ajout express au panier sur la liste des produits'; +$_MODULE['<{expresscart}prestashop>header_24c8f2bf368ff9e185df64315edd5919'] = 'Achat express'; +$_MODULE['<{expresscart}prestashop>product_e4aae275fc6b4d57daab4431b8bf736c'] = 'Ce produit n\'existe pas dans cette déclinaison.'; +$_MODULE['<{expresscart}prestashop>product_bc0f7082192ef02e934a036cf4991789'] = 'Stock épuisé'; +$_MODULE['<{expresscart}prestashop>product_9173701581f0213f0104e064479e4ca3'] = 'mais il reste du stock avec d\'autres options'; +$_MODULE['<{expresscart}prestashop>product_78a2d6a3d6741d9d2cbff658d5df7cd8'] = 'Envoi en cours, merci de bien vouloir patienter...'; +$_MODULE['<{expresscart}prestashop>product_c1f25211403ec7459f265788cdbee403'] = 'Merci de remplir tous les champs, ensuite enregistrez votre personnalisation'; +$_MODULE['<{expresscart}prestashop>product_98b0a68a7e4c7b265a5ca9a0b733d96e'] = 'Choisissez un coloris :'; +$_MODULE['<{expresscart}prestashop>product_ea23e12cae068315b351f8d36d432d76'] = 'Réfécence :'; +$_MODULE['<{expresscart}prestashop>product_2c59ffd0a6631127450d729861975719'] = 'Quantité :'; +$_MODULE['<{expresscart}prestashop>product_07d814a3df5cfd2d637e77b215519034'] = 'Vous devez ajouter au minimum '; +$_MODULE['<{expresscart}prestashop>product_f3bbad73b35f19730399b3da21c3ef32'] = ' quantités pour acheter ce produit.'; +$_MODULE['<{expresscart}prestashop>product_2899c37ef52d87fe2f4a1fe58220be2a'] = 'Prix conseillé :'; +$_MODULE['<{expresscart}prestashop>product_588907ab2d492aca0b07b5bf9c931eea'] = 'En solde'; +$_MODULE['<{expresscart}prestashop>product_800e90e940e7f1fb938b0fda5137f38c'] = 'En solde !'; +$_MODULE['<{expresscart}prestashop>product_ca2bf12169883f4982d8fe34b7e3c618'] = 'Prix réduit !'; +$_MODULE['<{expresscart}prestashop>product_9e383b9c67ba8412eea358abe821961e'] = 'Prix Bébé Boutik : '; +$_MODULE['<{expresscart}prestashop>product_887ee91702c962a70b87cbef07bbcaec'] = 'HT'; +$_MODULE['<{expresscart}prestashop>product_ae0f500600029a1a5426495e82204ba6'] = '(remise de'; +$_MODULE['<{expresscart}prestashop>product_9371d7a2e3ae86a00aab4771e39d255d'] = ')'; +$_MODULE['<{expresscart}prestashop>product_7bb63c7de5a5ee79356083a12f21e1e8'] = 'au lieu de'; +$_MODULE['<{expresscart}prestashop>product_d436eb0fd9de10b54a828ce6435f7e81'] = 'dont'; +$_MODULE['<{expresscart}prestashop>product_f85524c253c150e88136df3999ac3fd4'] = 'd\'eco-participation'; +$_MODULE['<{expresscart}prestashop>product_a134618182b99ff9151d7e0b6b92410a'] = '(ne sera pas compris dans la réduction)'; +$_MODULE['<{expresscart}prestashop>product_fe3838c7c11aa406dd956566e17360d5'] = 'par'; +$_MODULE['<{expresscart}prestashop>product_2d0f6b8300be19cf35e89e66f0677f95'] = 'Ajouter au panier'; +$_MODULE['<{expresscart}prestashop>product_8c751c4aab0db0b811cdfbddf0b4ea56'] = 'Disponibilité :'; diff --git a/modules/expresscart/header.tpl b/modules/expresscart/header.tpl new file mode 100755 index 00000000..52c3ee5d --- /dev/null +++ b/modules/expresscart/header.tpl @@ -0,0 +1,64 @@ + diff --git a/modules/expresscart/logo.gif b/modules/expresscart/logo.gif new file mode 100755 index 00000000..913d2472 Binary files /dev/null and b/modules/expresscart/logo.gif differ diff --git a/modules/expresscart/product.tpl b/modules/expresscart/product.tpl new file mode 100755 index 00000000..62d57514 --- /dev/null +++ b/modules/expresscart/product.tpl @@ -0,0 +1,561 @@ + + + +{l s='Pick a color:' mod='expresscart' js=1}
+ +'.$this->l('You have to configure "General Settings" tab before using this tab.').'
'.$this->l('In this tab, you can set a specific configuration for each category.').'
'.$this->l('ID Config').' | +'.$this->l('Category').' | +'.$this->l('Pickup type').' | +'.$this->l('Packaging type').' | +'.$this->l('Additional charges').' | +'.$this->l('Services').' | +'.$this->l('Actions').' | +
---|---|---|---|---|---|---|
'.$this->l('There is no specific FEDEX configuration for categories at this point.').' | ||||||
'.$c['id_fedex_rate_config'].' | +'.$path.' | +'.(isset($this->_pickupTypeList[$c['pickup_type_code']]) ? $this->_pickupTypeList[$c['pickup_type_code']] : '-').' | +'.(isset($this->_packagingTypeList[$c['packaging_type_code']]) ? $this->_packagingTypeList[$c['packaging_type_code']] : '-').' | +'.$c['additional_charges'].' '.$configCurrency->sign.' | +'.$services.' | ++ + + + + | +
'.$this->l('Update a rule').' ('.$this->l('Add a rule').' ?)
+ '; + } + else + { + $html .= ''.$this->l('Add a rule').'
+ '; + } + + return $html; + } + + private function _postValidationCategory() + { + // Check post values + if (Tools::getValue('id_category') == NULL) + $this->_postErrors[] = $this->l('You have to select a category.'); + + if (!$this->_postErrors) + { + $id_fedex_rate_config = Db::getInstance()->getValue('SELECT `id_fedex_rate_config` FROM `'._DB_PREFIX_.'fedex_rate_config` WHERE `id_category` = '.(int)Tools::getValue('id_category')); + + // Check if a config does not exist in Add case + if ($id_fedex_rate_config > 0 && Tools::getValue('action') == 'add') + $this->_postErrors[] = $this->l('This category already has a specific FEDEX configuration.'); + + // Check if a config exists and if the IDs config correspond in Upd case + if (Tools::getValue('action') == 'edit' && (!isset($id_fedex_rate_config) || $id_fedex_rate_config != Tools::getValue('id_fedex_rate_config'))) + $this->_postErrors[] = $this->l('An error occurred, please try again.'); + + // Check if a config exists in Delete case + if (Tools::getValue('action') == 'delete' && !isset($id_fedex_rate_config)) + $this->_postErrors[] = $this->l('An error occurred, please try again.'); + } + } + + private function _postProcessCategory() + { + // Init Var + $date = date('Y-m-d H:i:s'); + $services = Tools::getValue('service'); + + // Add Script + if (Tools::getValue('action') == 'add') + { + $addTab = array( + 'id_product' => 0, + 'id_category' => (int)(Tools::getValue('id_category')), + 'id_currency' => (int)(Configuration::get('PS_CURRENCY_DEFAULT')), + 'pickup_type_code' => pSQL(Tools::getValue('pickup_type_code')), + 'packaging_type_code' => pSQL(Tools::getValue('packaging_type_code')), + 'additional_charges' => pSQL(Tools::getValue('additional_charges')), + 'date_add' => pSQL($date), + 'date_upd' => pSQL($date) + ); + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_config', $addTab, 'INSERT'); + $id_fedex_rate_config = Db::getInstance()->Insert_ID(); + foreach ($services as $s) + { + $addTab = array('id_fedex_rate_service_code' => pSQL($s), 'id_fedex_rate_config' => (int)$id_fedex_rate_config, 'date_add' => pSQL($date), 'date_upd' => pSQL($date)); + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_config_service', $addTab, 'INSERT'); + } + + // Display Results + if ($id_fedex_rate_config > 0) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + + // Update Script + if (Tools::getValue('action') == 'edit' && Tools::getValue('id_fedex_rate_config')) + { + $updTab = array( + 'id_currency' => (int)(Configuration::get('PS_CURRENCY_DEFAULT')), + 'pickup_type_code' => pSQL(Tools::getValue('pickup_type_code')), + 'packaging_type_code' => pSQL(Tools::getValue('packaging_type_code')), + 'additional_charges' => pSQL(Tools::getValue('additional_charges')), + 'date_upd' => pSQL($date) + ); + $result = Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_config', $updTab, 'UPDATE', '`id_fedex_rate_config` = '.(int)Tools::getValue('id_fedex_rate_config')); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'fedex_rate_config_service` WHERE `id_fedex_rate_config` = '.(int)Tools::getValue('id_fedex_rate_config')); + foreach ($services as $s) + { + $addTab = array('id_fedex_rate_service_code' => pSQL($s), 'id_fedex_rate_config' => (int)Tools::getValue('id_fedex_rate_config'), 'date_add' => pSQL($date), 'date_upd' => pSQL($date)); + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_config_service', $addTab, 'INSERT'); + } + + // Display Results + if ($result) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + + // Delete Script + if (Tools::getValue('action') == 'delete' && Tools::getValue('id_fedex_rate_config')) + { + $result1 = Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'fedex_rate_config` WHERE `id_fedex_rate_config` = '.(int)Tools::getValue('id_fedex_rate_config')); + $result2 = Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'fedex_rate_config_service` WHERE `id_fedex_rate_config` = '.(int)Tools::getValue('id_fedex_rate_config')); + + // Display Results + if ($result1) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + } + + + + /* + ** Product Form Config Methods + ** + */ + + private function _displayFormProduct() + { + global $cookie; + + // Check if the module is configured + if (!$this->_webserviceTestResult) + return ''.$this->l('You have to configure "General Settings" tab before using this tab.').'
'.$this->l('In this tab, you can set a specific configuration for each product.').'
'.$this->l('ID Config').' | +'.$this->l('Product').' | +'.$this->l('Pickup type').' | +'.$this->l('Packaging type').' | +'.$this->l('Additional charges').' | +'.$this->l('Services').' | +'.$this->l('Actions').' | +
---|---|---|---|---|---|---|
'.$this->l('There is no specific FEDEX configuration for products at this point.').' | ||||||
'.$c['id_fedex_rate_config'].' | +'.$product->name.' | +'.(isset($this->_pickupTypeList[$c['pickup_type_code']]) ? $this->_pickupTypeList[$c['pickup_type_code']] : '-').' | +'.(isset($this->_packagingTypeList[$c['packaging_type_code']]) ? $this->_packagingTypeList[$c['packaging_type_code']] : '-').' | +'.$c['additional_charges'].' '.$configCurrency->sign.' | +'.$services.' | ++ + + + + | +
'.$this->l('Update a rule').' ('.$this->l('Add a rule').' ?)
+ '; + } + else + { + $html .= ''.$this->l('Add a rule').'
+ '; + } + + return $html; + } + + private function _postValidationProduct() + { + // Check post values + if (Tools::getValue('id_product') == NULL) + $this->_postErrors[] = $this->l('You have to select a product.'); + + if (!$this->_postErrors) + { + $id_fedex_rate_config = Db::getInstance()->getValue('SELECT `id_fedex_rate_config` FROM `'._DB_PREFIX_.'fedex_rate_config` WHERE `id_product` = '.(int)Tools::getValue('id_product')); + + // Check if a config does not exist in Add case + if ($id_fedex_rate_config > 0 && Tools::getValue('action') == 'add') + $this->_postErrors[] = $this->l('This product already has a specific FEDEX configuration.'); + + // Check if a config exists and if the IDs config correspond in Upd case + if (Tools::getValue('action') == 'edit' && (!isset($id_fedex_rate_config) || $id_fedex_rate_config != Tools::getValue('id_fedex_rate_config'))) + $this->_postErrors[] = $this->l('An error occurred, please try again.'); + + // Check if a config exists in Delete case + if (Tools::getValue('action') == 'delete' && !isset($id_fedex_rate_config)) + $this->_postErrors[] = $this->l('An error occurred, please try again.'); + } + } + + private function _postProcessProduct() + { + // Init Var + $date = date('Y-m-d H:i:s'); + $services = Tools::getValue('service'); + + // Add Script + if (Tools::getValue('action') == 'add') + { + $addTab = array( + 'id_product' => (int)(Tools::getValue('id_product')), + 'id_category' => 0, + 'id_currency' => (int)(Configuration::get('PS_CURRENCY_DEFAULT')), + 'pickup_type_code' => pSQL(Tools::getValue('pickup_type_code')), + 'packaging_type_code' => pSQL(Tools::getValue('packaging_type_code')), + 'additional_charges' => pSQL(Tools::getValue('additional_charges')), + 'date_add' => pSQL($date), + 'date_upd' => pSQL($date) + ); + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_config', $addTab, 'INSERT'); + $id_fedex_rate_config = Db::getInstance()->Insert_ID(); + foreach ($services as $s) + { + $addTab = array('id_fedex_rate_service_code' => pSQL($s), 'id_fedex_rate_config' => (int)$id_fedex_rate_config, 'date_add' => pSQL($date), 'date_upd' => pSQL($date)); + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_config_service', $addTab, 'INSERT'); + } + + // Display Results + if ($id_fedex_rate_config > 0) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + + // Update Script + if (Tools::getValue('action') == 'edit' && Tools::getValue('id_fedex_rate_config')) + { + $updTab = array( + 'id_currency' => (int)(Configuration::get('PS_CURRENCY_DEFAULT')), + 'pickup_type_code' => pSQL(Tools::getValue('pickup_type_code')), + 'packaging_type_code' => pSQL(Tools::getValue('packaging_type_code')), + 'additional_charges' => pSQL(Tools::getValue('additional_charges')), + 'date_upd' => pSQL($date) + ); + $result = Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_config', $updTab, 'UPDATE', '`id_fedex_rate_config` = '.(int)Tools::getValue('id_fedex_rate_config')); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'fedex_rate_config_service` WHERE `id_fedex_rate_config` = '.(int)Tools::getValue('id_fedex_rate_config')); + foreach ($services as $s) + { + $addTab = array('id_fedex_rate_service_code' => pSQL($s), 'id_fedex_rate_config' => (int)Tools::getValue('id_fedex_rate_config'), 'date_add' => pSQL($date), 'date_upd' => pSQL($date)); + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_config_service', $addTab, 'INSERT'); + } + + // Display Results + if ($result) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + + // Delete Script + if (Tools::getValue('action') == 'delete' && Tools::getValue('id_fedex_rate_config')) + { + $result1 = Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'fedex_rate_config` WHERE `id_fedex_rate_config` = '.(int)Tools::getValue('id_fedex_rate_config')); + $result2 = Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'fedex_rate_config_service` WHERE `id_fedex_rate_config` = '.(int)Tools::getValue('id_fedex_rate_config')); + + // Display Results + if ($result1) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + } + + + + /* + ** Help Config Methods + ** + */ + + private function _displayHelp() + { + return ''.$this->l('Welcome to the PrestaShop FEDEX Module configurator.').'
+'.$this->l('This section will help you to understand how to configure this module correctly.').'
+1. '.$this->l('General Settings').'
+'.$this->l('See below for the description of each field :').'
+'.$this->l('Your FEDEX Account').' : '.$this->l('You must subscribe to FEDEX website at this address').' http://www.fedex.com/webtools/
+'.$this->l('Zip / Postal Code').' : '.$this->l('This field must be the Zip / Postal code of your package starting point.').'
+'.$this->l('Country').' : '.$this->l('This field must be the country of your package starting point.').'
+'.$this->l('Pickup Type').' : '.$this->l('This field corresponds to the default pickup type (when there is no specific configuration for the product or the category product).').'
+'.$this->l('Delivery Service').' : '.$this->l('These checkboxes correspond to the delivery services you want to be available (when there is no specific configuration for the product or the category product).').'
+2. '.$this->l('Categories Settings').'
+'.$this->l('This section allows you to define a specific FEDEX configuration for each product category (such as Packaging Type and Additional charges).').'
+3. '.$this->l('Products Settings').'
+'.$this->l('This section allows you to define a specific FEDEX configuration for each product (such as Packaging Type and Additional charges).').'
+"; + if ($info != FALSE) echo "$info:"; +} + + +function do_dump(&$var, $var_name = NULL, $indent = NULL, $reference = NULL) +{ + $do_dump_indent = "| "; + $reference = $reference.$var_name; + $keyvar = 'the_do_dump_recursion_protection_scheme'; $keyname = 'referenced_object_name'; + + if (is_array($var) && isset($var[$keyvar])) + { + $real_var = &$var[$keyvar]; + $real_name = &$var[$keyname]; + $type = ucfirst(gettype($real_var)); + echo "$indent$var_name $type = &$real_name
"; + do_dump($var, '$'.$vname); + echo "