Commit 20615d31 authored by Dirk Wildt's avatar Dirk Wildt

8.17.0

parent f2796983
SELECT tx_quickshop_pricevariant.*
FROM tx_quickshop_pricevariant
JOIN tx_quickshop_mm
ON (
tx_quickshop_mm.uid_local = 18
AND tx_quickshop_mm.table_local = 'tx_quickshop_products'
AND tx_quickshop_mm.table_foreign = 'tx_quickshop_pricevariant'
AND tx_quickshop_mm.uid_foreign = tx_quickshop_pricevariant.uid
);
SELECT *
FROM tx_quickshop_mm
WHERE (
tx_quickshop_mm.uid_local = 18
AND tx_quickshop_mm.table_local = 'tx_quickshop_products'
AND tx_quickshop_mm.table_foreign = 'tx_quickshop_pricevariant'
);
SELECT tx_quickshop_pricevariant.*
FROM tx_quickshop_pricevariant
JOIN tx_quickshop_mm
ON (
tx_quickshop_mm.uid_local = 16
AND tx_quickshop_mm.table_local = 'tx_quickshop_products'
AND tx_quickshop_mm.table_foreign = 'tx_quickshop_pricevariant'
AND tx_quickshop_mm.uid_foreign = tx_quickshop_pricevariant.uid
);
SELECT *
FROM tx_quickshop_mm
WHERE (
tx_quickshop_mm.uid_local = 16
AND tx_quickshop_mm.table_local = 'tx_quickshop_products'
AND tx_quickshop_mm.table_foreign = 'tx_quickshop_pricevariant'
);
SELECT '18' AS puid,
CONCAT('<strong>', tx_quickshop_products.title, '</strong><br />', tx_quickshop_pricevariant.title, ' ', tx_quickshop_pricevariant.value, ' &euro;') AS title,
tx_quickshop_pricevariant.value AS gross,
tx_quickshop_tax.value AS tax,
18 AS sku
FROM tx_quickshop_products
LEFT JOIN tx_quickshop_mm
ON (
tx_quickshop_mm.uid_local = tx_quickshop_products.uid
AND tx_quickshop_mm.table_local = 'tx_quickshop_products'
)
LEFT JOIN tx_quickshop_pricevariant
ON (
tx_quickshop_mm.uid_foreign = tx_quickshop_pricevariant.uid
AND tx_quickshop_mm.table_foreign = 'tx_quickshop_pricevariant'
AND tx_quickshop_pricevariant.uid = 200
AND (`tx_quickshop_pricevariant`.`deleted` = 0)
AND (`tx_quickshop_pricevariant`.`hidden` = 0)
)
LEFT JOIN tx_quickshop_tax
ON (
tx_quickshop_pricevariant.tx_quickshop_tax = tx_quickshop_tax.uid
AND (`tx_quickshop_tax`.`deleted` = 0)
AND (`tx_quickshop_tax`.`hidden` = 0)
AND (`tx_quickshop_tax`.`starttime` <= 1545341880)
AND ((`tx_quickshop_tax`.`endtime` = 0) OR (`tx_quickshop_tax`.`endtime` > 1545341880))
)
WHERE tx_quickshop_products.uid = 18
AND (`tx_quickshop_products`.`deleted` = 0)
AND (`tx_quickshop_products`.`hidden` = 0)
AND (`tx_quickshop_products`.`starttime` <= 1545341880)
AND ((`tx_quickshop_products`.`endtime` = 0) OR (`tx_quickshop_products`.`endtime` > 1545341880))
AND (
(
(`tx_quickshop_products`.`fe_group` = '')
OR (`tx_quickshop_products`.`fe_group` IS NULL)
OR (`tx_quickshop_products`.`fe_group` = '0')
OR (FIND_IN_SET('0', `tx_quickshop_products`.`fe_group`))
OR (FIND_IN_SET('-1', `tx_quickshop_products`.`fe_group`))
)
);
......@@ -3,12 +3,51 @@ TODO
* 161115: Bug in context with variants: In case of update the quantity by caddy, limits won't respected!
* jquery.t3caddy-4.0.0.js: possible lang is en and de only!
8.17.0
19-01-21
Features
* #i0288: E-mail template: unused option will removed automatically
Affected file:
* Classes/Lib/Powermail/Powermail.php
* #i0286: new service options: insurance, recycle fee.
---------
New files
---------
* Configuration/TypoScript/Basis/Plugin/TxCaddyPi1
* _constants/options
* insurance.ts
* recyclingfee.ts
* api/options
* insurance.ts
* recyclingfee.ts
* Resources/Private/Templates/E-Mail/caddy.html
--------------
Affected files
--------------
* Classes/Lib
* Caddy
* Caddy.php
* Calcsum.php
* Template.php
* Configuration/TypoScript/Basis/Plugin/TxCaddyPi1
* _constants/templates.ts
* api/marker.ts
* Resources
* Private
* Language/Plugins/pi1
* de.locallang.xlf
* locallang.xlf
* Templates/
* Foundation/5x/caddy.html
* Public/Css/2.0.0/caddy.css
Improvements
* #i0287: (c) 2019
8.16.2
18-12-30
Bugfix
* #i0285: Update dependency Powermail version
8.16.1
18-12-27
Bugfix
......
......@@ -7,7 +7,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
/* * *************************************************************
* Copyright notice
*
* (c) 2017-2018 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* (c) 2017-2019 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......
......@@ -13,7 +13,7 @@ if( !defined( 'TYPO3_MODE' ) )
/* * *************************************************************
* Copyright notice
*
* (c) 2017-2018 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* (c) 2017-2019 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......
This diff is collapsed.
......@@ -5,7 +5,7 @@ namespace Netzmacher\Caddy\Lib\Caddy;
/* * *************************************************************
* Copyright notice
*
* (c) 2013-2018 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* (c) 2013-2019 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* All rights reserved
*
* Caddy is a fork of wt_cart (version 1.4.6)
......@@ -34,7 +34,7 @@ namespace Netzmacher\Caddy\Lib\Caddy;
* @author Dirk Wildt <http://wildt.at.die-netzmacher.de>
* @package TYPO3
* @subpackage tx_caddy
* @version 4.0.8
* @version 8.17.0
* @since 2.0.0
*/
class Calcsum
......@@ -158,22 +158,17 @@ class Calcsum
*/
public function sum( $items, $options, $conf = null )
{
// #54628, 131229, dwildt, 1+
$this->init( $conf );
$sumItems = $this->sumItems( $items );
$sumOptions = $this->sumOptions( $options );
// #i0039, 131230, dwildt, 1+
$sumOptionsWoPayment = $this->sumOptionsWoPayment( $options );
// #i0047, 140302, dwildt, 1+
$sumCashdiscount = $this->sumCashdiscount( $options, $sumItems );
$sum = array(
// #i0047, 140302, dwildt, 1+
'cashdiscount' => $sumCashdiscount,
'items' => $sumItems,
'options' => $sumOptions,
// #i0039, 131230, dwildt, 1+
'optionswopayment' => $sumOptionsWoPayment,
'sum' => $this->sumSum( $sumItems, $sumOptions, $sumCashdiscount ),
);
......@@ -533,30 +528,39 @@ class Calcsum
* @param array $options : array with options payment, shipping, specials and sum with gross, net, tax.normal, tax.reduced
* @return double $sum : sum for options gross
* @access private
* @version 2.0.2
* @internal #i0286
* @version 8.17.0
* @since 2.0.2
*/
private function sumOptionsGross( $options )
{
$sum = $options[ 'payment' ][ 'sum' ][ 'gross' ] + $options[ 'shipping' ][ 'sum' ][ 'gross' ] + $options[ 'specials' ][ 'sum' ][ 'gross' ]
;
$sum = 0;
$sum = $sum + $options[ 'insurance' ][ 'sum' ][ 'gross' ];
$sum = $sum + $options[ 'payment' ][ 'sum' ][ 'gross' ];
$sum = $sum + $options[ 'recyclingfee' ][ 'sum' ][ 'gross' ];
$sum = $sum + $options[ 'shipping' ][ 'sum' ][ 'gross' ];
$sum = $sum + $options[ 'specials' ][ 'sum' ][ 'gross' ];
return $sum;
}
/**
* sumOptionsNet( ) : Returns sum for options net
*
* @param array $options : array with options payment, shipping, specials and sum with gross, net, tax.normal, tax.reduced
* @return double $sum : sum for options gross
* @param array $options : array with options payment, shipping, specials and sum with net, net, tax.normal, tax.reduced
* @return double $sum : sum for options net
* @access private
* @version 2.0.2
* @internal #i0286
* @version 8.17.0
* @since 2.0.2
*/
private function sumOptionsNet( $options )
{
$sum = $options[ 'payment' ][ 'sum' ][ 'net' ] + $options[ 'shipping' ][ 'sum' ][ 'net' ] + $options[ 'specials' ][ 'sum' ][ 'net' ]
;
$sum = 0;
$sum = $sum + $options[ 'insurance' ][ 'sum' ][ 'net' ];
$sum = $sum + $options[ 'payment' ][ 'sum' ][ 'net' ];
$sum = $sum + $options[ 'recyclingfee' ][ 'sum' ][ 'net' ];
$sum = $sum + $options[ 'shipping' ][ 'sum' ][ 'net' ];
$sum = $sum + $options[ 'specials' ][ 'sum' ][ 'net' ];
return $sum;
}
......@@ -589,13 +593,18 @@ class Calcsum
* @param [type] $$options: ...
* @return array :
* @access private
* @version 2.0.2
* @internal #i0286
* @version 8.17.0
* @since 2.0.2
*/
private function sumOptionsTaxNormal( $options )
{
$sum = $options[ 'payment' ][ 'sum' ][ 'tax' ][ 'normal' ] + $options[ 'shipping' ][ 'sum' ][ 'tax' ][ 'normal' ] + $options[ 'specials' ][ 'sum' ][ 'tax' ][ 'normal' ]
;
$sum = 0;
$sum = $sum + $options[ 'insurance' ][ 'sum' ][ 'tax' ][ 'normal' ];
$sum = $sum + $options[ 'payment' ][ 'sum' ][ 'tax' ][ 'normal' ];
$sum = $sum + $options[ 'recyclingfee' ][ 'sum' ][ 'tax' ][ 'normal' ];
$sum = $sum + $options[ 'shipping' ][ 'sum' ][ 'tax' ][ 'normal' ];
$sum = $sum + $options[ 'specials' ][ 'sum' ][ 'tax' ][ 'normal' ];
return $sum;
}
......@@ -606,13 +615,18 @@ class Calcsum
* @param [type] $$options: ...
* @return array :
* @access private
* @version 2.0.2
* @internal #i0286
* @version 8.17.0
* @since 2.0.2
*/
private function sumOptionsTaxReduced( $options )
{
$sum = $options[ 'payment' ][ 'sum' ][ 'tax' ][ 'reduced' ] + $options[ 'shipping' ][ 'sum' ][ 'tax' ][ 'reduced' ] + $options[ 'specials' ][ 'sum' ][ 'tax' ][ 'reduced' ]
;
$sum = 0;
$sum = $sum + $options[ 'insurance' ][ 'sum' ][ 'tax' ][ 'reduced' ];
$sum = $sum + $options[ 'payment' ][ 'sum' ][ 'tax' ][ 'reduced' ];
$sum = $sum + $options[ 'recyclingfee' ][ 'sum' ][ 'tax' ][ 'reduced' ];
$sum = $sum + $options[ 'shipping' ][ 'sum' ][ 'tax' ][ 'reduced' ];
$sum = $sum + $options[ 'specials' ][ 'sum' ][ 'tax' ][ 'reduced' ];
return $sum;
}
......@@ -652,35 +666,41 @@ class Calcsum
}
/**
* sumOptionsWoPaymentGross( ) : Returns sum gross for shipping and specials
* sumOptionsWoPaymentGross( ) : Returns sum gross for insurance, recyclingfee, shipping and specials
*
* @param array $options : array with options payment, shipping, specials and sum with gross, net, tax.normal, tax.reduced
* @return double $sum : sum gross for shipping and specials
* @param array $options : array with options insurance, payment, recyclingfee, shipping, specials and sum with gross, net, tax.normal, tax.reduced
* @return double $sum
* @access private
* @version 4.0.3
* @version 8.17.0
* @since 4.0.3
*/
private function sumOptionsWoPaymentGross( $options )
{
$sum = $options[ 'shipping' ][ 'sum' ][ 'gross' ] + $options[ 'specials' ][ 'sum' ][ 'gross' ]
;
$sum = 0;
$sum = $sum + $options[ 'insurance' ][ 'sum' ][ 'gross' ];
$sum = $sum + $options[ 'recyclingfee' ][ 'sum' ][ 'gross' ];
$sum = $sum + $options[ 'shipping' ][ 'sum' ][ 'gross' ];
$sum = $sum + $options[ 'specials' ][ 'sum' ][ 'gross' ];
return $sum;
}
/**
* sumOptionsWoPaymentNet( ) : Returns sum net for shipping and specials
* sumOptionsWoPaymentNet( ) : Returns sum net for insurance, recyclingfee, shipping and specials
*
* @param array $options : array with options payment, shipping, specials and sum with gross, net, tax.normal, tax.reduced
* @return double $sum : sum net for shipping and specials
* @param array $options : array with options insurance, payment, recyclingfee, shipping, specials and sum with net, net, tax.normal, tax.reduced
* @return double $sum
* @access private
* @version 4.0.3
* @version 8.17.0
* @since 4.0.3
*/
private function sumOptionsWoPaymentNet( $options )
{
$sum = $options[ 'shipping' ][ 'sum' ][ 'net' ] + $options[ 'specials' ][ 'sum' ][ 'net' ]
;
$sum = 0;
$sum = $sum + $options[ 'insurance' ][ 'sum' ][ 'net' ];
$sum = $sum + $options[ 'recyclingfee' ][ 'sum' ][ 'net' ];
$sum = $sum + $options[ 'shipping' ][ 'sum' ][ 'net' ];
$sum = $sum + $options[ 'specials' ][ 'sum' ][ 'net' ];
return $sum;
}
......@@ -691,7 +711,7 @@ class Calcsum
* @param [type] $$options: ...
* @return array :
* @access private
* @version 4.0.3
* @version 8.17.0
* @since 4.0.3
*/
private function sumOptionsWoPaymentTax( $options )
......@@ -713,13 +733,16 @@ class Calcsum
* @param [type] $$options: ...
* @return array :
* @access private
* @version 4.0.3
* @version 8.17.0
* @since 4.0.3
*/
private function sumOptionsWoPaymentTaxNormal( $options )
{
$sum = $options[ 'shipping' ][ 'sum' ][ 'tax' ][ 'normal' ] + $options[ 'specials' ][ 'sum' ][ 'tax' ][ 'normal' ]
;
$sum = 0;
$sum = $sum + $options[ 'insurance' ][ 'sum' ][ 'tax' ][ 'normal' ];
$sum = $sum + $options[ 'recyclingfee' ][ 'sum' ][ 'tax' ][ 'normal' ];
$sum = $sum + $options[ 'shipping' ][ 'sum' ][ 'tax' ][ 'normal' ];
$sum = $sum + $options[ 'specials' ][ 'sum' ][ 'tax' ][ 'normal' ];
return $sum;
}
......@@ -735,8 +758,11 @@ class Calcsum
*/
private function sumOptionsWoPaymentTaxReduced( $options )
{
$sum = $options[ 'shipping' ][ 'sum' ][ 'tax' ][ 'reduced' ] + $options[ 'specials' ][ 'sum' ][ 'tax' ][ 'reduced' ]
;
$sum = 0;
$sum = $sum + $options[ 'insurance' ][ 'sum' ][ 'tax' ][ 'reduced' ];
$sum = $sum + $options[ 'recyclingfee' ][ 'sum' ][ 'tax' ][ 'reduced' ];
$sum = $sum + $options[ 'shipping' ][ 'sum' ][ 'tax' ][ 'reduced' ];
$sum = $sum + $options[ 'specials' ][ 'sum' ][ 'tax' ][ 'reduced' ];
return $sum;
}
......
......@@ -5,7 +5,7 @@ namespace Netzmacher\Caddy\Lib\Caddy;
/* * *************************************************************
* Copyright notice
*
* (c) 2013-2018 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* (c) 2013-2019 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* All rights reserved
*
* Caddy is a fork of wt_cart (version 1.4.6)
......
......@@ -5,7 +5,7 @@ namespace Netzmacher\Caddy\Lib\Caddy;
/* * *************************************************************
* Copyright notice
*
* (c) 2014-2018 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* (c) 2014-2019 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......@@ -333,18 +333,22 @@ class Stockmanager
{
switch( true )
{
case( $qtyByOrder > 0 ):
$prompt = 'Sorry, but the item "' . $title . '" isn\'t available ' . $qtyByOrder . ' times any longer. '
case( $qtyByOrder > 1 ):
$prompt = 'Sorry, but the item "' . $title . '" isn\'t available ' . $qtyByOrder . ' time any longer. '
. 'Please go back to the order form, decrease the wanted quantity to ' . $qtyInStock . ' and send the form again.'
;
break;
case( $qtyByOrder == 0 ):
default:
$prompt = 'Sorry, but the item "' . $title . '" isn\'t available any longer. '
. 'Please go back to the order form, remove the item and send the form again.'
;
break;
}
$prompt = ''
. '<div style="background:red;color:white;font-weight:bold;padding:1em;text-align:center;">'
. $prompt
. '</div>';
die( $prompt );
}
......
......@@ -5,7 +5,7 @@ namespace Netzmacher\Caddy\Lib;
/***************************************************************
* Copyright notice
*
* (c) 2013-2018 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* (c) 2013-2019 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* All rights reserved
*
* Caddy is a fork of wt_cart (version 1.4.6)
......
......@@ -5,7 +5,7 @@ namespace Netzmacher\Caddy\Lib\EPayment\Paymill;
/* * *************************************************************
* Copyright notice
*
* (c) 2018 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* (c) 2018-2019 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......
......@@ -5,7 +5,7 @@ namespace Netzmacher\Caddy\Lib\EPayment\Paymill;
/* * *************************************************************
* Copyright notice
*
* (c) 2014-2018 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* (c) 2014-2019 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......
......@@ -8,7 +8,7 @@ use TYPO3\CMS\Core\Utility\DebugUtility;
/* * *************************************************************
* Copyright notice
*
* (c) 2014-2018 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* (c) 2014-2019 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......
......@@ -5,7 +5,7 @@ namespace Netzmacher\Caddy\Lib\EPayment\Paymill;
/* * *************************************************************
* Copyright notice
*
* (c) 2018 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* (c) 2018-2019 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......
......@@ -5,7 +5,7 @@ namespace Netzmacher\Caddy\Lib\EPayment\Paymill;
/* * *************************************************************
* Copyright notice
*
* (c) 2014-2018 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* (c) 2014-2019 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......
......@@ -5,7 +5,7 @@ namespace Netzmacher\Caddy\Lib\EPayment\Powermail;
/* * *************************************************************
* Copyright notice
*
* (c) 2014-2018 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* (c) 2014-2019 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......
......@@ -5,7 +5,7 @@ namespace Netzmacher\Caddy\Lib\Powermail;
/* * *************************************************************
* Copyright notice
*
* (c) 2013-2018 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* (c) 2013-2019 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......
......@@ -5,7 +5,7 @@ namespace Netzmacher\Caddy\Lib\Powermail;
/* * *************************************************************
* Copyright notice
*
* (c) 2013-2018 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* (c) 2013-2019 - Dirk Wildt <http://wildt.at.die-netzmacher.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......@@ -31,7 +31,7 @@ namespace Netzmacher\Caddy\Lib\Powermail;
* @author Dirk Wildt <http://wildt.at.die-netzmacher.de>
* @package TYPO3
* @subpackage tx_caddy
* @version 8.12.1
* @version 8.17.0
* @since 2.0.0
*/
class Powermail extends \Netzmacher\Caddy\AbstractPlugin
......@@ -311,7 +311,7 @@ class Powermail extends \Netzmacher\Caddy\AbstractPlugin
*
* @return string caddy content
* @access public
* @version 6.0.3
* @version 8.17.0
* @since 2.0.2
*/
public function caddyEmail( $content = '', $conf = array() )
......@@ -341,8 +341,6 @@ class Powermail extends \Netzmacher\Caddy\AbstractPlugin
if( !$this->caddyEmailInit() )
{
\Netzmacher\Caddy\Utility\Debug\Console::log( 'dev only.', __METHOD__, __LINE__, true );
//var_dump( __METHOD__, __LINE__ );
//die( );
return null;
}
// RETURN null, if init is unproper
......@@ -356,25 +354,15 @@ class Powermail extends \Netzmacher\Caddy\AbstractPlugin
$tmpl = $caddy[ 'tmpl' ];
unset( $caddy );
// #i0288, 190122, dwildt, 1+
$tmpl = $this->caddyEmailSubparts( $tmpl );
$content = $content . $this->MarkerBasedTemplateService->substituteMarkerArrayCached( $tmpl, $marker, $subparts );
$content = $this->dynamicMarkers->main( $content, $this ); // Fill dynamic locallang or typoscript markers
$content = preg_replace( '|###.*?###|i', '', $content ); // Finally clear not filled markers
// #58646, 140517, dwildt, 8-
// // #i0019, 130628, dwildt, 6+
// // Items are utf8 encoded: decode all code
// $content = utf8_decode($content);
// // Move html entities like &nbsp; to ' ' or &uuml; to ü
// $content = html_entity_decode($content);
// // Decode code for UTF8
// $content = utf8_encode($content);
// #58646, 140517, dwildt, 2+
// Move html entities like &nbsp; to ' ' or &uuml; to ü
$content = html_entity_decode( $content );
//var_dump( __METHOD__, __LINE__, $content );
//die( );
//
\Netzmacher\Caddy\Utility\Debug\Console::log( 'dev only.', __METHOD__, __LINE__, true );
return $content;
}
......@@ -592,6 +580,193 @@ class Powermail extends \Netzmacher\Caddy\AbstractPlugin
$this->session = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( \Netzmacher\Caddy\Lib\Session::class );
}
/**
* caddyEmailSubparts( ) : Remove unused subparts
*
* @param string $tmpl
* @return string $tmpl
* @access private
* @internal #i0288
* @version 8.17.0
* @since 8.17.0
*/
private function caddyEmailSubparts( $tmpl )
{
$pid = $GLOBALS[ "TSFE" ]->id;
$sesArray = $GLOBALS[ 'TSFE' ]->fe_user->getKey( 'ses', $this->extKey . '_' . $pid );
$tmpl = $this->caddyEmailSubpartsRemoveInsurance( $sesArray, $tmpl );
$tmpl = $this->caddyEmailSubpartsRemovePayment( $sesArray, $tmpl );
$tmpl = $this->caddyEmailSubpartsRemoveRecyclingfee( $sesArray, $tmpl );
$tmpl = $this->caddyEmailSubpartsRemoveShipping( $sesArray, $tmpl );
$tmpl = $this->caddyEmailSubpartsRemoveSpecials( $sesArray, $tmpl );
$tmpl = $this->caddyEmailSubpartsRemoveTaxNormal( $sesArray, $tmpl );
$tmpl = $this->caddyEmailSubpartsRemoveTaxReduced( $sesArray, $tmpl );
return $tmpl;
}
/**
* caddyEmailSubpartsRemove( ) : Removes a subpart, if net is empty
*
* @param array $optionType :
* @param array $sesArray
* @param string $tmpl
* @return string $tmpl
* @access private
* @internal #i0288
* @version 8.17.0
* @since 8.17.0
*/
private function caddyEmailSubpartsRemove( $optionType, $sesArray, $tmpl )
{
$value = $sesArray[ 'options' ][ $optionType ][ 'sum' ][ 'net' ];
if( !empty( $value ) )
{
return $tmpl;
}
$subpart = '###OPTIONS' . strtoupper( $optionType ) . '###';
$tmpl = $this->MarkerBasedTemplateService->substituteSubpart( $tmpl, $subpart, null );
return $tmpl;
}
/**
* caddyEmailSubpartsRemoveInsurance( ) : Removes a subpart, if net is empty
*
* @param array $sesArray
* @param string $tmpl
* @return string $tmpl
* @access private
* @internal #i0288
* @version 8.17.0
* @since 8.17.0
*/
private function caddyEmailSubpartsRemoveInsurance( $sesArray, $tmpl )
{
$tmpl = $this->caddyEmailSubpartsRemove( 'insurance', $sesArray, $tmpl );
return $tmpl;
}
/**
* caddyEmailSubpartsRemovePayment( ) : Removes a subpart, if net is empty
*
* @param array $sesArray
* @param string $tmpl
* @return string $tmpl
* @access private
* @internal #i0288
* @version 8.17.0
* @since 8.17.0
*/
private function caddyEmailSubpartsRemovePayment( $sesArray, $tmpl )
{
$tmpl = $this->caddyEmailSubpartsRemove( 'payment', $sesArray, $tmpl );
return $tmpl;
}
/**
* caddyEmailSubpartsRemoveRecyclingfee( ) : Removes a subpart, if net is empty
*
* @param array $sesArray
* @param string $tmpl
* @return string $tmpl
* @access private
* @internal #i0288
* @version 8.17.0
* @since 8.17.0
*/
private function caddyEmailSubpartsRemoveRecyclingfee( $sesArray, $tmpl )
{
$tmpl = $this->caddyEmailSubpartsRemove( 'recyclingfee', $sesArray, $tmpl );
return $tmpl;
}
/**
* caddyEmailSubpartsRemoveShipping( ) : Removes a subpart, if net is empty
*
* @param array $sesArray
* @param string $tmpl
* @return string $tmpl
* @access private
* @internal #i0288
* @version 8.17.0
* @since 8.17.0
*/
private function caddyEmailSubpartsRemoveShipping( $sesArray, $tmpl )
{
$tmpl = $this->caddyEmailSubpartsRemove( 'shipping', $sesArray, $tmpl );
return $tmpl;
}
/**
* caddyEmailSubpartsRemoveTaxNormal( ) : Removes a subpart, if net is empty
*
* @param array $sesArray
* @param string $tmpl
* @return string $tmpl
* @access private
* @internal #i0288
* @version 8.17.0
* @since 8.17.0
*/
private function caddyEmailSubpartsRemoveTaxNormal( $sesArray, $tmpl )
{
$value = $sesArray[ 'sumsumtaxnormal' ];
if( !empty( $value ) )
{
return $tmpl;
}
$subpart = '###TAXNORMAL###';
$tmpl = $this->MarkerBasedTemplateService->substituteSubpart( $tmpl, $subpart, null );
return $tmpl;