Création du module FedEx

This commit is contained in:
2020-11-12 18:11:49 +01:00
parent 6d640923e0
commit 898aa9df75
21 changed files with 158 additions and 61 deletions

1
.gitignore vendored
View File

@@ -5,3 +5,4 @@
/web/revslider/application/config/config.php /web/revslider/application/config/config.php
/templates/email/default.zip /templates/email/default.zip
/core/vendor/wsdltophp.zip /core/vendor/wsdltophp.zip
/local/session/

View File

@@ -13,7 +13,7 @@
namespace Colissimo; namespace Colissimo;
use Colissimo\Model\Config\ColissimoConfigValue; use Colissimo\Model\Config\FedExConfigValue;
use Propel\Runtime\Connection\ConnectionInterface; use Propel\Runtime\Connection\ConnectionInterface;
use Thelia\Core\Translation\Translator; use Thelia\Core\Translation\Translator;
use Thelia\Install\Database; use Thelia\Install\Database;
@@ -35,7 +35,7 @@ class Colissimo extends AbstractDeliveryModule
public static function getPrices() public static function getPrices()
{ {
if (null === self::$prices) { if (null === self::$prices) {
self::$prices = json_decode(Colissimo::getConfigValue(ColissimoConfigValue::PRICES, null), true); self::$prices = json_decode(FedEx::getConfigValue(FedExConfigValue::PRICES, null), true);
} }
return self::$prices; return self::$prices;
@@ -43,7 +43,7 @@ class Colissimo extends AbstractDeliveryModule
public function postActivation(ConnectionInterface $con = null) public function postActivation(ConnectionInterface $con = null)
{ {
self::setConfigValue(ColissimoConfigValue::ENABLED, 1); self::setConfigValue(FedExConfigValue::ENABLED, 1);
$database = new Database($con); $database = new Database($con);
$database->insertSql(null, array(__DIR__ . '/Config/thelia.sql')); $database->insertSql(null, array(__DIR__ . '/Config/thelia.sql'));
@@ -51,7 +51,7 @@ class Colissimo extends AbstractDeliveryModule
public function isValidDelivery(Country $country) public function isValidDelivery(Country $country)
{ {
if (0 == self::getConfigValue(ColissimoConfigValue::ENABLED, 1)) { if (0 == self::getConfigValue(FedExConfigValue::ENABLED, 1)) {
return false; return false;
} }
@@ -90,7 +90,7 @@ class Colissimo extends AbstractDeliveryModule
*/ */
public static function getPostageAmount($areaId, $weight) public static function getPostageAmount($areaId, $weight)
{ {
$freeshipping = Colissimo::getConfigValue(ColissimoConfigValue::FREE_SHIPPING); $freeshipping = FedEx::getConfigValue(FedExConfigValue::FREE_SHIPPING);
$postage = 0; $postage = 0;
if (!$freeshipping) { if (!$freeshipping) {
$prices = self::getPrices(); $prices = self::getPrices();
@@ -164,14 +164,14 @@ class Colissimo extends AbstractDeliveryModule
$tableExists = $database->execute("SHOW TABLES LIKE 'colissimo_freeshipping'")->rowCount(); $tableExists = $database->execute("SHOW TABLES LIKE 'colissimo_freeshipping'")->rowCount();
if (Colissimo::getConfigValue(ColissimoConfigValue::FREE_SHIPPING, null) == null && $tableExists) { if (FedEx::getConfigValue(FedExConfigValue::FREE_SHIPPING, null) == null && $tableExists) {
$result = $database->execute('SELECT active FROM colissimo_freeshipping WHERE id=1')->fetch()["active"]; $result = $database->execute('SELECT active FROM colissimo_freeshipping WHERE id=1')->fetch()["active"];
Colissimo::setConfigValue(ColissimoConfigValue::FREE_SHIPPING, $result); FedEx::setConfigValue(FedExConfigValue::FREE_SHIPPING, $result);
$database->execute("DROP TABLE `colissimo_freeshipping`"); $database->execute("DROP TABLE `colissimo_freeshipping`");
} }
if (is_readable($uploadDir) && Colissimo::getConfigValue(ColissimoConfigValue::PRICES, null) == null) { if (is_readable($uploadDir) && FedEx::getConfigValue(FedExConfigValue::PRICES, null) == null) {
Colissimo::setConfigValue(ColissimoConfigValue::PRICES, file_get_contents($uploadDir)); FedEx::setConfigValue(FedExConfigValue::PRICES, file_get_contents($uploadDir));
} }
} }
} }

View File

@@ -12,8 +12,8 @@
namespace Colissimo\Controller; namespace Colissimo\Controller;
use Colissimo\Colissimo; use Colissimo\FedEx;
use Colissimo\Model\Config\ColissimoConfigValue; use Colissimo\Model\Config\FedExConfigValue;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Thelia\Controller\Admin\BaseAdminController; use Thelia\Controller\Admin\BaseAdminController;
use Thelia\Core\Security\AccessManager; use Thelia\Core\Security\AccessManager;
@@ -32,7 +32,7 @@ class Configuration extends BaseAdminController
{ {
if (null !== $response = $this->checkAuth( if (null !== $response = $this->checkAuth(
AdminResources::MODULE, AdminResources::MODULE,
[Colissimo::DOMAIN_NAME], [FedEx::DOMAIN_NAME],
AccessManager::UPDATE AccessManager::UPDATE
)) { )) {
return $response; return $response;
@@ -45,8 +45,8 @@ class Configuration extends BaseAdminController
$validateForm = $this->validateForm($form); $validateForm = $this->validateForm($form);
$data = $validateForm->getData(); $data = $validateForm->getData();
Colissimo::setConfigValue( FedEx::setConfigValue(
ColissimoConfigValue::ENABLED, FedExConfigValue::ENABLED,
is_bool($data["enabled"]) ? (int) ($data["enabled"]) : $data["enabled"] is_bool($data["enabled"]) ? (int) ($data["enabled"]) : $data["enabled"]
); );

View File

@@ -12,8 +12,8 @@
namespace Colissimo\Controller; namespace Colissimo\Controller;
use Colissimo\Colissimo; use Colissimo\FedEx;
use Colissimo\Model\Config\ColissimoConfigValue; use Colissimo\Model\Config\FedExConfigValue;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Thelia\Model\AreaQuery; use Thelia\Model\AreaQuery;
use Thelia\Controller\Admin\BaseAdminController; use Thelia\Controller\Admin\BaseAdminController;
@@ -44,7 +44,7 @@ class EditPrices extends BaseAdminController
->findPK($area); ->findPK($area);
if ($exists !== null) { if ($exists !== null) {
if (null !== $data = Colissimo::getConfigValue(ColissimoConfigValue::PRICES, null)) { if (null !== $data = FedEx::getConfigValue(FedExConfigValue::PRICES, null)) {
$json_data = json_decode( $json_data = json_decode(
$data, $data,
true true
@@ -62,7 +62,7 @@ class EditPrices extends BaseAdminController
} }
ksort($json_data[$area]['slices']); ksort($json_data[$area]['slices']);
Colissimo::setConfigValue(ColissimoConfigValue::PRICES, json_encode($json_data)); FedEx::setConfigValue(FedExConfigValue::PRICES, json_encode($json_data));
} else { } else {
throw new \Exception("Area not found"); throw new \Exception("Area not found");

View File

@@ -12,8 +12,8 @@
namespace Colissimo\Controller; namespace Colissimo\Controller;
use Colissimo\Colissimo; use Colissimo\FedEx;
use Colissimo\Model\ColissimoQuery; use Colissimo\Model\FedExQuery;
use Thelia\Controller\Admin\BaseAdminController; use Thelia\Controller\Admin\BaseAdminController;
use Thelia\Core\Event\Order\OrderEvent; use Thelia\Core\Event\Order\OrderEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
@@ -56,7 +56,7 @@ class Export extends BaseAdminController
->findOne(); ->findOne();
// Get Colissimo orders // Get Colissimo orders
$orders = ColissimoQuery::getOrders()->find(); $orders = FedExQuery::getOrders()->find();
$export = ""; $export = "";
$store_name = ConfigQuery::getStoreName(); $store_name = ConfigQuery::getStoreName();
@@ -149,7 +149,7 @@ class Export extends BaseAdminController
} catch (FormValidationException $e) { } catch (FormValidationException $e) {
$this->setupFormErrorContext( $this->setupFormErrorContext(
Translator::getInstance()->trans("colissimo expeditor export", [], Colissimo::DOMAIN_NAME), Translator::getInstance()->trans("colissimo expeditor export", [], FedEx::DOMAIN_NAME),
$e->getMessage(), $e->getMessage(),
$form, $form,
$e $e

View File

@@ -12,8 +12,8 @@
namespace Colissimo\Controller; namespace Colissimo\Controller;
use Colissimo\Colissimo; use Colissimo\FedEx;
use Colissimo\Model\Config\ColissimoConfigValue; use Colissimo\Model\Config\FedExConfigValue;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Thelia\Controller\Admin\BaseAdminController; use Thelia\Controller\Admin\BaseAdminController;
@@ -30,7 +30,7 @@ class FreeShipping extends BaseAdminController
{ {
public function set() public function set()
{ {
$response = $this->checkAuth(AdminResources::MODULE, [Colissimo::DOMAIN_NAME], AccessManager::UPDATE); $response = $this->checkAuth(AdminResources::MODULE, [FedEx::DOMAIN_NAME], AccessManager::UPDATE);
if (null !== $response) { if (null !== $response) {
return $response; return $response;
} }
@@ -42,7 +42,7 @@ class FreeShipping extends BaseAdminController
$validateForm = $this->validateForm($form); $validateForm = $this->validateForm($form);
$data = $validateForm->getData(); $data = $validateForm->getData();
Colissimo::setConfigValue(ColissimoConfigValue::FREE_SHIPPING, (int) ($data["freeshipping"])); FedEx::setConfigValue(FedExConfigValue::FREE_SHIPPING, (int) ($data["freeshipping"]));
return $this->redirectToConfigurationPage(); return $this->redirectToConfigurationPage();
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@@ -12,8 +12,8 @@
namespace Colissimo\EventListener; namespace Colissimo\EventListener;
use Colissimo\Colissimo; use Colissimo\FedEx;
use Colissimo\Model\Config\ColissimoConfigValue; use Colissimo\Model\Config\FedExConfigValue;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Area\AreaDeleteEvent; use Thelia\Core\Event\Area\AreaDeleteEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
@@ -30,12 +30,12 @@ class AreaDeletedListener implements EventSubscriberInterface
*/ */
public function updateConfig(AreaDeleteEvent $event) public function updateConfig(AreaDeleteEvent $event)
{ {
if (null !== $data = Colissimo::getConfigValue(ColissimoConfigValue::PRICES, null)) { if (null !== $data = FedEx::getConfigValue(FedExConfigValue::PRICES, null)) {
$areaId = $event->getAreaId(); $areaId = $event->getAreaId();
$json_data = json_decode($data, true); $json_data = json_decode($data, true);
unset($json_data[$areaId]); unset($json_data[$areaId]);
Colissimo::setConfigValue(ColissimoConfigValue::PRICES, json_encode($json_data, true)); FedEx::setConfigValue(FedExConfigValue::PRICES, json_encode($json_data, true));
} }
} }

View File

@@ -12,8 +12,8 @@
namespace Colissimo\Form; namespace Colissimo\Form;
use Colissimo\Colissimo; use Colissimo\FedEx;
use Colissimo\Model\Config\Base\ColissimoConfigValue; use Colissimo\Model\Config\Base\FedExConfigValue;
use Thelia\Core\Translation\Translator; use Thelia\Core\Translation\Translator;
use Thelia\Form\BaseForm; use Thelia\Form\BaseForm;
@@ -38,13 +38,13 @@ class Configuration extends BaseForm
"help" => Translator::getInstance()->trans( "help" => Translator::getInstance()->trans(
'Check if you want to activate Colissimo', 'Check if you want to activate Colissimo',
[], [],
Colissimo::DOMAIN_NAME FedEx::DOMAIN_NAME
) )
], ],
"required" => false, "required" => false,
"constraints" => array( "constraints" => array(
), ),
"value" => Colissimo::getConfigValue(ColissimoConfigValue::ENABLED, 1), "value" => FedEx::getConfigValue(FedExConfigValue::ENABLED, 1),
) )
); );
} }

View File

@@ -12,8 +12,8 @@
namespace Colissimo\Form; namespace Colissimo\Form;
use Colissimo\Colissimo; use Colissimo\FedEx;
use Colissimo\Model\ColissimoQuery; use Colissimo\Model\FedExQuery;
use Symfony\Component\Validator\Constraints\Callback; use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Context\ExecutionContextInterface;
@@ -50,7 +50,7 @@ class Export extends BaseForm
*/ */
protected function buildForm() protected function buildForm()
{ {
$orders = ColissimoQuery::getOrders() $orders = FedExQuery::getOrders()
->find(); ->find();
$this->formBuilder $this->formBuilder
@@ -67,7 +67,7 @@ class Export extends BaseForm
'label' => Translator::getInstance()->trans( 'label' => Translator::getInstance()->trans(
'Modify status export after export', 'Modify status export after export',
[], [],
Colissimo::DOMAIN_NAME FedEx::DOMAIN_NAME
), ),
'label_attr' => [ 'label_attr' => [
'for' => 'status_id' 'for' => 'status_id'
@@ -106,7 +106,7 @@ class Export extends BaseForm
Translator::getInstance()->trans( Translator::getInstance()->trans(
'select a valid status', 'select a valid status',
[], [],
Colissimo::DOMAIN_NAME FedEx::DOMAIN_NAME
) )
); );
} }

View File

@@ -12,8 +12,8 @@
namespace Colissimo\Form; namespace Colissimo\Form;
use Colissimo\Colissimo; use Colissimo\FedEx;
use Colissimo\Model\Config\Base\ColissimoConfigValue; use Colissimo\Model\Config\Base\FedExConfigValue;
use Thelia\Core\Translation\Translator; use Thelia\Core\Translation\Translator;
use Thelia\Form\BaseForm; use Thelia\Form\BaseForm;
@@ -46,8 +46,8 @@ class FreeShipping extends BaseForm
"freeshipping", "freeshipping",
"checkbox", "checkbox",
array( array(
"label" => Translator::getInstance()->trans("Activate free shipping: ", [], Colissimo::DOMAIN_NAME), "label" => Translator::getInstance()->trans("Activate free shipping: ", [], FedEx::DOMAIN_NAME),
"value" => Colissimo::getConfigValue(ColissimoConfigValue::FREE_SHIPPING, false), "value" => FedEx::getConfigValue(FedExConfigValue::FREE_SHIPPING, false),
) )
); );
} }

View File

@@ -12,7 +12,7 @@
namespace Colissimo\Listener; namespace Colissimo\Listener;
use Colissimo\Colissimo; use Colissimo\FedEx;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Order\OrderEvent; use Thelia\Core\Event\Order\OrderEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
@@ -46,7 +46,7 @@ class SendMail implements EventSubscriberInterface
public function updateStatus(OrderEvent $event) public function updateStatus(OrderEvent $event)
{ {
$order = $event->getOrder(); $order = $event->getOrder();
$colissimo = new Colissimo(); $colissimo = new FedEx();
if ($order->isSent() && $order->getDeliveryModuleId() == $colissimo->getModuleModel()->getId()) { if ($order->isSent() && $order->getDeliveryModuleId() == $colissimo->getModuleModel()->getId()) {
$contact_email = ConfigQuery::getStoreEmail(); $contact_email = ConfigQuery::getStoreEmail();

View File

@@ -11,7 +11,7 @@
/*************************************************************************************/ /*************************************************************************************/
namespace Colissimo\Loop; namespace Colissimo\Loop;
use Colissimo\Colissimo; use Colissimo\FedEx;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\BaseLoop;
use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Element\LoopResultRow;
@@ -41,7 +41,7 @@ class CheckRightsLoop extends BaseLoop implements ArraySearchLoopInterface
"ERRMES"=>Translator::getInstance()->trans( "ERRMES"=>Translator::getInstance()->trans(
"Can't read Config directory", "Can't read Config directory",
[], [],
Colissimo::DOMAIN_NAME FedEx::DOMAIN_NAME
), ),
"ERRFILE"=>"" "ERRFILE"=>""
); );
@@ -51,7 +51,7 @@ class CheckRightsLoop extends BaseLoop implements ArraySearchLoopInterface
"ERRMES"=>Translator::getInstance()->trans( "ERRMES"=>Translator::getInstance()->trans(
"Can't write Config directory", "Can't write Config directory",
[], [],
Colissimo::DOMAIN_NAME FedEx::DOMAIN_NAME
), ),
"ERRFILE"=>"" "ERRFILE"=>""
); );
@@ -66,7 +66,7 @@ class CheckRightsLoop extends BaseLoop implements ArraySearchLoopInterface
"ERRMES"=>Translator::getInstance()->trans( "ERRMES"=>Translator::getInstance()->trans(
"Can't read file", "Can't read file",
[], [],
Colissimo::DOMAIN_NAME FedEx::DOMAIN_NAME
), ),
"ERRFILE"=>"Colissimo/Config/".$file "ERRFILE"=>"Colissimo/Config/".$file
); );
@@ -76,7 +76,7 @@ class CheckRightsLoop extends BaseLoop implements ArraySearchLoopInterface
"ERRMES"=>Translator::getInstance()->trans( "ERRMES"=>Translator::getInstance()->trans(
"Can't write file", "Can't write file",
[], [],
Colissimo::DOMAIN_NAME FedEx::DOMAIN_NAME
), ),
"ERRFILE"=>"Colissimo/Config/".$file "ERRFILE"=>"Colissimo/Config/".$file
); );

View File

@@ -12,7 +12,7 @@
namespace Colissimo\Loop; namespace Colissimo\Loop;
use Colissimo\Model\ColissimoQuery; use Colissimo\Model\FedExQuery;
use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
@@ -69,6 +69,6 @@ class NotSendLoop extends Order
*/ */
public function buildModelCriteria() public function buildModelCriteria()
{ {
return ColissimoQuery::getOrders(); return FedExQuery::getOrders();
} }
} }

View File

@@ -12,7 +12,7 @@
namespace Colissimo\Loop; namespace Colissimo\Loop;
use Colissimo\Colissimo; use Colissimo\FedEx;
use Thelia\Core\Template\Element\ArraySearchLoopInterface; use Thelia\Core\Template\Element\ArraySearchLoopInterface;
use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\BaseLoop;
use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResult;
@@ -47,7 +47,7 @@ class Price extends BaseLoop implements ArraySearchLoopInterface
public function buildArray() public function buildArray()
{ {
$area = $this->getArea(); $area = $this->getArea();
$prices = Colissimo::getPrices(); $prices = FedEx::getPrices();
if (!isset($prices[$area]) || !isset($prices[$area]["slices"])) { if (!isset($prices[$area]) || !isset($prices[$area]["slices"])) {
return array(); return array();

View File

@@ -23,7 +23,7 @@
namespace Colissimo\Model; namespace Colissimo\Model;
use Colissimo\Colissimo; use Colissimo\FedEx;
use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Model\OrderQuery; use Thelia\Model\OrderQuery;
use Thelia\Model\OrderStatus; use Thelia\Model\OrderStatus;
@@ -53,7 +53,7 @@ class ColissimoQuery
->toArray("code"); ->toArray("code");
$query = OrderQuery::create() $query = OrderQuery::create()
->filterByDeliveryModuleId((new Colissimo())->getModuleModel()->getId()) ->filterByDeliveryModuleId((new FedEx())->getModuleModel()->getId())
->filterByStatusId( ->filterByStatusId(
array( array(
$status[OrderStatus::CODE_PAID]['Id'], $status[OrderStatus::CODE_PAID]['Id'],

View File

@@ -12,13 +12,13 @@
namespace Colissimo\Model\Config; namespace Colissimo\Model\Config;
use Colissimo\Model\Config\Base\ColissimoConfigValue as BaseColissimoConfigValue; use Colissimo\Model\Config\Base\FedExConfigValue as BaseColissimoConfigValue;
/** /**
* Class Colissimo * Class Colissimo
* @package Colissimo\Model\Config * @package Colissimo\Model\Config
* @author Thomas Arnaud <tarnaud@openstudio.fr> * @author Thomas Arnaud <tarnaud@openstudio.fr>
*/ */
class ColissimoConfigValue extends BaseColissimoConfigValue class FedExConfigValue extends BaseColissimoConfigValue
{ {
} }

View File

@@ -0,0 +1,64 @@
{"1": {
"_info": "area 1 : France",
"slices": {
"0.25": 5.23,
"0.5": 6.13,
"0.75": 6.89,
"1": 7.51,
"2": 8.50,
"5": 10.93,
"10": 15.68,
"30": 23.28
}
}, "2": {
"_info": "area 2 : A Zone - Union Europ\u00e9enne et Suisse",
"slices": {
"0.5": 11.54,
"1": 14.11,
"2": 15.68,
"5": 20.14,
"10": 33.25,
"20": 55.10,
"30": 55.10
}
}, "3": {
"_info": "area 3 : B Zone - Pays de l\u2019Europe de l\u2019Est (hors Union Europ\u00e9enne et Russie), Norv\u00e8ge, Maghreb",
"slices": {
"0.5": 15.39,
"1": 18.38,
"2": 20.00,
"5": 25.65,
"10": 42.75,
"20": 66.50
}
}, "4": {
"_info": "area 4 : C Zone - Autres destinations",
"slices": {
"0.5": 22.52,
"1": 24.99,
"2": 34.30,
"5": 50.35,
"10": 95.00,
"20": 152.00
}
}, "5": {
"_info": "area 5 : France OM1",
"slices": {
"0.5": 8.69,
"1": 13.16,
"2": 17.96,
"5": 26.60,
"10": 42.75,
"30": 95.95
}
}, "6": {
"_info": "area 6 : France OM2",
"slices": {
"0.5": 10.40,
"1": 15.72,
"2": 27.74,
"5": 46.08,
"10": 90.25,
"30": 237.50
}
}}

View File

@@ -0,0 +1,32 @@
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;
-- ---------------------------------------------------------------------
-- Mail templates for FedEx
-- ---------------------------------------------------------------------
-- First, delete existing entries
SET @var := 0;
SELECT @var := `id` FROM `message` WHERE name="mail_fedex";
DELETE FROM `message` WHERE `id`=@var;
-- Try if ON DELETE constraint isn't set
DELETE FROM `message_i18n` WHERE `id`=@var;
-- Then add new entries
SELECT @max := MAX(`id`) FROM `message`;
SET @max := @max+1;
-- insert message
INSERT INTO `message` (`id`, `name`, `secured`) VALUES
(@max,
'mail_fedex',
'0'
);
-- and template fr_FR
INSERT INTO `message_i18n` (`id`, `locale`, `title`, `subject`, `text_message`, `html_message`) VALUES
(@max, 'en_US', 'FedEx shipping message', 'Your order {$order_ref} has been shipped', '{loop type="customer" name="customer.order" current="false" id="$customer_id" backend_context="1"}\r\nDear {$FIRSTNAME} {$LASTNAME},\r\n{/loop}\r\nThank you for your order on our online store {config key="store_name"}.\r\nYour order {$order_ref} dated {format_date date=$order_date} has been shipped on {format_date date=$update_date}.\r\nThe tracking number for this delivery is {$package}. Please check the FedEx website for tracking your parcel: www.fedex.com.\r\nFeel free to contact us for any forther information\r\nBest Regards.', '{loop type="customer" name="customer.order" current="false" id="$customer_id" backend_context="1"}\r\n<p>Dear {$FIRSTNAME} {$LASTNAME},</p>\r\n{/loop}\r\n<p>Thank you for your order on our online store {config key="store_name"}.</p>\r\n<p>Your order {$order_ref} dated {format_date date=$order_date} has been shipped on {format_date date=$update_date}.\r\nThe tracking number for this delivery is {$package}. Please check the FedEx website for tracking your parcel: <a href="www.fedex.com">www.coliposte.net</a>.</p>\r\n<p>Feel free to contact us for any further information</p>\r\n<p>Best Regards.</p>'),
(@max, 'fr_FR', 'Message d''expédition de FedEx', 'Suivi FedEx commande : {$order_ref}', '{loop type="customer" name="customer.order" current="false" id="$customer_id" backend_context="1"}\r\n{$LASTNAME} {$FIRSTNAME},\r\n{/loop}\r\nNous vous remercions de votre commande sur notre site {config key="store_name"}\r\nUn colis concernant votre commande {$order_ref} du {format_date date=$order_date} a quitté nos entrepôts pour être pris en charge par FedEx le {format_date date=$update_date}.\r\nSon numéro de suivi est le suivant : {$package}\r\nIl vous permet de suivre votre colis en ligne sur le site de FedEx : www.fedex.com\r\nNous restons à votre disposition pour toute information complémentaire.\r\nCordialement', '{loop type="customer" name="customer.order" current="false" id="$customer_id" backend_context="1"}\r\n{$LASTNAME} {$FIRSTNAME},\r\n{/loop}\r\nNous vous remercions de votre commande sur notre site {config key="store_name"}\r\nUn colis concernant votre commande {$order_ref} du {format_date date=$order_date} a quitté nos entrepôts pour être pris en charge par FedEx le {format_date date=$update_date}.\r\nSon numéro de suivi est le suivant : {$package}\r\nIl vous permet de suivre votre colis en ligne sur le site de FedEx : www.fedex.com\r\nNous restons à votre disposition pour toute information complémentaire.\r\nCordialement');
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -1 +1 @@
ca65be21995543266b3fae7d9804be17 d0d07290fd8c02f32351455b572ca9dc

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long