@@ -283,17 +283,14 @@ discard block |
||
| 283 | 283 | { |
| 284 | 284 | $address->copyFrom( $value ); |
| 285 | 285 | $this->basket->setAddress( $address, $type ); |
| 286 | - } |
|
| 287 | - else if( is_array( $value ) ) |
|
| 286 | + } else if( is_array( $value ) ) |
|
| 288 | 287 | { |
| 289 | 288 | $this->setAddressFromArray( $address, $value ); |
| 290 | 289 | $this->basket->setAddress( $address, $type ); |
| 291 | - } |
|
| 292 | - else if( $value === null ) |
|
| 290 | + } else if( $value === null ) |
|
| 293 | 291 | { |
| 294 | 292 | $this->basket->deleteAddress( $type ); |
| 295 | - } |
|
| 296 | - else |
|
| 293 | + } else |
|
| 297 | 294 | { |
| 298 | 295 | throw new \Aimeos\Controller\Frontend\Basket\Exception( sprintf( 'Invalid value for address type "%1$s"', $type ) ); |
| 299 | 296 | } |
@@ -519,10 +516,11 @@ discard block |
||
| 519 | 516 | { |
| 520 | 517 | $msg = sprintf( 'No unique article found for selected attributes and product ID "%1$s"', $productItem->getId() ); |
| 521 | 518 | throw new \Aimeos\Controller\Frontend\Basket\Exception( $msg ); |
| 522 | - } |
|
| 523 | - else if( ( $result = reset( $productItems ) ) !== false ) // count == 1 |
|
| 519 | + } else if( ( $result = reset( $productItems ) ) !== false ) { |
|
| 520 | + // count == 1 |
|
| 524 | 521 | { |
| 525 | 522 | $productItem = $result; |
| 523 | + } |
|
| 526 | 524 | $orderBaseProductItem->setProductCode( $productItem->getCode() ); |
| 527 | 525 | |
| 528 | 526 | $subprices = $productItem->getRefItems( 'price', 'default', 'default' ); |
@@ -542,10 +540,11 @@ discard block |
||
| 542 | 540 | |
| 543 | 541 | $attr[] = $orderAttributeItem; |
| 544 | 542 | } |
| 545 | - } |
|
| 546 | - else if( !isset( $options['variant'] ) || $options['variant'] != false ) // count == 0 |
|
| 543 | + } else if( !isset( $options['variant'] ) || $options['variant'] != false ) { |
|
| 544 | + // count == 0 |
|
| 547 | 545 | { |
| 548 | 546 | $msg = sprintf( 'No article found for selected attributes and product ID "%1$s"', $productItem->getId() ); |
| 547 | + } |
|
| 549 | 548 | throw new \Aimeos\Controller\Frontend\Basket\Exception( $msg ); |
| 550 | 549 | } |
| 551 | 550 | |
@@ -160,8 +160,7 @@ discard block |
||
| 160 | 160 | { |
| 161 | 161 | $this->setAddress( $type, $item->toArray() ); |
| 162 | 162 | $basket->deleteAddress( $type ); |
| 163 | - } |
|
| 164 | - catch( \Exception $e ) |
|
| 163 | + } catch( \Exception $e ) |
|
| 165 | 164 | { |
| 166 | 165 | $logger = $this->getContext()->getLogger(); |
| 167 | 166 | $str = 'Error migrating address with type "%1$s" in basket to locale "%2$s": %3$s'; |
@@ -190,8 +189,7 @@ discard block |
||
| 190 | 189 | { |
| 191 | 190 | $this->addCoupon( $code ); |
| 192 | 191 | $basket->deleteCoupon( $code, true ); |
| 193 | - } |
|
| 194 | - catch( \Exception $e ) |
|
| 192 | + } catch( \Exception $e ) |
|
| 195 | 193 | { |
| 196 | 194 | $logger = $this->getContext()->getLogger(); |
| 197 | 195 | $str = 'Error migrating coupon with code "%1$s" in basket to locale "%2$s": %3$s'; |
@@ -240,8 +238,7 @@ discard block |
||
| 240 | 238 | ); |
| 241 | 239 | |
| 242 | 240 | $basket->deleteProduct( $pos ); |
| 243 | - } |
|
| 244 | - catch( \Exception $e ) |
|
| 241 | + } catch( \Exception $e ) |
|
| 245 | 242 | { |
| 246 | 243 | $code = $product->getProductCode(); |
| 247 | 244 | $logger = $this->getContext()->getLogger(); |
@@ -276,8 +273,7 @@ discard block |
||
| 276 | 273 | |
| 277 | 274 | $this->setService( $type, $item->getServiceId(), $attributes ); |
| 278 | 275 | $basket->deleteService( $type ); |
| 279 | - } |
|
| 280 | - catch( \Exception $e ) { ; } // Don't notify the user as appropriate services can be added automatically |
|
| 276 | + } catch( \Exception $e ) { ; } // Don't notify the user as appropriate services can be added automatically |
|
| 281 | 277 | } |
| 282 | 278 | |
| 283 | 279 | return $errors; |