@@ -263,9 +263,12 @@ discard block |
||
| 263 | 263 | { |
| 264 | 264 | foreach( $codes as $code ) |
| 265 | 265 | { |
| 266 | - try { |
|
| 266 | + try |
|
| 267 | + { |
|
| 267 | 268 | $newOrder->addCoupon( $code ); |
| 268 | - } catch( \Aimeos\MShop\Plugin\Provider\Exception | \Aimeos\MShop\Coupon\Exception $e ) { |
|
| 269 | + } |
|
| 270 | + catch( \Aimeos\MShop\Plugin\Provider\Exception | \Aimeos\MShop\Coupon\Exception $e ) |
|
| 271 | + { |
|
| 269 | 272 | $newOrder->deleteCoupon( $code ); |
| 270 | 273 | } |
| 271 | 274 | } |
@@ -384,7 +387,9 @@ discard block |
||
| 384 | 387 | $groupItems = $manager->search( $filter->slice( 0, count( $customerItem->getGroups() ) ) )->all(); |
| 385 | 388 | $context->setGroups( $groupItems ); |
| 386 | 389 | } |
| 387 | - catch( \Exception $e ) {} // Subscription without account |
|
| 390 | + catch( \Exception $e ) |
|
| 391 | + { |
|
| 392 | +} // Subscription without account |
|
| 388 | 393 | |
| 389 | 394 | return $context; |
| 390 | 395 | } |
@@ -570,9 +575,11 @@ discard block |
||
| 570 | 575 | } |
| 571 | 576 | catch( \Exception $e ) |
| 572 | 577 | { |
| 573 | - if( $e->getCode() < 1 ) // not a soft error |
|
| 578 | + if( $e->getCode() < 1 ) { |
|
| 579 | + // not a soft error |
|
| 574 | 580 | { |
| 575 | 581 | $item->setReason( \Aimeos\MShop\Subscription\Item\Iface::REASON_PAYMENT ); |
| 582 | + } |
|
| 576 | 583 | |
| 577 | 584 | if( $this->ends() ) { |
| 578 | 585 | $item->setDateEnd( date_create()->format( 'Y-m-d H:i:s' ) ); |