skip no working days while transportation
This commit is contained in:
parent
e95630a198
commit
be1f41e2dc
@ -68,10 +68,12 @@
|
||||
<span class="gts-i-name">[{$oOrderArticle->oxorderarticles__oxtitle->value|escape:"quotes"}]</span>
|
||||
<span class="gts-i-price">[{$sPrice|string_format:"%.2f"}]</span>
|
||||
<span class="gts-i-quantity">[{$oOrderArticle->getFieldData('oxamount')}]</span>
|
||||
<span class="gts-i-prodsearch-id">[{$oView->d3GAgetProductId($oOrderArticle)}]</span>
|
||||
<span class="gts-i-prodsearch-store-id">[{$oD3GASettings->getValue('sD3GATSShoppingAccountId')}]</span>
|
||||
<span class="gts-i-prodsearch-country">[{$oD3GASettings->getValue('sD3GATSShoppingCountry')|upper}]</span>
|
||||
<span class="gts-i-prodsearch-language">[{$oD3GASettings->getValue('sD3GATSShoppingLanguage')|lower}]</span>
|
||||
[{if $oD3GASettings->getValue('sD3GATSShoppingActive')}]
|
||||
<span class="gts-i-prodsearch-id">[{$oView->d3GAgetProductId($oOrderArticle)}]</span>
|
||||
<span class="gts-i-prodsearch-store-id">[{$oD3GASettings->getValue('sD3GATSShoppingAccountId')}]</span>
|
||||
<span class="gts-i-prodsearch-country">[{$oD3GASettings->getValue('sD3GATSShoppingCountry')|upper}]</span>
|
||||
<span class="gts-i-prodsearch-language">[{$oD3GASettings->getValue('sD3GATSShoppingLanguage')|lower}]</span>
|
||||
[{/if}]
|
||||
</span>
|
||||
[{/foreach}]
|
||||
<!-- end repeated item specific informations -->
|
||||
|
@ -86,7 +86,11 @@ class d3_thankyou_googleanalytics extends d3_thankyou_googleanalytics_parent
|
||||
*/
|
||||
public function d3GAgetEstimatedShippingDate()
|
||||
{
|
||||
return $this->_d3GAgetEstimatedDate('iEstShippingTimeValue', time());
|
||||
startProfile(__METHOD__);
|
||||
$iTimeStamp = $this->_d3GAgetEstimatedDate('iEstShippingTimeValue', time());
|
||||
stopProfile(__METHOD__);
|
||||
|
||||
return $iTimeStamp;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -94,8 +98,12 @@ class d3_thankyou_googleanalytics extends d3_thankyou_googleanalytics_parent
|
||||
*/
|
||||
public function d3GAgetEstimatedDeliveryDate()
|
||||
{
|
||||
startProfile(__METHOD__);
|
||||
$iShippingDate = $this->d3GAgetEstimatedShippingDate();
|
||||
return $this->_d3GAgetEstimatedDate('iEstDeliveryTimeValue', $iShippingDate);
|
||||
$iTimeStamp = $this->_d3GAgetEstimatedDate('iEstDeliveryTimeValue', $iShippingDate);
|
||||
stopProfile(__METHOD__);
|
||||
|
||||
return $iTimeStamp;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -107,12 +115,16 @@ class d3_thankyou_googleanalytics extends d3_thankyou_googleanalytics_parent
|
||||
protected function _d3GAgetEstimatedDate($sModCfgVarName, $iTimestamp)
|
||||
{
|
||||
$iTimeValue = d3_cfg_mod::get($this->_sModCfgId)->getValue($sModCfgVarName);
|
||||
$iTimestamp = strtotime('+ ' . $iTimeValue . ' day', $iTimestamp);
|
||||
|
||||
do {
|
||||
$this->_blD3GADateChanged = false;
|
||||
$iTimestamp = $this->_d3GAavoidIdlePeriod($iTimestamp);
|
||||
} while ($this->_blD3GADateChanged === true);
|
||||
for ($i = 0; $i < $iTimeValue; $i++) {
|
||||
$iTimestamp += 86400;
|
||||
|
||||
// check, if transportation day is a working day, else transportation has a break
|
||||
do {
|
||||
$this->_blD3GADateChanged = false;
|
||||
$iTimestamp = $this->_d3GAskipIdlePeriod($iTimestamp);
|
||||
} while ($this->_blD3GADateChanged === true);
|
||||
}
|
||||
|
||||
return $iTimestamp;
|
||||
}
|
||||
@ -122,17 +134,20 @@ class d3_thankyou_googleanalytics extends d3_thankyou_googleanalytics_parent
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
protected function _d3GAavoidIdlePeriod($iTimestamp)
|
||||
protected function _d3GAskipIdlePeriod($iTimestamp)
|
||||
{
|
||||
startProfile(__METHOD__);
|
||||
$iWeekday = date('N', $iTimestamp);
|
||||
|
||||
if (in_array($iWeekday, $this->aD3GAWeekendDays)) {
|
||||
$iOffset = 8 - $iWeekday;
|
||||
$iTimestamp = strtotime('+ '.$iOffset.' day', $iTimestamp);
|
||||
$iTimestamp += $iOffset * 86400;
|
||||
$this->_blD3GADateChanged = true;
|
||||
}
|
||||
|
||||
return $this->_d3GAavoidFeastDays($iTimestamp);
|
||||
stopProfile(__METHOD__);
|
||||
|
||||
return $this->_d3GAskipFeastDays($iTimestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -140,13 +155,17 @@ class d3_thankyou_googleanalytics extends d3_thankyou_googleanalytics_parent
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
protected function _d3GAavoidFeastDays($iTimestamp)
|
||||
protected function _d3GAskipFeastDays($iTimestamp)
|
||||
{
|
||||
startProfile(__METHOD__);
|
||||
|
||||
while (in_array(date('d-m', $iTimestamp), $this->aD3GAfixFeastDays)) {
|
||||
$iTimestamp = strtotime('+ 1 day', $iTimestamp);
|
||||
$iTimestamp += 86400;
|
||||
$this->_blD3GADateChanged = true;
|
||||
}
|
||||
|
||||
stopProfile(__METHOD__);
|
||||
|
||||
return $iTimestamp;
|
||||
}
|
||||
|
||||
|
@ -279,7 +279,7 @@ $aLang = array(
|
||||
'D3_GOOGLEANALYTICS_TS_ACTIVE' => 'Trusted Store aktivieren',
|
||||
'D3_GOOGLEANALYTICS_TS_ID' => 'Trusted Store-ID',
|
||||
'D3_GOOGLEANALYTICS_TS_ESTSHIPDATEAFTER' => 'Zeitraum vom Bestelleingang bis zum Versand',
|
||||
'D3_GOOGLEANALYTICS_TS_ESTSHIPDATEAFTER_DAYS' => 'Kalendertag(e)',
|
||||
'D3_GOOGLEANALYTICS_TS_ESTSHIPDATEAFTER_DAYS' => 'Werktag(e)',
|
||||
'D3_GOOGLEANALYTICS_TS_ESTSHIPDATEAFTER_DESC' => '<p>Google teilt Ihrem Kunden per Mail mit, '.
|
||||
'nach welchem Zeitraum ausgehend vom Bestelleingang die bestellten Artikel versendet werden. Geben Sie hier '.
|
||||
'den für Normalfälle größten Zeitraum bis zum Versand in Tagen an (z.B. 3 bei "1 bis 3 Tage"). Nach dem '.
|
||||
@ -289,7 +289,7 @@ $aLang = array(
|
||||
'erweitern Sie die Überladung der thankyou-Klasse entsprechend.</p>',
|
||||
'D3_GOOGLEANALYTICS_TS_ESTDELDATEAFTER' => 'Zeitraum vom Versand bis zur Lieferung beim '.
|
||||
'Empfänger',
|
||||
'D3_GOOGLEANALYTICS_TS_ESTDELDATEAFTER_DAYS' => 'Kalendertag(e)',
|
||||
'D3_GOOGLEANALYTICS_TS_ESTDELDATEAFTER_DAYS' => 'Werktag(e)',
|
||||
'D3_GOOGLEANALYTICS_TS_ESTDELDATEAFTER_DESC' => '<p>Google teilt Ihrem Kunden per Mail mit, '.
|
||||
'nach welchem Zeitraum die bestellten Artikel in der Regel beim Kunden eintreffen. Geben Sie hier den für '.
|
||||
'Normalfälle größten Zeitraum für die Lieferung in Tagen an (z.B. 4 bei "1 bis 4 Tage"). Der errechnete '.
|
||||
|
@ -278,7 +278,7 @@ $aLang = array(
|
||||
'D3_GOOGLEANALYTICS_TS_ACTIVE' => 'Trusted Store aktivieren',
|
||||
'D3_GOOGLEANALYTICS_TS_ID' => 'Trusted Store-ID',
|
||||
'D3_GOOGLEANALYTICS_TS_ESTSHIPDATEAFTER' => 'Zeitraum vom Bestelleingang bis zum Versand',
|
||||
'D3_GOOGLEANALYTICS_TS_ESTSHIPDATEAFTER_DAYS' => 'Kalendertag(e)',
|
||||
'D3_GOOGLEANALYTICS_TS_ESTSHIPDATEAFTER_DAYS' => 'Werktag(e)',
|
||||
'D3_GOOGLEANALYTICS_TS_ESTSHIPDATEAFTER_DESC' => '<p>Google teilt Ihrem Kunden per Mail mit, '.
|
||||
'nach welchem Zeitraum ausgehend vom Bestelleingang die bestellten Artikel versendet werden. Geben Sie hier '.
|
||||
'den für Normalfälle größten Zeitraum bis zum Versand in Tagen an (z.B. 3 bei "1 bis 3 Tage"). Nach dem '.
|
||||
@ -288,7 +288,7 @@ $aLang = array(
|
||||
'erweitern Sie die Überladung der thankyou-Klasse entsprechend.</p>',
|
||||
'D3_GOOGLEANALYTICS_TS_ESTDELDATEAFTER' => 'Zeitraum vom Versand bis zur Lieferung beim '.
|
||||
'Empfänger',
|
||||
'D3_GOOGLEANALYTICS_TS_ESTDELDATEAFTER_DAYS' => 'Kalendertag(e)',
|
||||
'D3_GOOGLEANALYTICS_TS_ESTDELDATEAFTER_DAYS' => 'Werktag(e)',
|
||||
'D3_GOOGLEANALYTICS_TS_ESTDELDATEAFTER_DESC' => '<p>Google teilt Ihrem Kunden per Mail mit, '.
|
||||
'nach welchem Zeitraum die bestellten Artikel in der Regel beim Kunden eintreffen. Geben Sie hier den für '.
|
||||
'Normalfälle größten Zeitraum für die Lieferung in Tagen an (z.B. 4 bei "1 bis 4 Tage"). Der errechnete '.
|
||||
|
Loading…
Reference in New Issue
Block a user