// Merge -> revision 9435
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9438 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
require_once(realpath(dirname(__FILE__).'/../../config/config.inc.php'));
|
||||
|
||||
require_once(realpath(dirname(__FILE__).'/../../init.php'));
|
||||
require_once(realpath(dirname(__FILE__).'/dejala.php'));
|
||||
|
||||
$params['cart'] = new Cart($cookie->id_cart);
|
||||
$djl = new Dejala() ;
|
||||
|
||||
$result = array() ;
|
||||
|
||||
$djl->hookProcessCarrier($params) ;
|
||||
echo json_encode($result);
|
||||
@@ -74,6 +74,7 @@ class CalendarUtils
|
||||
|
||||
return $dateUtc ;
|
||||
}
|
||||
|
||||
public function skipCurDay($dateUtc)
|
||||
{
|
||||
$currentDayZero = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
|
||||
@@ -84,6 +85,7 @@ class CalendarUtils
|
||||
}
|
||||
return $dateUtc ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoie la prochaine journée disponible (soit $dateUtc, soit la prochaine à 00h00)
|
||||
* Si aucune ds les 15j, renvoie NULL
|
||||
@@ -97,6 +99,7 @@ class CalendarUtils
|
||||
$loopcount = 0;
|
||||
// on positionne au début de journée
|
||||
$dateUtc = mktime(0, 0, 0, date('m', $dateUtc), date('d', $dateUtc), date('Y', $dateUtc));
|
||||
|
||||
// on boucle pour trouver une journée dispo (si ds les 15j, y a pas : on laisse tomber
|
||||
do
|
||||
{
|
||||
@@ -107,6 +110,7 @@ class CalendarUtils
|
||||
while (!$isDateFree && ($loopcount < 15) );
|
||||
if ($isDateFree)
|
||||
return ($dateUtc);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -117,10 +121,13 @@ class CalendarUtils
|
||||
{
|
||||
// jour ferié ?
|
||||
$mCalDate = date("d/m/Y", $dateUtc);
|
||||
|
||||
if (in_array($mCalDate, $exceptions))
|
||||
return (false);
|
||||
|
||||
// jour fermé ?
|
||||
$wd = date('w', $dateUtc);
|
||||
|
||||
if (!isset($calendar[$wd]))
|
||||
return (false);
|
||||
|
||||
@@ -128,8 +135,10 @@ class CalendarUtils
|
||||
$stopHour = (int)($calendar[$wd]['stop_hour']);
|
||||
$currentHour = (int)(date('H', $dateUtc));
|
||||
$currentMin = (int)(date('i', $dateUtc));
|
||||
|
||||
if ($currentMin > 0)
|
||||
$currentHour = $currentHour + 1;
|
||||
|
||||
// avant l'heure de fermeture ?
|
||||
if ($currentHour <= $stopHour)
|
||||
return (true);
|
||||
|
||||
+376
-377
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 5.0 KiB |
@@ -1,56 +1,130 @@
|
||||
<script>
|
||||
<link href="{$timetable_css}" rel="stylesheet" type="text/css" media="all" />
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
var djl_calendar = new Array({foreach from=$dates item=dateItem name=datesLoop}{if !$smarty.foreach.datesLoop.first}, {/if}new Array("{$dateItem.label}", "{$dateItem.value}", {$dateItem.start_hour}, {$dateItem.stop_hour}){/foreach} );
|
||||
var deliveryDateSelected = {$deliveryDateIndexSelected};
|
||||
var deliveryHourSelected = {$deliveryHourSelected|intval};
|
||||
var djlAjaxStoreUrl = '{$module_dir}' + 'ajaxStoreShippingInfo.php' ;
|
||||
var djlIsOpc = false ;
|
||||
{if $opc}
|
||||
djlIsOpc = true ;
|
||||
{/if}
|
||||
|
||||
function DJLupdateCarrierSelectionAndGift() {
|
||||
if (djlIsOpc) {
|
||||
djlUpdateCarrierInfo() ;
|
||||
updateCarrierSelectionAndGift();
|
||||
}
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="{$timetable_js}"></script>
|
||||
<link href="{$timetable_css}" rel="stylesheet" type="text/css" media="all" />
|
||||
{literal}
|
||||
<script>
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
$(document).ready(function() {
|
||||
$('input[name="id_carrier"]').each(function(idx, elt) {
|
||||
if ($(this).parent().hasClass("dejala")) {
|
||||
if ($(this).get(0).checked) {
|
||||
toggle_visibility('shipping_pref','1');
|
||||
}
|
||||
$(this).click(function() {
|
||||
toggle_visibility('shipping_pref', 1);
|
||||
$('div#djl_shipping_pref').show('fast') ;
|
||||
selectDay();
|
||||
});
|
||||
if ($(this).is(':checked')) {
|
||||
$(this).click() ;
|
||||
}
|
||||
else {
|
||||
$('div#djl_shipping_pref').hide() ;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$(this).click(function() {
|
||||
toggle_visibility('shipping_pref', 0);
|
||||
$('div#djl_shipping_pref').hide('fast') ;
|
||||
});
|
||||
}
|
||||
}) ;
|
||||
|
||||
var mHour = deliveryHourSelected;
|
||||
selectDay(deliveryDateSelected);
|
||||
selectHour(mHour);
|
||||
});
|
||||
|
||||
function hideUnusedHours(selectedDay) {
|
||||
entries = jQuery.grep(djl_calendar, function (elt, idx) { if (elt[1] == selectedDay) return true; }) ;
|
||||
$('#shipping_hours div input').parent().addClass("hidden") ;
|
||||
$(entries).each(function(idxEach, eltEach) {
|
||||
$(jQuery.grep($('#shipping_hours div input'), function (elt, idx) { if ($(elt).val() >=eltEach[2] && $(elt).val() <=eltEach[3]) return true; })).parent().removeClass("hidden");
|
||||
}) ;
|
||||
}
|
||||
|
||||
function selectDay() {
|
||||
$('#shipping_dates div input').parent().removeClass("djl_active") ;
|
||||
if ($('#shipping_dates div input:checked').length == 0) {
|
||||
$('#shipping_dates div input').val([$($('#shipping_dates div input')[0]).val()]) ;
|
||||
}
|
||||
$('#shipping_dates div input:checked').parent().addClass("djl_active") ;
|
||||
|
||||
hideUnusedHours($('#shipping_dates div input:checked').val()) ;
|
||||
|
||||
if ($('#shipping_hours div input:checked').parent().is(':visible')) {
|
||||
$('#shipping_hours div input').val([$($('#shipping_hours div input:checked')[0]).val()]) ;
|
||||
}
|
||||
else {
|
||||
$('#shipping_hours div input').val([$($('#shipping_hours div input:visible')[0]).val()]) ;
|
||||
}
|
||||
|
||||
selectHour() ;
|
||||
}
|
||||
|
||||
|
||||
function selectHour() {
|
||||
$('#shipping_hours div input').parent().removeClass("djl_active") ;
|
||||
$('#shipping_hours div input:checked').parent().addClass("djl_active") ;
|
||||
if (djlIsOpc) {
|
||||
djlUpdateCarrierInfo();
|
||||
}
|
||||
}
|
||||
|
||||
function djlUpdateCarrierInfo() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: djlAjaxStoreUrl,
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType : "json",
|
||||
data: {
|
||||
'dejala_id_carrier' : $('input[name=dejala_id_carrier]').val(),
|
||||
'dejala_id_product' : $('input[name=dejala_id_product]').val(),
|
||||
'shipping_day' : $('input[name=shipping_day]:checked').val(),
|
||||
'shipping_hour' : $('input[name=shipping_hour]:checked').val(),
|
||||
'id_carrier' : $('input[name=id_carrier]:checked').val()
|
||||
},
|
||||
success: function(jsonData)
|
||||
{
|
||||
if (jsonData.hasError)
|
||||
{
|
||||
var errors = '';
|
||||
for(error in jsonData.errors)
|
||||
//IE6 bug fix
|
||||
if(error != 'indexOf')
|
||||
errors += jsonData.errors[error] + "\n";
|
||||
alert(errors);
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown) {alert("TECHNICAL ERROR: unable to update Dejala shipping information \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);}
|
||||
});
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
{*
|
||||
switchDay(deliveryDateSelected);
|
||||
switchHours(deliveryHourSelected);
|
||||
toggleShipping();
|
||||
*}
|
||||
|
||||
{foreach from=$carriers item=carrier name=myLoop}
|
||||
{foreach from=$djlCarriers item=carrier name=myLoop}
|
||||
<tr class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{/if} {if $smarty.foreach.myLoop.index % 2}alternate_item{else}item{/if}">
|
||||
<td class="carrier_action radio dejala">
|
||||
<input type="hidden" name="dejala_id_carrier" value="{$carrier.id_carrier|intval}"/>
|
||||
<input type="hidden" name="dejala_id_product" value="{$product.id|intval}"/>
|
||||
<input type="radio" name="id_carrier" value="{$carrier.id_carrier|intval}" id="id_carrier{$carrier.id_carrier|intval}" {if $my_carrier_selected}checked="checked"{/if}"/>
|
||||
<input type="radio" name="id_carrier" value="{$carrier.id_carrier|intval}" id="id_carrier{$carrier.id_carrier|intval}" {if $carrier.id_carrier == $djlCarrierChecked}checked="checked"{/if} onclick="javascript:DJLupdateCarrierSelectionAndGift();"/>
|
||||
</td>
|
||||
<td class="carrier_name">
|
||||
<label for="id_carrier{$carrier.id_carrier|intval}">
|
||||
{if $carrier.img}<img src="{$carrier.img|escape:'htmlall':'UTF-8'}" alt="{$carrier.name|escape:'htmlall':'UTF-8'}" />{else}{$carrier.name|escape:'htmlall':'UTF-8'}{/if}
|
||||
</label>
|
||||
</td>
|
||||
<td class="carrier_infos">{$carrier.delay|escape:'htmlall':'UTF-8'}</td>
|
||||
<td class="carrier_infos">{$carrier.info|escape:'htmlall':'UTF-8'}</td>
|
||||
<td class="carrier_price">
|
||||
{if $carrier.price}
|
||||
<span class="price">
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{foreach from=$carriers item=carrier name=myLoop}
|
||||
{foreach from=$djlCarriers item=carrier name=myLoop}
|
||||
<tr class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{/if} {if $smarty.foreach.myLoop.index % 2}alternate_item{else}item{/if}">
|
||||
<td class="carrier_action radio dejala">
|
||||
<input type="hidden" name="dejala_id_carrier" value="{$carrier.id_carrier|intval}"/>
|
||||
<input type="hidden" name="dejala_id_product" value="{$product.id|intval}"/>
|
||||
<input type="radio" name="id_carrier" value="{$carrier.id_carrier|intval}" id="id_carrier{$carrier.id_carrier|intval}" {if $carrier.id_carrier == $checked}checked="checked"{/if} />
|
||||
<input type="radio" name="id_carrier" value="{$carrier.id_carrier|intval}" id="id_carrier{$carrier.id_carrier|intval}" {if $carrier.id_carrier == $djlCarrierChecked}checked="checked"{/if} />
|
||||
</td>
|
||||
<td class="carrier_name">
|
||||
<label for="id_carrier{$carrier.id_carrier|intval}">
|
||||
|
||||
@@ -1,21 +1,26 @@
|
||||
{* MFR081028 - information de shipping *}
|
||||
<tr style="border-top: 0px solid #bdc2c9;">
|
||||
<td colspan="4" style="border-top: 0px solid #bdc2c9;width:100%;padding:0px 2px 0px 2px;">
|
||||
|
||||
<div id="shipping_pref" {if !$my_carrier_selected}style="display:none;"{/if}>
|
||||
<div id="djl_shipping_pref" class="{if $djlCarrierChecked < 0}hidden{/if}">
|
||||
<div id="shipping_div">
|
||||
<div id="shipping_dates">
|
||||
<div id="shipping_dates" class="{if $isCartOutOfStock}disabled{/if}">
|
||||
<label class="title">{l s='Choose your delivery day' mod='dejala'}:</label><br class="clear"/>
|
||||
{foreach from=$dates item=dateItem name=dateLabelLoop}
|
||||
{assign var='curIdxDate' value=$smarty.foreach.dateLabelLoop.index}
|
||||
<div><label><input type="radio" name="shipping_day" id="shipd{$curIdxDate}" value="{$dateItem.value}" onClick="selectDay({$curIdxDate});" {if ($deliveryDateSelected==$dateItem.value)}checked="checked" {/if}/> {$dateItem.label}</label></div>
|
||||
<div>
|
||||
<input type="radio" name="shipping_day" id="shipd{$curIdxDate}" autocomplete="off" value="{$dateItem.value}" onClick="selectDay();" {if ($deliveryDateSelected==$dateItem.value)}checked="checked"{/if} {if $isCartOutOfStock}disabled="disabled"{/if}/>
|
||||
<label for="shipd{$curIdxDate}">{$dateItem.label}</label>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
<div id="shipping_hours">
|
||||
<div id="shipping_hours" class="{if $isCartOutOfStock}disabled{/if}">
|
||||
<label class="title">{l s='Choose you delivery timeslot' mod='dejala'}:</label><br class="clear"/>
|
||||
{section name=hour start=0 loop=24 step=1}
|
||||
{assign var='curIdxhour' value=$smarty.section.hour.index}
|
||||
<div id="divhr{$curIdxhour}"><label><input type="radio" name="shipping_hour" id="shiphr{$curIdxhour}" value="{$curIdxhour}" OnClick="selectHour({$curIdxhour});" {if ($deliveryHourSelected==$curIdxhour)}checked="checked"{/if}/> {$hourLabels.$curIdxhour}</label></div>
|
||||
<div id="divhr{$curIdxhour}">
|
||||
<input type="radio" name="shipping_hour" id="shiphr{$curIdxhour}" autocomplete="off" value="{$curIdxhour}" OnClick="selectHour();" {if ($deliveryHourSelected==$curIdxhour)}checked="checked"{/if} {if $isCartOutOfStock}disabled="disabled"{/if}/>
|
||||
<label for="shiphr{$curIdxhour}">{$hourLabels.$curIdxhour}</label>
|
||||
</div>
|
||||
{/section}
|
||||
</div>
|
||||
</div>
|
||||
@@ -24,4 +29,3 @@
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{* MFR081028 - information de shipping *}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
class DejalaCarrierUtils
|
||||
{
|
||||
/**
|
||||
* creates of a dejala carrier corresponding to $dejalaProduct
|
||||
* creates a dejala carrier corresponding to $dejalaProduct
|
||||
*/
|
||||
public static function createDejalaCarrier($dejalaConfig)
|
||||
{
|
||||
@@ -43,7 +43,7 @@ class DejalaCarrierUtils
|
||||
$tr->id_tax_rules_group = $trg_id;
|
||||
$tr->id_country = (int) $countryID;
|
||||
$tr->id_state = 0;
|
||||
$tr->id_tax = (int)$tax->id;
|
||||
$tr->id_tax = (int)$tax->id;
|
||||
$tr->state_behavior = 0;
|
||||
$tr->save();
|
||||
}
|
||||
@@ -65,35 +65,68 @@ class DejalaCarrierUtils
|
||||
$languages = Language::getLanguages(true);
|
||||
foreach ($languages as $language)
|
||||
$carrier->delay[$language['id_lang']] = 'Dejala' ;
|
||||
|
||||
|
||||
$carrier->add();
|
||||
|
||||
$carrier->addZone((int)$id_zone) ;
|
||||
/*$sql = 'INSERT INTO `'._DB_PREFIX_.'carrier_zone` (`id_carrier` , `id_zone`) VALUES ('.(int)($carrier->id).', ' . (int)($id_zone) . ')';
|
||||
Db::getInstance()->execute($sql);
|
||||
|
||||
$rangeW = new RangeWeight();
|
||||
$rangeW->id_carrier = $carrier->id;
|
||||
$rangeW->delimiter1 = 0;
|
||||
$rangeW->delimiter2 = $dejalaProduct['max_weight'];
|
||||
$rangeW->add();
|
||||
$vat_factor = (1+ ($dejalaProduct['vat'] / 100));
|
||||
$priceTTC = round(($dejalaProduct['price']*$vat_factor) + $dejalaProduct['margin'], 2);
|
||||
$priceHT = round($priceTTC/$vat_factor, 2);
|
||||
$priceList = '(NULL'.','.$rangeW->id.','.$carrier->id.','.$id_zone.','.$priceHT.')';
|
||||
$carrier->addDeliveryPrice($priceList);*/
|
||||
$groups = Group::getGroups(true);
|
||||
foreach ($groups as $group)
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'carrier_group', array('id_carrier' => (int)($carrier->id), 'id_group' => (int)($group['id_group'])), 'INSERT');
|
||||
|
||||
|
||||
// $rangeW = new RangeWeight();
|
||||
// $rangeW->id_carrier = $carrier->id;
|
||||
// $rangeW->delimiter1 = 0;
|
||||
// $rangeW->delimiter2 = $dejalaProduct['max_weight'];
|
||||
// $rangeW->add();
|
||||
// $vat_factor = (1+ ($dejalaProduct['vat'] / 100));
|
||||
// $priceTTC = round(($dejalaProduct['price']*$vat_factor) + $dejalaProduct['margin'], 2);
|
||||
// $priceHT = round($priceTTC/$vat_factor, 2);
|
||||
// $priceList = '(NULL'.','.$rangeW->id.','.$carrier->id.','.$id_zone.','.$priceHT.')';
|
||||
// $carrier->addDeliveryPrice($priceList);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function getCarrierByName($name)
|
||||
{
|
||||
$carriers = Carrier::getCarriers(Context::getContext()->language->id, true, false, false, null, Carrier::ALL_CARRIERS);
|
||||
foreach($carriers as $carrier)
|
||||
if (!$carrier['deleted'] AND $carrier['external_module_name'] == $name)
|
||||
public static function getCarrierByName($name, $includeInactive = false) {
|
||||
global $cookie ;
|
||||
|
||||
$carriers = Carrier::getCarriers((int)$cookie->id_lang, false, false, false, NULL, ALL_CARRIERS);
|
||||
foreach($carriers as $carrier) {
|
||||
if ($carrier['deleted']) continue ;
|
||||
if ($includeInactive !== true && $carrier['active'] != 1) continue ;
|
||||
|
||||
if (self::getCarrierName($carrier) == $name) {
|
||||
return new Carrier((int)$carrier['id_carrier']) ;
|
||||
|
||||
}
|
||||
}
|
||||
return null ;
|
||||
}
|
||||
|
||||
public static function getFirstActiveCarrierWithNameNotBeing($name) {
|
||||
global $cookie ;
|
||||
|
||||
$carriers = Carrier::getCarriers((int)$cookie->id_lang, false, false, false, NULL, ALL_CARRIERS);
|
||||
foreach($carriers as $carrier) {
|
||||
if ($carrier['deleted']) continue ;
|
||||
|
||||
if ((self::getCarrierName($carrier) != $name) && $carrier['active'] == 1) {
|
||||
return new Carrier((int)$carrier['id_carrier']) ;
|
||||
}
|
||||
}
|
||||
return null ;
|
||||
}
|
||||
|
||||
public static function getCarrierName($carrier) {
|
||||
if (is_object($carrier)) {
|
||||
if (!empty($carrier->external_module_name)) return $carrier->external_module_name ;
|
||||
return $carrier->name ;
|
||||
}
|
||||
else {
|
||||
if (array_key_exists("external_module_name", $carrier) && !empty($carrier['external_module_name'])) return $carrier['external_module_name'] ;
|
||||
return $carrier['name'] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,6 @@ class DejalaConfig
|
||||
if ($this->useSSL !== 0)
|
||||
if (0 === strpos($l_serviceURL, 'http:'))
|
||||
$l_serviceURL = 'https'.substr($l_serviceURL, 4);
|
||||
|
||||
return ($l_serviceURL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,6 @@ class DejalaUtils
|
||||
$responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'POST', FALSE);
|
||||
return ($responseArray);
|
||||
}
|
||||
|
||||
public static function wtf($var, $arrayOfObjectsToHide=null, $fontSize=11)
|
||||
{
|
||||
$text = print_r($var, true);
|
||||
@@ -114,7 +113,6 @@ class DejalaUtils
|
||||
if ($nodeList->length > 0)
|
||||
foreach ($nodeList as $element)
|
||||
$calendar['exceptions'][] = $this->getNodeValue($element);
|
||||
|
||||
}
|
||||
return ($responseArray);
|
||||
}
|
||||
@@ -143,7 +141,6 @@ class DejalaUtils
|
||||
if ($nodeList)
|
||||
foreach ($nodeList as $element)
|
||||
$currentContactNode[$element->nodeName] = $element->textContent;
|
||||
|
||||
$contacts[$name] = $currentContactNode;
|
||||
}
|
||||
}
|
||||
@@ -184,19 +181,19 @@ class DejalaUtils
|
||||
{
|
||||
if (($a['price'] == $b['price']))
|
||||
return ($a['id'] < $b['id']) ? -1 : 1 ;
|
||||
|
||||
return ($a['price'] < $b['price']) ? -1 : 1 ;
|
||||
}
|
||||
return ($a['priority'] < $b['priority']) ? -1 : 1;
|
||||
}
|
||||
|
||||
public function getStoreQuotation($dejalaConfig, $quotationElements, &$products)
|
||||
public function getStoreQuotation($dejalaConfig, $quotationElements, &$products, &$storeAttributes)
|
||||
{
|
||||
$serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/quotation';
|
||||
$serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/quotationV2';
|
||||
$postargs = $quotationElements;
|
||||
$responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'GET', TRUE);
|
||||
if (!($xml = strstr($responseArray['response'], '<?xml')))
|
||||
if (!($xml = strstr($responseArray['response'], '<?xml'))) {
|
||||
$xml = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
$doc = new DOMDocument();
|
||||
@@ -206,17 +203,27 @@ class DejalaUtils
|
||||
{
|
||||
$currentProduct = $this->getNodeValue($productNode);
|
||||
unset($currentProduct['calendar']['entries']['entry']);
|
||||
$calendarNodeList = $doc->getElementsByTagName('entry');
|
||||
foreach ($calendarNodeList as $calendarNode)
|
||||
{
|
||||
unset($currentProduct['computed_calendar']['entries']['entry']);
|
||||
$productCalendars = $productNode->getElementsByTagName('calendar');
|
||||
$calendarNodeList = $productCalendars->item(0)->getElementsByTagName('entry');
|
||||
foreach ($calendarNodeList as $calendarNode) {
|
||||
$calendarEntry = $this->getNodeValue($calendarNode);
|
||||
$currentProduct['calendar']['entries'][$calendarEntry['weekday']] = $calendarEntry;
|
||||
}
|
||||
$exceptionNodeList = $doc->getElementsByTagName('exception');
|
||||
$currentProduct['calendar']['exceptions'] = array();
|
||||
foreach ($exceptionNodeList as $exceptionNode)
|
||||
foreach ($exceptionNodeList as $exceptionNode) {
|
||||
$currentProduct['calendar']['exceptions'][] = $this->getNodeValue($exceptionNode);
|
||||
}
|
||||
|
||||
$productComputedCalendars = $productNode->getElementsByTagName('computed_calendar');
|
||||
if ($productComputedCalendars->length > 0) {
|
||||
$calendarNodeList = $productComputedCalendars->item(0)->getElementsByTagName('computed_entry');
|
||||
foreach ($calendarNodeList as $calendarNode) {
|
||||
$calendarEntry = $this->getNodeValue($calendarNode);
|
||||
$currentProduct['computed_calendar']['entries'][] = $calendarEntry;
|
||||
}
|
||||
}
|
||||
/*$currentProduct = array();
|
||||
$nodeList = $productNode->childNodes;
|
||||
foreach ($nodeList as $element) {
|
||||
@@ -226,8 +233,17 @@ class DejalaUtils
|
||||
if (count($currentProduct))
|
||||
$products[] = $currentProduct;
|
||||
}
|
||||
|
||||
$nodeList = $doc->getElementsByTagName('store');
|
||||
if ($nodeList->length > 0) {
|
||||
$nodeList = $nodeList->item(0)->getElementsByTagName('attributes');
|
||||
if ($nodeList->length > 0) {
|
||||
$storeAttributes = $this->getNodeValue($nodeList->item(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
usort($products, array("DejalaUtils", "cmpProducts"));
|
||||
|
||||
return ($responseArray);
|
||||
}
|
||||
|
||||
@@ -248,13 +264,11 @@ class DejalaUtils
|
||||
$childNodes = $fatherNodeList->item(0)->childNodes;
|
||||
foreach ($childNodes as $childNode)
|
||||
$store[$childNode->nodeName] = $childNode->textContent;
|
||||
|
||||
}
|
||||
$nodeList = $doc->getElementsByTagName('attributes');
|
||||
$store['attributes'] = array();
|
||||
if ($nodeList->length > 0)
|
||||
$store['attributes'] = $this->getNodeValue($nodeList->item(0));
|
||||
|
||||
}
|
||||
return ($responseArray);
|
||||
}
|
||||
@@ -362,7 +376,6 @@ class DejalaUtils
|
||||
$childNodes = $doc->getElementsByTagName('delivery');
|
||||
foreach ($childNodes as $childNode)
|
||||
$deliveries[] = $this->getNodeValue($childNode);
|
||||
|
||||
}
|
||||
return ($responseArray);
|
||||
}
|
||||
@@ -479,11 +492,9 @@ class DejalaUtils
|
||||
|
||||
public function mylog($msg)
|
||||
{
|
||||
|
||||
require_once(dirname(__FILE__) . "/MyLogUtils.php");
|
||||
$myFile = dirname(__FILE__) . "/logFile.txt";
|
||||
MyLogUtils::myLog($myFile, $msg);
|
||||
|
||||
}
|
||||
|
||||
// get a string of a value for Log purposes
|
||||
|
||||
@@ -9,7 +9,7 @@ $_MODULE['<{dejala}prestashop>dejala_796c163589f295373e171842f37265d5'] = 'Mercr
|
||||
$_MODULE['<{dejala}prestashop>dejala_78ae6f0cd191d25147e252dc54768238'] = 'Jeudi';
|
||||
$_MODULE['<{dejala}prestashop>dejala_c33b138a163847cdb6caeeb7c9a126b4'] = 'Vendredi';
|
||||
$_MODULE['<{dejala}prestashop>dejala_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Samedi';
|
||||
$_MODULE['<{dejala}prestashop>dejala_9902522831a16af239ba868918f984c6'] = 'dejala.com : le transport par coursier';
|
||||
$_MODULE['<{dejala}prestashop>dejala_9902522831a16af239ba868918f984c6'] = 'Dejala.com : le transport par coursier';
|
||||
$_MODULE['<{dejala}prestashop>dejala_69a226fe54256a93edb693bc97a7bcb5'] = 'Envoie les demandes de livraisons vers dejala.com';
|
||||
$_MODULE['<{dejala}prestashop>dejala_f66e08578735b3cde28a2d8215b68a52'] = 'Le module nécessite l\'extension php Dejala cURL pour fonctionner correctement. Merci d\'installer l\'extension php \"curl \"';
|
||||
$_MODULE['<{dejala}prestashop>dejala_0e334c81db8c621e16d82618aaf746ab'] = 'Entrez votre nom d\'utilisateur';
|
||||
@@ -32,8 +32,8 @@ $_MODULE['<{dejala}prestashop>dejala_dfa53d8241c9f6908e669371b50e95f3'] = 'Ce mo
|
||||
$_MODULE['<{dejala}prestashop>dejala_4c7d16a1e83bcbfd9b33e95f8e90a625'] = 'Une erreur est survenue lors de l\'authentification de votre compte sur Dejala.com. Ceci peut être du à une erreur réseau ou à un problème de plate-forme. Réessayez plus tard ou contactez Dejala.com.';
|
||||
$_MODULE['<{dejala}prestashop>dejala_94939d114a8c65173b70b6e01aad11c0'] = 'Une erreur est survenue lors de la récupération des informations. Réessayez plus tard ou contactez Dejala.com.';
|
||||
$_MODULE['<{dejala}prestashop>dejala_41d211dd68bf0f87cf3181b0c8dac6e7'] = 'Dejala.com';
|
||||
$_MODULE['<{dejala}prestashop>dejala_3d8764621d6076807b0d60cfcadb7213'] = 'Quand vous voulez... Par coursier';
|
||||
$_MODULE['<{dejala}prestashop>dejala_627db4c965627fb7f03682dbbc43a4a1'] = 'Je choisirai mon heure de livraison quand mon colis sera prêt.';
|
||||
$_MODULE['<{dejala}prestashop>dejala_3d8764621d6076807b0d60cfcadb7213'] = 'Quand vous voulez... Par coursier';
|
||||
$_MODULE['<{dejala}prestashop>dejala_07e9ea0147aee652244a280da00efb5a'] = 'Livraison souhaitée le';
|
||||
$_MODULE['<{dejala}prestashop>dejala_47a4dfe5ab79feb7884fa57786ea587c'] = 'à partir de';
|
||||
$_MODULE['<{dejala}prestashop>dejala_ba93cc89ba75ee6e74699a49a69c0600'] = 'Livraison dont la date doit être fixée avec le client.';
|
||||
|
||||
@@ -1,23 +1,15 @@
|
||||
/* MFR081108 - Shipping Preferences */
|
||||
#shipping_now {
|
||||
width:99%;
|
||||
height:25px;
|
||||
border:1px solid lightgrey;
|
||||
margin-top:5;
|
||||
padding-top:10px;
|
||||
}
|
||||
|
||||
#shipping_div {
|
||||
#djl_shipping_pref #shipping_div {
|
||||
width:100%;
|
||||
}
|
||||
|
||||
#shipping_dates {
|
||||
#djl_shipping_pref #shipping_dates {
|
||||
width:100%;
|
||||
float:left;
|
||||
border:1px solid lightgrey;
|
||||
}
|
||||
|
||||
#shipping_dates div {
|
||||
#djl_shipping_pref #shipping_dates div {
|
||||
height:25px;
|
||||
width:24.9%;
|
||||
margin-top:5px;
|
||||
@@ -25,25 +17,39 @@
|
||||
padding-top:10px;
|
||||
}
|
||||
|
||||
#shipping_hours {
|
||||
#djl_shipping_pref #shipping_hours {
|
||||
float:left;
|
||||
width:100%;
|
||||
border:1px solid lightgrey;
|
||||
margin-top:5px;
|
||||
}
|
||||
|
||||
#shipping_hours div {
|
||||
#djl_shipping_pref #shipping_hours div {
|
||||
height:31px;
|
||||
width:19.9%;
|
||||
float:left;
|
||||
padding-top:10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
#djl_shipping_pref .title {
|
||||
margin:5px;
|
||||
font-size:1.1em;
|
||||
font-weight:bold;
|
||||
color:#993300;
|
||||
}
|
||||
|
||||
#shipping_pref input {border:none;}
|
||||
#djl_shipping_pref input {border:none;}
|
||||
|
||||
#djl_shipping_pref #shipping_hours div[class=djl_active], #djl_shipping_pref #shipping_dates div[class=djl_active] {
|
||||
font-weight: bold;
|
||||
color: rgb(153, 51, 0);
|
||||
}
|
||||
|
||||
#djl_shipping_pref .disabled {
|
||||
zoom: 1;
|
||||
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
|
||||
filter: alpha(opacity=50);
|
||||
-moz-opacity:0.5;
|
||||
-khtml-opacity: 0.5;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user