implementation of trsutedshop ES
This commit is contained in:
parent
f367ef99a5
commit
7ef48d6256
@ -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) {
|
||||
|
@ -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'];
|
||||
}
|
||||
}
|
||||
|
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user