LivraisonParSecteurs : modif du stockage en session des données nécessaires
This commit is contained in:
@@ -536,4 +536,5 @@ class Order extends BaseOrder
|
||||
? $event->getManageStock()
|
||||
: $paymentModule->manageStockOnCreation();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace LivraisonParSecteurs\Hook;
|
||||
use LivraisonParSecteurs\LivraisonParSecteurs;
|
||||
use Thelia\Core\Event\Hook\HookRenderEvent;
|
||||
use Thelia\Core\Hook\BaseHook;
|
||||
use Thelia\Exception\TheliaProcessException;
|
||||
|
||||
class EmailHook extends BaseHook
|
||||
{
|
||||
@@ -16,9 +17,10 @@ class EmailHook extends BaseHook
|
||||
|
||||
if ((null !== $orderId) && ($moduleId == LivraisonParSecteurs::getModuleId()))
|
||||
{
|
||||
$selectedDay = $this->getSession()->get(LivraisonParSecteurs::LPS_DELIVERY_DATE);
|
||||
$beginTime = $this->getSession()->get(LivraisonParSecteurs::LPS_DELIVERY_BEGIN_TIME);
|
||||
$endTime = $this->getSession()->get(LivraisonParSecteurs::LPS_DELIVERY_END_TIME);
|
||||
$lpsData = $this->getSession()->get('lpsData');
|
||||
$selectedDay = $lpsData->getDeliveryDate();
|
||||
$beginTime = $lpsData->getDeliveryStartTime();
|
||||
$endTime = $lpsData->getDeliveryEndTime();
|
||||
|
||||
if ( (null !== $selectedDay) && (null !== $beginTime) && (null !== $endTime) )
|
||||
{
|
||||
@@ -31,6 +33,8 @@ class EmailHook extends BaseHook
|
||||
])
|
||||
);
|
||||
}
|
||||
else
|
||||
throw new TheliaProcessException("LivraisonParSecteurs : Impossible de récupérer les données de session LpsData : ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,13 @@
|
||||
namespace LivraisonParSecteurs\Hook;
|
||||
|
||||
use LivraisonParSecteurs\LivraisonParSecteurs;
|
||||
use LivraisonParSecteurs\Model\Base\LpsAreaCityQuery;
|
||||
use LivraisonParSecteurs\Model\LpsAreaCityQuery;
|
||||
use Propel\Runtime\Exception\PropelException as PropelException;
|
||||
use Propel\Runtime\Propel;
|
||||
use Thelia\Core\Event\Hook\HookRenderEvent;
|
||||
use Thelia\Core\Hook\BaseHook;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Exception\TheliaProcessException;
|
||||
use Thelia\Model\AddressQuery;
|
||||
use Thelia\Module\Exception\DeliveryException;
|
||||
|
||||
@@ -44,11 +45,13 @@ class FrontHook extends BaseHook
|
||||
|
||||
public function displayDeliveryDate(HookRenderEvent $event)
|
||||
{
|
||||
if ((null !== $order = $this->getSession()->getOrder()) && $order->getDeliveryModuleId() == LivraisonParSecteurs::getModuleId())
|
||||
$order = $this->getSession()->getOrder();
|
||||
if ((null !== $order) && $order->getDeliveryModuleId() == LivraisonParSecteurs::getModuleId())
|
||||
{
|
||||
$selectedDay = $this->getSession()->get(LivraisonParSecteurs::LPS_DELIVERY_DATE);
|
||||
$beginTime = $this->getSession()->get(LivraisonParSecteurs::LPS_DELIVERY_BEGIN_TIME);
|
||||
$endTime = $this->getSession()->get(LivraisonParSecteurs::LPS_DELIVERY_END_TIME);
|
||||
$lpsData = $this->getSession()->get('lpsData');
|
||||
$selectedDay = $lpsData->getDeliveryDate();
|
||||
$beginTime = $lpsData->getDeliveryStartTime();
|
||||
$endTime = $lpsData->getDeliveryEndTime();
|
||||
|
||||
if ( (null !== $selectedDay) && (null !== $beginTime) && (null !== $endTime) )
|
||||
{
|
||||
@@ -61,6 +64,8 @@ class FrontHook extends BaseHook
|
||||
])
|
||||
);
|
||||
}
|
||||
else
|
||||
throw new TheliaProcessException("LivraisonParSecteurs : Impossible de récupérer les données de session LpsData : " . $event->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,10 +11,7 @@ use Propel\Runtime\Propel;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Install\Database;
|
||||
use Thelia\Model\AddressQuery;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
use Thelia\Model\Country;
|
||||
use Thelia\Model\ModuleConfigI18nQuery;
|
||||
use Thelia\Model\ModuleConfigQuery;
|
||||
use Thelia\Model\OrderPostage;
|
||||
use Thelia\Module\AbstractDeliveryModule;
|
||||
use Thelia\Module\Exception\DeliveryException;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<tr><td> </td></tr>
|
||||
|
||||
<tr style="background-color:#1A712C; color:white">
|
||||
<th>{intl l="Scheduled date" d="livraisonparsecteurs"}</th>
|
||||
<td>{$day} entre {format_date date=$begin_time format="H\hi"} et {format_date date=$end_time format="H\hi"}</td>
|
||||
<th>{intl l="Scheduled date" d="livraisonparsecteurs"}</th>-->
|
||||
<td>{$day} entre {format_date date=$begin_time format="H\hi"} et {format_date date=$end_time format="H\hi"}</td>-->
|
||||
</tr>
|
||||
|
||||
<tr><td> </td></tr>
|
||||
|
||||
@@ -36,5 +36,6 @@
|
||||
format: 'YYYY-MM-DD'
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -85,9 +85,17 @@
|
||||
if ($('[delivery-mode=lps]').is(':checked')
|
||||
&&
|
||||
$('input[name=lps-choosen-day]:checked').length === 0) {
|
||||
alert("{intl l='Please select a delivery day' d='livraisonparsecteurs' js=1}");
|
||||
alert("Veuillez choisir un jour de livraison.");
|
||||
ev.preventDefault();
|
||||
}
|
||||
|
||||
if ($('[delivery-mode=pdr]').is(':checked')
|
||||
&&
|
||||
$('input[name=pdr-choosen-day]:checked').length === 0) {
|
||||
alert("Veuillez choisir un point de retrait.");
|
||||
ev.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</loops>
|
||||
|
||||
<hooks>
|
||||
<hook id="planiflivraison.hook" class="PlanificationLivraison\Hook\HookManager">
|
||||
<hook id="planiflivraison.back.hook" class="PlanificationLivraison\Hook\BackHook">
|
||||
<tag name="hook.event_listener" event="module.configuration" type="back" method="onModuleConfiguration" />
|
||||
</hook>
|
||||
</hooks>
|
||||
|
||||
@@ -6,7 +6,8 @@ use DateTime;
|
||||
use LivraisonParSecteurs\LivraisonParSecteurs;
|
||||
use LivraisonParSecteurs\Model\LpsAreaScheduleQuery;
|
||||
use PlanificationLivraison\Model\OrderDeliverySchedule;
|
||||
use PlanificationLivraison\PlanificationLivraison;
|
||||
use PointRetrait\Model\PdrScheduleQuery;
|
||||
use PointRetrait\PointRetrait;
|
||||
use Propel\Runtime\Propel;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
@@ -17,7 +18,8 @@ use Thelia\Core\Event\TheliaEvents;
|
||||
use Thelia\Core\HttpFoundation\Request;
|
||||
use Thelia\Core\HttpFoundation\Session\Session;
|
||||
use Thelia\Exception\TheliaProcessException;
|
||||
use Thelia\Files\Exception\ProcessFileException;
|
||||
use Thelia\Model\ModuleQuery;
|
||||
use PlanificationLivraison\Model\SessionData;
|
||||
|
||||
|
||||
class DeliveryListener extends BaseAction implements EventSubscriberInterface
|
||||
@@ -47,22 +49,48 @@ class DeliveryListener extends BaseAction implements EventSubscriberInterface
|
||||
/** @var Session $session */
|
||||
$session = $request->getSession();
|
||||
|
||||
if ($event->getDeliveryModule() == LivraisonParSecteurs::getModuleId()) {
|
||||
$module = $event->getDeliveryModule();
|
||||
$moduleActif = ModuleQuery::create()->findOneById($module)->getActivate();
|
||||
if ($moduleActif) {
|
||||
|
||||
if ($module == LivraisonParSecteurs::getModuleId()) {
|
||||
if (null !== $scheduleId = $request->get('lps-choosen-day', null)) {
|
||||
$session->set(LivraisonParSecteurs::LPS_AREA_SCHEDULE_ID, $scheduleId);
|
||||
$session->set(LivraisonParSecteurs::LPS_CHOSEN_ADDRESS, $session->getOrder()->getChoosenDeliveryAddress());
|
||||
|
||||
$scheduleId = $session->get(LivraisonParSecteurs::LPS_AREA_SCHEDULE_ID);
|
||||
$schedule = LpsAreaScheduleQuery::create()->findOneById($scheduleId);
|
||||
|
||||
$chosenDate = LivraisonParSecteurs::calculateRelativeDate($schedule->getDay());
|
||||
$lpsData = new SessionData();
|
||||
$lpsData->setDeliveryAddressId($session->getOrder()->getChoosenDeliveryAddress());
|
||||
$lpsData->setAreaScheduleId($scheduleId);
|
||||
|
||||
// On sauvegarde la date de livraison choisie avec les heures, pour affichage ultérieur.
|
||||
$schedule = LpsAreaScheduleQuery::create()->findOneById($scheduleId);
|
||||
$chosenDate = LivraisonParSecteurs::calculateRelativeDate($schedule->getDay());
|
||||
$completeDay = LivraisonParSecteurs::getDayLabel($schedule->getDay());
|
||||
$completeDay .= " " . $chosenDate->format(LivraisonParSecteurs::FORMAT_DATES);
|
||||
$session->set(LivraisonParSecteurs::LPS_DELIVERY_DATE, $completeDay);
|
||||
$session->set(LivraisonParSecteurs::LPS_DELIVERY_BEGIN_TIME, $schedule->getBeginTime());
|
||||
$session->set(LivraisonParSecteurs::LPS_DELIVERY_END_TIME, $schedule->getEndTime());
|
||||
|
||||
$lpsData->setDeliveryDate($completeDay);
|
||||
$lpsData->setDeliveryStartTime($schedule->getBeginTime());
|
||||
$lpsData->setDeliveryEndTime($schedule->getEndTime());
|
||||
|
||||
$session->set('lpsData', $lpsData);
|
||||
}
|
||||
}
|
||||
|
||||
if ($module == PointRetrait::getModuleId()) {
|
||||
if (null !== $scheduleId = $request->get('pdr-choosen-day', null)) {
|
||||
$schedule =PdrScheduleQuery::create()->findOneById($scheduleId);
|
||||
$placeId = $schedule->getIdPlace();
|
||||
|
||||
$session->set(PointRetrait::PDR_PLACE_SCHEDULE_ID, $scheduleId);
|
||||
$session->set(PointRetrait::PDR_CHOSEN_PLACE, $placeId);
|
||||
|
||||
$chosenDate = PointRetrait::calculateRelativeDate($schedule->getDay());
|
||||
|
||||
// On sauvegarde la date de livraison choisie avec les heures, pour affichage ultérieur.
|
||||
$completeDay = PointRetrait::getDayLabel($schedule->getDay());
|
||||
$completeDay .= " " . $chosenDate->format(PointRetrait::FORMAT_DATES);
|
||||
$session->set(PointRetrait::PDR_DELIVERY_DATE, $completeDay);
|
||||
$session->set(PointRetrait::PDR_DELIVERY_BEGIN_TIME, $schedule->getBeginTime());
|
||||
$session->set(PointRetrait::PDR_DELIVERY_END_TIME, $schedule->getEndTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,10 +105,16 @@ class DeliveryListener extends BaseAction implements EventSubscriberInterface
|
||||
$session = $this->requestStack->getCurrentRequest()->getSession();
|
||||
|
||||
$order = $event->getOrder();
|
||||
|
||||
$deliveryModuleId = $order->getDeliveryModuleId();
|
||||
|
||||
if ($deliveryModuleId == LivraisonParSecteurs::getModuleId()) {
|
||||
$scheduleId = $session->get(LivraisonParSecteurs::LPS_AREA_SCHEDULE_ID);
|
||||
|
||||
$lpsData = new SessionData();
|
||||
$lpsData = $session->get('lpsData');
|
||||
if ($lpsData === null)
|
||||
throw new TheliaProcessException("PlanificationLivraison : Données de session LpsData vides : " . $event->getMessage());
|
||||
|
||||
$scheduleId = $lpsData->getAreaScheduleId();
|
||||
$orderId = $order->getId();
|
||||
|
||||
$con = Propel::getConnection();
|
||||
@@ -89,7 +123,7 @@ class DeliveryListener extends BaseAction implements EventSubscriberInterface
|
||||
try {
|
||||
$query->setOrderId($orderId);
|
||||
$query->setScheduleId($scheduleId);
|
||||
$query->setDeliveryAddressId($session->get(LivraisonParSecteurs::LPS_CHOSEN_ADDRESS));
|
||||
$query->setDeliveryAddressId($lpsData->getDeliveryAddressId());
|
||||
|
||||
$schedule = LpsAreaScheduleQuery::create()->findOneById($scheduleId);
|
||||
$chosenDate = LivraisonParSecteurs::calculateRelativeDate($schedule->getDay());
|
||||
|
||||
@@ -6,10 +6,10 @@ use Thelia\Core\Event\Hook\HookRenderEvent;
|
||||
use Thelia\Core\Hook\BaseHook;
|
||||
|
||||
/**
|
||||
* Class HookManager
|
||||
* Class BackHook
|
||||
* @package PlanificationLivraison\Hook
|
||||
*/
|
||||
class HookManager extends BaseHook
|
||||
class BackHook extends BaseHook
|
||||
{
|
||||
public function onModuleConfiguration(HookRenderEvent $event)
|
||||
{
|
||||
96
local/modules/PlanificationLivraison/Model/SessionData.php
Normal file
96
local/modules/PlanificationLivraison/Model/SessionData.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace PlanificationLivraison\Model;
|
||||
|
||||
|
||||
class SessionData
|
||||
{
|
||||
protected $deliveryAddressId = null;
|
||||
protected $areaScheduleId = null;
|
||||
protected $deliveryDate = null;
|
||||
protected $deliveryStartTime = null;
|
||||
protected $deliveryEndTime = null;
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*/
|
||||
public function getDeliveryAddressId()
|
||||
{
|
||||
return $this->deliveryAddressId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $deliveryAddressId
|
||||
*/
|
||||
public function setDeliveryAddressId($deliveryAddressId)
|
||||
{
|
||||
$this->deliveryAddressId = $deliveryAddressId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*/
|
||||
public function getAreaScheduleId()
|
||||
{
|
||||
return $this->areaScheduleId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $areaScheduleId
|
||||
*/
|
||||
public function setAreaScheduleId($areaScheduleId)
|
||||
{
|
||||
$this->areaScheduleId = $areaScheduleId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*/
|
||||
public function getDeliveryDate()
|
||||
{
|
||||
return $this->deliveryDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $deliveryDate
|
||||
*/
|
||||
public function setDeliveryDate($deliveryDate)
|
||||
{
|
||||
$this->deliveryDate = $deliveryDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*/
|
||||
public function getDeliveryStartTime()
|
||||
{
|
||||
return $this->deliveryStartTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $deliveryStartTime
|
||||
*/
|
||||
public function setDeliveryStartTime($deliveryStartTime)
|
||||
{
|
||||
$this->deliveryStartTime = $deliveryStartTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*/
|
||||
public function getDeliveryEndTime()
|
||||
{
|
||||
return $this->deliveryEndTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $deliveryEndTime
|
||||
*/
|
||||
public function setDeliveryEndTime($deliveryEndTime)
|
||||
{
|
||||
$this->deliveryEndTime = $deliveryEndTime;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -21,12 +21,14 @@ return array(
|
||||
'Location set' => 'Coordonnées GPS présentes ?',
|
||||
'Main' => 'Généralités',
|
||||
'Message no location' => 'Ce point de retrait ne possède pas de coordonnées GPS : pour vos clients, il est conseillé de géolocaliser l\'adresse.',
|
||||
'Message info minimum de commande' => 'Vous n\'avez pas atteint le minimum de commande de %minimum € sur ce point de retrait.',
|
||||
'Minimum amount' => 'Minimum de commande',
|
||||
'Module name' => 'Point de Retrait AuxBieauxLegumes',
|
||||
'My places' => 'Point de retrait AuxBieauxLegumes',
|
||||
'My withdrawal places' => 'Mes points de retrait AuxBieauxLegumes',
|
||||
'Order number' => 'N° de commande',
|
||||
'Place name' => 'Nom du point de retrait',
|
||||
'Please select a delivery place' => 'Veuillez sélectionner un point de retrait',
|
||||
'Recenter map' => 'Géolocaliser l\'adresse',
|
||||
'Revert origin position' => 'Revenir à la position d\'origine',
|
||||
'Schedule' => 'Horaires de retrait',
|
||||
|
||||
@@ -40,6 +40,7 @@ class ScheduleLoop extends BaseLoop implements PropelSearchLoopInterface
|
||||
->set("DAY_LABEL", PointRetrait::getDayLabel($pdr_schedule->getDay()))
|
||||
->set("BEGIN", $pdr_schedule->getBeginTime())
|
||||
->set("END", $pdr_schedule->getEndTime())
|
||||
->set("CALCULATED_DAY", PointRetrait::calculateRelativeDate($pdr_schedule->getDay())->format(PointRetrait::FORMAT_DATES))
|
||||
;
|
||||
$loopResult->addRow($loopResultRow);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace PointRetrait;
|
||||
|
||||
use PlanificationLivraison\PlanificationLivraison;
|
||||
use PointRetrait\Model\PdrPlacesQuery;
|
||||
use PointRetrait\Model\PdrScheduleQuery;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Propel;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
@@ -11,6 +14,8 @@ use Thelia\Model\Country;
|
||||
use Thelia\Model\OrderPostage;
|
||||
use Thelia\Module\AbstractDeliveryModule;
|
||||
use Thelia\Module\Exception\DeliveryException;
|
||||
use DateInterval;
|
||||
|
||||
|
||||
|
||||
class PointRetrait extends AbstractDeliveryModule
|
||||
@@ -19,6 +24,13 @@ class PointRetrait extends AbstractDeliveryModule
|
||||
const DOMAIN_NAME = 'pointretrait';
|
||||
const MESSAGE_DOMAIN = 'pointretrait';
|
||||
const MODULE_URL = '/admin/module/PointRetrait';
|
||||
const FORMAT_DATES = 'd/m/Y';
|
||||
const PDR_PLACE_SCHEDULE_ID = 'pdr_place_schedule_id';
|
||||
const PDR_CHOSEN_PLACE = 'pdr_chosen_place';
|
||||
const PDR_DELIVERY_DATE = 'pdr_delivery_date';
|
||||
const PDR_DELIVERY_BEGIN_TIME = 'pdr_begin_time';
|
||||
const PDR_DELIVERY_END_TIME = 'pdr_end_time';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -65,12 +77,9 @@ class PointRetrait extends AbstractDeliveryModule
|
||||
}
|
||||
|
||||
$price = 0;
|
||||
$con = Propel::getConnection();
|
||||
$currentAddressId = $this->getRequest()->getSession()->getOrder()->getChoosenDeliveryAddress();
|
||||
if (!empty($currentAddressId)) {
|
||||
$zipcode = AddressQuery::create()->filterById($currentAddressId)->findOne($con)->getZipcode();
|
||||
// $areaId = LpsAreaCityQuery::create()->findOneByZipcode($zipcode)->getIdArea();
|
||||
// $price = LpsAreaQuery::create()->findOneById($areaId)->getPrice();
|
||||
if (null !== $chosenPlace = $this->getRequest()->get(('pdr-choosen-day'))) {
|
||||
$placeId = PdrScheduleQuery::create()->findOneById($chosenPlace)->getIdPlace();
|
||||
$price = PdrPlacesQuery::create()->findOneById($placeId)->getPrice();
|
||||
}
|
||||
|
||||
return $price;
|
||||
@@ -97,4 +106,39 @@ class PointRetrait extends AbstractDeliveryModule
|
||||
return $days[$int];
|
||||
}
|
||||
|
||||
static public function calculateRelativeDate($baseDay)
|
||||
{
|
||||
$minimumDelayBeforeOrder = PlanificationLivraison::getConfigValue(PlanificationLivraison::CONFIG_PREPARATION_DELAY, 0, "en_US");
|
||||
|
||||
$date = new \DateTime();
|
||||
$date->add(new DateInterval('P'. $minimumDelayBeforeOrder . 'D'));
|
||||
|
||||
$nextPossibleDay = '';
|
||||
switch ($baseDay) {
|
||||
case 0 :
|
||||
$nextPossibleDay = $date->modify('next monday');
|
||||
break;
|
||||
case 1 :
|
||||
$nextPossibleDay = $date->modify('next tuesday');
|
||||
break;
|
||||
case 2 :
|
||||
$nextPossibleDay = $date->modify('next wednesday');
|
||||
break;
|
||||
case 3 :
|
||||
$nextPossibleDay = $date->modify('next thursday');
|
||||
break;
|
||||
case 4 :
|
||||
$nextPossibleDay = $date->modify('next friday');
|
||||
break;
|
||||
case 5 :
|
||||
$nextPossibleDay = $date->modify('next saturday');
|
||||
break;
|
||||
case 6 :
|
||||
$nextPossibleDay = $date->modify('next sunday');
|
||||
break;
|
||||
}
|
||||
|
||||
return $nextPossibleDay;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
</div>
|
||||
|
||||
<div class="row" id="select-pdr">
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-5">
|
||||
{form name="thelia.order.delivery"}
|
||||
<div class="table-responsive" style="border: 1px solid gray">
|
||||
<div class="table-responsive" style="border: 0px solid gray">
|
||||
<table class="table table-condensed table-main">
|
||||
{loop type="pdr_places" name="places-loop" active=true order="city"}
|
||||
<tr class="ligne-pdr">
|
||||
@@ -31,14 +31,21 @@
|
||||
<div class="titre-pdr"><img src="{image file='assets/img/pin.png' source='PointRetrait'}" class="img-pin"><span class="pin-number">{$ID}</span>{$TITLE}</div>
|
||||
<span class="adresse">{$ADDRESS1}</span><br>
|
||||
<span class="adresse">{$ZIPCODE} {$CITY}</span><br>
|
||||
{if {cart attr='total_taxed_price_without_discount'} < $MINIMUM_AMOUNT}
|
||||
<div class="row">
|
||||
<div class="alert alert-info" style="width:95%; margin:5px">{intl l="Message info minimum de commande" d="pointretrait" minimum=$MINIMUM_AMOUNT}</div>
|
||||
</div>
|
||||
{else}
|
||||
<table class="table table-schedule">
|
||||
{loop type="pdr_schedule" name="schedule-loop" place_id={$ID}}
|
||||
<tr class="creneau">
|
||||
<td style="padding:10px; text-align: center">{$DAY_LABEL} {format_date date=$BEGIN format="H\hi"} à {format_date date=$END format="H\hi"}</td>
|
||||
<td style="padding:10px; text-align: center"><input type="radio" name="lps-choosen-day" value="{$ID}"{if {cart attr='total_taxed_price_without_discount'} < $minimum} disabled{/if} /></td>
|
||||
<td style="padding:10px; text-align: center">{$DAY_LABEL} {$CALCULATED_DAY} {format_date date=$BEGIN format="H\hi"} à {format_date date=$END format="H\hi"}</td>
|
||||
<td style="padding:10px; text-align: center"><input type="radio" name="pdr-choosen-day" value="{$ID}"{if {cart attr='total_taxed_price_without_discount'} < $MINIMUM_AMOUNT} disabled{/if} /></td>
|
||||
</tr>
|
||||
{/loop}
|
||||
</table>
|
||||
{/if}
|
||||
|
||||
<div class="price">
|
||||
{if $PRICE > 0}
|
||||
{format_number number=$PRICE} €
|
||||
@@ -53,7 +60,7 @@
|
||||
</div>
|
||||
{/form}
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-7">
|
||||
<input type="hidden" id="map-center-lat" value={{module_config module='PlanificationLivraison' key='map_center_latitude' locale='en_US'}|default:50.75075530537203} />
|
||||
<input type="hidden" id="map-center-lon" value={{module_config module='PlanificationLivraison' key='map_center_longitude' locale='en_US'}|default:2.252608244005041} />
|
||||
|
||||
@@ -93,14 +100,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
$("#form-cart-delivery").off('submit').submit(function(ev) {
|
||||
if ($('[delivery-mode=pdr]').is(':checked')
|
||||
&&
|
||||
$('input[name=pdr-choosen-day]:checked').length === 0) {
|
||||
alert("{intl l='Please select a withdrawal' d='pointretrait' js=1}");
|
||||
ev.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
function loadScript() {
|
||||
var script = document.createElement('script');
|
||||
@@ -121,9 +120,8 @@
|
||||
var opt = {
|
||||
center: new google.maps.LatLng($("#map-center-lat").val(), $("#map-center-lon").val()),
|
||||
zoom: 12,
|
||||
streetViewControl: false,
|
||||
mapTypeControl: false,
|
||||
disableDefaultUI: true,
|
||||
streetViewControl: true,
|
||||
mapTypeControl: true,
|
||||
restriction: {
|
||||
latLngBounds: LIMITES,
|
||||
strictBounds: false,
|
||||
|
||||
Reference in New Issue
Block a user