@@ -104,10 +104,11 @@ discard block |
||
104 | 104 | { |
105 | 105 | $msg = sprintf( 'No unique article found for selected attributes and product ID "%1$s"', $productItem->getId() ); |
106 | 106 | throw new \Aimeos\Controller\Frontend\Basket\Exception( $msg ); |
107 | - } |
|
108 | - else if( ( $result = reset( $productItems ) ) !== false ) // count == 1 |
|
107 | + } else if( ( $result = reset( $productItems ) ) !== false ) { |
|
108 | + // count == 1 |
|
109 | 109 | { |
110 | 110 | $productItem = $result; |
111 | + } |
|
111 | 112 | $orderBaseProductItem->setProductCode( $productItem->getCode() ); |
112 | 113 | |
113 | 114 | $subprices = $productItem->getRefItems( 'price', 'default', 'default' ); |
@@ -133,10 +134,11 @@ discard block |
||
133 | 134 | |
134 | 135 | $attr[] = $orderAttributeItem; |
135 | 136 | } |
136 | - } |
|
137 | - else if( !isset( $options['variant'] ) || $options['variant'] != false ) // count == 0 |
|
137 | + } else if( !isset( $options['variant'] ) || $options['variant'] != false ) { |
|
138 | + // count == 0 |
|
138 | 139 | { |
139 | 140 | $msg = sprintf( 'No article found for selected attributes and product ID "%1$s"', $productItem->getId() ); |
141 | + } |
|
140 | 142 | throw new \Aimeos\Controller\Frontend\Basket\Exception( $msg ); |
141 | 143 | } |
142 | 144 |
@@ -287,17 +287,14 @@ |
||
287 | 287 | { |
288 | 288 | $address->copyFrom( $value ); |
289 | 289 | $this->basket->setAddress( $address, $type ); |
290 | - } |
|
291 | - else if( is_array( $value ) ) |
|
290 | + } else if( is_array( $value ) ) |
|
292 | 291 | { |
293 | 292 | $this->setAddressFromArray( $address, $value ); |
294 | 293 | $this->basket->setAddress( $address, $type ); |
295 | - } |
|
296 | - else if( $value === null ) |
|
294 | + } else if( $value === null ) |
|
297 | 295 | { |
298 | 296 | $this->basket->deleteAddress( $type ); |
299 | - } |
|
300 | - else |
|
297 | + } else |
|
301 | 298 | { |
302 | 299 | throw new \Aimeos\Controller\Frontend\Basket\Exception( sprintf( 'Invalid value for address type "%1$s"', $type ) ); |
303 | 300 | } |