@@ -98,8 +98,8 @@ public function getPriceCalculated(): float
9898 };
9999
100100 if (
101- isset ($ GLOBALS ['TYPO3_CONF_VARS ' ]['EXTCONF ' ]['cart ' ]['changeVariantDiscount ' ]) &&
102- is_array ($ GLOBALS ['TYPO3_CONF_VARS ' ]['EXTCONF ' ]['cart ' ]['changeVariantDiscount ' ])
101+ isset ($ GLOBALS ['TYPO3_CONF_VARS ' ]['EXTCONF ' ]['cart ' ]['changeVariantDiscount ' ])
102+ && is_array ($ GLOBALS ['TYPO3_CONF_VARS ' ]['EXTCONF ' ]['cart ' ]['changeVariantDiscount ' ])
103103 ) {
104104 foreach ($ GLOBALS ['TYPO3_CONF_VARS ' ]['EXTCONF ' ]['cart ' ]['changeVariantDiscount ' ] as $ funcRef ) {
105105 if ($ funcRef ) {
@@ -144,8 +144,8 @@ public function getBestPriceCalculated($frontendUserGroupIds = []): float
144144 };
145145
146146 if (
147- isset ($ GLOBALS ['TYPO3_CONF_VARS ' ]['EXTCONF ' ]['cart ' ]['changeVariantDiscount ' ]) &&
148- is_array ($ GLOBALS ['TYPO3_CONF_VARS ' ]['EXTCONF ' ]['cart ' ]['changeVariantDiscount ' ])
147+ isset ($ GLOBALS ['TYPO3_CONF_VARS ' ]['EXTCONF ' ]['cart ' ]['changeVariantDiscount ' ])
148+ && is_array ($ GLOBALS ['TYPO3_CONF_VARS ' ]['EXTCONF ' ]['cart ' ]['changeVariantDiscount ' ])
149149 ) {
150150 foreach ($ GLOBALS ['TYPO3_CONF_VARS ' ]['EXTCONF ' ]['cart ' ]['changeVariantDiscount ' ] as $ funcRef ) {
151151 if ($ funcRef ) {
@@ -226,8 +226,8 @@ public function getBestSpecialPrice(array $frontendUserGroupIds = []): ?SpecialP
226226
227227 foreach ($ this ->getSpecialPrices () as $ specialPrice ) {
228228 if ($ bestSpecialPrice === null ) {
229- if (!$ specialPrice ->getFrontendUserGroup () ||
230- in_array ($ specialPrice ->getFrontendUserGroup ()->getUid (), $ frontendUserGroupIds )
229+ if (!$ specialPrice ->getFrontendUserGroup ()
230+ || in_array ($ specialPrice ->getFrontendUserGroup ()->getUid (), $ frontendUserGroupIds )
231231 ) {
232232 $ bestSpecialPrice = $ specialPrice ;
233233 }
@@ -236,16 +236,16 @@ public function getBestSpecialPrice(array $frontendUserGroupIds = []): ?SpecialP
236236
237237 if (
238238 (
239- ($ specialPrice ->getPrice () < $ bestSpecialPrice ->getPrice ()) &&
240- in_array ($ this ->priceCalcMethod , [0 , 1 , 4 , 5 ])
241- ) ||
242- (
243- ($ specialPrice ->getPrice () > $ bestSpecialPrice ->getPrice ()) &&
244- in_array ($ this ->priceCalcMethod , [2 , 3 ])
239+ ($ specialPrice ->getPrice () < $ bestSpecialPrice ->getPrice ())
240+ && in_array ($ this ->priceCalcMethod , [0 , 1 , 4 , 5 ])
241+ )
242+ || (
243+ ($ specialPrice ->getPrice () > $ bestSpecialPrice ->getPrice ())
244+ && in_array ($ this ->priceCalcMethod , [2 , 3 ])
245245 )
246246 ) {
247- if (!$ specialPrice ->getFrontendUserGroup () ||
248- in_array ($ specialPrice ->getFrontendUserGroup ()->getUid (), $ frontendUserGroupIds )
247+ if (!$ specialPrice ->getFrontendUserGroup ()
248+ || in_array ($ specialPrice ->getFrontendUserGroup ()->getUid (), $ frontendUserGroupIds )
249249 ) {
250250 $ bestSpecialPrice = $ specialPrice ;
251251 }
@@ -263,12 +263,12 @@ public function getBestPrice(array $frontendUserGroupIds = []): float
263263 if ($ bestSpecialPrice ) {
264264 if (
265265 (
266- ($ bestSpecialPrice ->getPrice () < $ bestPrice ) &&
267- in_array ($ this ->priceCalcMethod , [0 , 1 , 4 , 5 ])
268- ) ||
269- (
270- ($ bestSpecialPrice ->getPrice () > $ bestPrice ) &&
271- in_array ($ this ->priceCalcMethod , [2 , 3 ])
266+ ($ bestSpecialPrice ->getPrice () < $ bestPrice )
267+ && in_array ($ this ->priceCalcMethod , [0 , 1 , 4 , 5 ])
268+ )
269+ || (
270+ ($ bestSpecialPrice ->getPrice () > $ bestPrice )
271+ && in_array ($ this ->priceCalcMethod , [2 , 3 ])
272272 )
273273 ) {
274274 $ bestPrice = $ bestSpecialPrice ->getPrice ();
@@ -301,9 +301,9 @@ public function getBasePrice(): ?float
301301 {
302302 //TODO: respects different measuring units between variant and product
303303 if (
304- !$ this ->product ||
305- !$ this ->product ->getIsMeasureUnitCompatibility () ||
306- !$ this ->getPriceMeasure () > 0
304+ !$ this ->product
305+ || !$ this ->product ->getIsMeasureUnitCompatibility ()
306+ || !$ this ->getPriceMeasure () > 0
307307 ) {
308308 return null ;
309309 }
@@ -424,20 +424,20 @@ public function getTitle(): string
424424 $ titleArray = [];
425425
426426 if ($ this ->getProduct ()->getBeVariantAttribute1 ()) {
427- $ titleArray [] =
428- $ this ->getProduct ()->getBeVariantAttribute1 ()->getTitle ()
427+ $ titleArray []
428+ = $ this ->getProduct ()->getBeVariantAttribute1 ()->getTitle ()
429429 . ' '
430430 . $ this ->getBeVariantAttributeOption1 ()->getTitle ();
431431 }
432432 if ($ this ->getProduct ()->getBeVariantAttribute2 ()) {
433- $ titleArray [] =
434- $ this ->getProduct ()->getBeVariantAttribute2 ()->getTitle ()
433+ $ titleArray []
434+ = $ this ->getProduct ()->getBeVariantAttribute2 ()->getTitle ()
435435 . ' '
436436 . $ this ->getBeVariantAttributeOption2 ()->getTitle ();
437437 }
438438 if ($ this ->getProduct ()->getBeVariantAttribute3 ()) {
439- $ titleArray [] =
440- $ this ->getProduct ()->getBeVariantAttribute3 ()->getTitle ()
439+ $ titleArray []
440+ = $ this ->getProduct ()->getBeVariantAttribute3 ()->getTitle ()
441441 . ' '
442442 . $ this ->getBeVariantAttributeOption3 ()->getTitle ();
443443 }
0 commit comments