ClickAndCollect : module finalisé
This commit is contained in:
@@ -20,7 +20,7 @@ return array(
|
||||
'Free' => 'Gratuit',
|
||||
'Location set' => 'Coordonnées GPS présentes ?',
|
||||
'Main' => 'Généralités',
|
||||
'Message explicatif' => 'Il est possible de récupérer votre commande directement auprès de nous, lors d\'une de nos tournées.',
|
||||
'Message explicatif' => 'Il est possible de récupérer votre commande directement auprès de nous, lors de notre prochaine tournée.',
|
||||
'Message no location' => 'Ce point de retrait ne possède pas de coordonnées GPS : pour vos clients, il est conseillé de géolocaliser son 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',
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace PointRetrait\Loop;
|
||||
|
||||
use PlanificationLivraison\PlanificationLivraison;
|
||||
use PointRetrait\Model\PdrScheduleQuery;
|
||||
use PointRetrait\PointRetrait;
|
||||
use Thelia\Core\Template\Element\BaseLoop;
|
||||
use Thelia\Core\Template\Element\LoopResult;
|
||||
use Thelia\Core\Template\Element\LoopResultRow;
|
||||
@@ -31,8 +30,20 @@ class ScheduleLoop extends BaseLoop implements PropelSearchLoopInterface
|
||||
*/
|
||||
public function parseResults(LoopResult $loopResult)
|
||||
{
|
||||
$theDate = '';
|
||||
|
||||
foreach ($loopResult->getResultDataCollection() as $pdr_schedule) {
|
||||
|
||||
if (null === $this->getClickAndCollect()) {
|
||||
$theDate = PlanificationLivraison::calculateRelativeDate($pdr_schedule->getDay(), null);
|
||||
}
|
||||
else {
|
||||
$newDate = PlanificationLivraison::calculateRelativeDate(null, $this->getPlaceId());
|
||||
if ($theDate == '' || $newDate < $theDate)
|
||||
$theDate = $newDate;
|
||||
}
|
||||
|
||||
|
||||
$loopResultRow = new LoopResultRow($pdr_schedule);
|
||||
$loopResultRow
|
||||
->set("ID", $pdr_schedule->getId())
|
||||
@@ -41,7 +52,7 @@ class ScheduleLoop extends BaseLoop implements PropelSearchLoopInterface
|
||||
->set("DAY_LABEL", PlanificationLivraison::getDayLabel($pdr_schedule->getDay()))
|
||||
->set("BEGIN", $pdr_schedule->getBeginTime())
|
||||
->set("END", $pdr_schedule->getEndTime())
|
||||
->set("CALCULATED_DAY", PlanificationLivraison::calculateRelativeDate($pdr_schedule->getDay())->format(PlanificationLivraison::FORMAT_DATES))
|
||||
->set("CALCULATED_DAY", PlanificationLivraison::getDayLabel(($theDate->format('w') - 1) % 6) . ' ' . $theDate->format(PlanificationLivraison::FORMAT_DATES))
|
||||
;
|
||||
$loopResult->addRow($loopResultRow);
|
||||
}
|
||||
@@ -56,7 +67,8 @@ class ScheduleLoop extends BaseLoop implements PropelSearchLoopInterface
|
||||
{
|
||||
return new ArgumentCollection(
|
||||
Argument::createIntListTypeArgument('id'),
|
||||
Argument::createIntListTypeArgument('place_id')
|
||||
Argument::createIntListTypeArgument('place_id'),
|
||||
Argument::createBooleanTypeArgument('click_and_collect', null)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<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} {$CALCULATED_DAY} {format_date date=$BEGIN format="H\hi"} à {format_date date=$END format="H\hi"}</td>
|
||||
<td style="padding:10px; text-align: center">{$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}
|
||||
@@ -82,7 +82,6 @@
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
// Masquer par défaut les options du mode PDR
|
||||
@@ -102,17 +101,17 @@
|
||||
var script = document.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
script.src = "https://maps.googleapis.com/maps/api/js?callback=initMaps" +
|
||||
"&key={module_config module='PlanificationLivraison' key='googlemap_api_key' locale='en_US'}";
|
||||
"&key={module_config module='PlanificationLivraison' key='googlemap_api_key' locale='en_US'}";
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
|
||||
|
||||
function initMaps() {
|
||||
initMap();
|
||||
initMapCnc();
|
||||
if (typeof initMapPdr === "function") initMapPdr();
|
||||
if (typeof initMapCnc === "function") initMapCnc();
|
||||
}
|
||||
|
||||
function initMap() {
|
||||
function initMapPdr() {
|
||||
const LIMITES = {
|
||||
north: 50.85043724044059,
|
||||
east: 2.6869845409159923,
|
||||
@@ -131,12 +130,13 @@
|
||||
}
|
||||
};
|
||||
|
||||
Data.map = new google.maps.Map(document.getElementById('pdr_map'), opt);
|
||||
if (document.getElementById('pdr_map'))
|
||||
Data.map = new google.maps.Map(document.getElementById('pdr_map'), opt);
|
||||
|
||||
displayPins();
|
||||
displayPinsPdr();
|
||||
}
|
||||
|
||||
function displayPins() {
|
||||
function displayPinsPdr() {
|
||||
var arrays = [];
|
||||
$('#coordinates').eq(0).find('tr').each((r,row) => arrays.push($(row).find('td,th').map((c,cell) => $(cell).text()).toArray()))
|
||||
|
||||
@@ -167,4 +167,4 @@
|
||||
initMaps();
|
||||
}
|
||||
|
||||
</script>
|
||||
</script>
|
||||
Reference in New Issue
Block a user