Merge branch 'ticket-12562-trustedShopsES' into develop

This commit is contained in:
Marion Muszynski 2017-02-17 10:23:28 +01:00
commit 9a634c0d74
4 changed files with 18 additions and 15 deletions

View File

@ -193,8 +193,13 @@ class Parcel {
if(count($address_lines) == 1) {
$this->dst_address['line2'] = str_replace(array('°', 'º', 'º', 'º', 'ª', 'ā','ª'), array(' ', '', '', '', 'a', 'a','a'), $address_lines[0]);
} elseif(count($address_lines) == 2) {
$this->dst_address['line2'] = str_replace(array('°', 'º', 'º', 'º', 'ª', 'ā','ª'), array(' ', '', '', '', 'a', 'a','a'), $address_lines[0]);
$this->dst_address['line3'] = str_replace(array('°', 'º', 'º', 'º', 'ª', 'ā','ª'), array(' ', '', '', '', 'a', 'a','a'), $address_lines[1]);
if(strtolower($so_data['cecountry']) == 'be') {
$this->dst_address['line0'] = str_replace(array('°', 'º', 'º', 'º', 'ª', 'ā','ª'), array(' ', '', '', '', 'a', 'a','a'), $address_lines[0]);
$this->dst_address['line2'] = str_replace(array('°', 'º', 'º', 'º', 'ª', 'ā','ª'), array(' ', '', '', '', 'a', 'a','a'), $address_lines[1]);
} else {
$this->dst_address['line2'] = str_replace(array('°', 'º', 'º', 'º', 'ª', 'ā','ª'), array(' ', '', '', '', 'a', 'a','a'), $address_lines[0]);
$this->dst_address['line3'] = str_replace(array('°', 'º', 'º', 'º', 'ª', 'ā','ª'), array(' ', '', '', '', 'a', 'a','a'), $address_lines[1]);
}
} elseif(count($address_lines) == 3) {
$this->dst_address['line0'] = str_replace(array('°', 'º', 'º', 'º', 'ª', 'ā','ª'), array(' ', '', '', '', 'a', 'a','a'), $address_lines[0]);
$this->dst_address['line2'] = str_replace(array('°', 'º', 'º', 'º', 'ª', 'ā','ª'), array(' ', '', '', '', 'a', 'a','a'), $address_lines[1]);

View File

@ -93,12 +93,14 @@ class ReviewCollectorReviewOrder
public function __construct(Order $order, $id_lang)
{
$days = Configuration::get('TRUSTED_SHOP_DAYS');
$order_date = new DateTime($order->date_add);
$this->orderDate = $order_date->format('Y-m-d');;
$this->orderReference = "".$order->id;
$this->currency = self::CURRENCY_NAME;
$estimated_delivery_date = new DateTime();
$estimated_delivery_date->add(new DateInterval('P8D')); //we add 8 days
$estimated_delivery_date->add(new DateInterval('P'.$days.'D')); //we add 5 days
$this->estimatedDeliveryDate = $estimated_delivery_date->format('Y-m-d');
$this->products = array();
foreach ($order->getProducts() as $row) {

View File

@ -20,11 +20,10 @@ if ($module_instance->active) {
$orders = array();
//We create 2 arrays containing the orders id related to each language
$orders["fr"] = array();
//$orders["es"] = array();
$orders["es"] = array();
foreach (TrustedShopBbbAsync::getOrderToProcess() as $orderToProcess){
/* @Todo add ES when api key for ES */
if ($orderToProcess['id_order'] != 0 && in_array($orderToProcess['iso_code'], array('fr'), TRUE)) {
if ($orderToProcess['id_order'] != 0 && in_array($orderToProcess['iso_code'], array('fr','es'), TRUE)) {
$orders[$orderToProcess['iso_code']][] = (int)$orderToProcess['id_order'];
}
}

View File

@ -85,7 +85,7 @@ class TrustedShopsBbb extends Module
$output = '<h2>Trusted Shop Configuration</h2>';
if (Tools::isSubmit('submitTrustedShop') AND ($tsfrid = Tools::getValue('trusted_shop_fr_id')) AND ($tsdays = Tools::getValue('trusted_shop_days')) AND ($tssw = Tools::getValue('status_watched_id')) AND ($tspassword = Tools::getValue('trusted_shop_password')) AND ($tsuser = Tools::getValue('trusted_shop_user'))) {
Configuration::updateValue('TRUSTED_SHOP_FR_ID', trim($tsfrid));
//Configuration::updateValue('TRUSTED_SHOP_ES_ID', trim($tsesid));
Configuration::updateValue('TRUSTED_SHOP_ES_ID', trim($tsesid));
Configuration::updateValue('TRUSTED_SHOP_STATUS_WATCHED', $tssw);
Configuration::updateValue('TRUSTED_SHOP_PASSWORD', trim($tspassword));
Configuration::updateValue('TRUSTED_SHOP_USER', trim($tsuser));
@ -109,10 +109,10 @@ class TrustedShopsBbb extends Module
<div class="margin-form">
<input type="text" name="trusted_shop_fr_id" value="' . Tools::safeOutput(Tools::getValue('trusted_shop_fr_id', Configuration::get('TRUSTED_SHOP_FR_ID'))) . '" />
</div>
<!--label>' . $this->l('Your TSID ES') . '</label>
<label>' . $this->l('Your TSID ES') . '</label>
<div class="margin-form">
<input type="text" name="trusted_shop_es_id" value="' . Tools::safeOutput(Tools::getValue('trusted_shop_es_id', Configuration::get('TRUSTED_SHOP_ES_ID'))) . '" />
</div-->
</div>
<label>' . $this->l('Your user name') . '</label>
<div class="margin-form">
<input type="text" name="trusted_shop_user" value="' . Tools::safeOutput(Tools::getValue('trusted_shop_user', Configuration::get('TRUSTED_SHOP_USER'))) . '" />
@ -146,8 +146,7 @@ class TrustedShopsBbb extends Module
&& (int)Configuration::get('TRUSTED_SHOP_STATUS_WATCHED') == (int)$params['newOrderStatus']->id
){
$order = new Order((int)$params['id_order']);
/* @Todo add ES when api key for ES */
if (in_array(strtoupper(Language::getIsoById($order->id_lang)), array("FR"), true)) {
if (in_array(strtoupper(Language::getIsoById($order->id_lang)), array("FR","ES"), true)) {
TrustedShopBbbAsync::saveOrUpdate((int)$order->id);
}
}
@ -155,8 +154,7 @@ class TrustedShopsBbb extends Module
public function hookFooter($params){
global $smarty, $cookie;
$resultArray = array();
/* @Todo add ES when api key for ES */
if (in_array(strtoupper(Language::getIsoById($cookie->id_lang)), array("FR"), true)) {
if (in_array(strtoupper(Language::getIsoById($cookie->id_lang)), array("FR","ES"), true)) {
$reviewIndicatorCollector = new ReviewIndicatorCollector((int)($cookie->id_lang));
$resultArray = $reviewIndicatorCollector->getResults();
}
@ -175,8 +173,7 @@ class TrustedShopsBbb extends Module
public function hookOrderConfirmation($params)
{
global $smarty, $cookie;
/* @Todo add ES when api key for ES */
if (false && in_array(strtoupper(Language::getIsoById($cookie->id_lang)), array("FR"), true)) {
if (false && in_array(strtoupper(Language::getIsoById($cookie->id_lang)), array("FR","ES"), true)) {
$tsId = Configuration::get('TRUSTED_SHOP_' . strtoupper(Language::getIsoById((int)$cookie->id_lang)) . '_ID');
$smarty->assign(array('tsId' => $tsId,));
return $this->display(__FILE__, 'views/trust_badge_order_confirmation.tpl');