@@ -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 | |
@@ -121,8 +121,7 @@ |
||
| 121 | 121 | } else { |
| 122 | 122 | unset( $items[$id] ); |
| 123 | 123 | } |
| 124 | - } |
|
| 125 | - catch( \Aimeos\MShop\Service\Exception $e ) |
|
| 124 | + } catch( \Aimeos\MShop\Service\Exception $e ) |
|
| 126 | 125 | { |
| 127 | 126 | $msg = sprintf( 'Unable to create provider "%1$s" for service with ID "%2$s"', $service->getCode(), $id ); |
| 128 | 127 | $this->getContext()->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::WARN ); |
@@ -47,8 +47,7 @@ |
||
| 47 | 47 | try |
| 48 | 48 | { |
| 49 | 49 | $item = $manager->findItem( $list['customer.code'] ); |
| 50 | - } |
|
| 51 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 50 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 52 | 51 | { |
| 53 | 52 | $this->checkLimit( $list ); |
| 54 | 53 | |
@@ -180,8 +180,7 @@ discard block |
||
| 180 | 180 | { |
| 181 | 181 | $search = $manager->createSearch(); |
| 182 | 182 | $search->setConditions( $search->compare( '>', 'product.status', 0 ) ); |
| 183 | - } |
|
| 184 | - else |
|
| 183 | + } else |
|
| 185 | 184 | { |
| 186 | 185 | $search = $manager->createSearch( true ); |
| 187 | 186 | } |
@@ -275,8 +274,7 @@ discard block |
||
| 275 | 274 | { |
| 276 | 275 | $search = $manager->createSearch(); |
| 277 | 276 | $search->setConditions( $search->compare( '>', 'product.status', 0 ) ); |
| 278 | - } |
|
| 279 | - else |
|
| 277 | + } else |
|
| 280 | 278 | { |
| 281 | 279 | $search = $manager->createSearch( true ); |
| 282 | 280 | } |
@@ -431,17 +431,14 @@ |
||
| 431 | 431 | { |
| 432 | 432 | $address->copyFrom( $value ); |
| 433 | 433 | $this->get()->setAddress( $address, $type ); |
| 434 | - } |
|
| 435 | - else if( is_array( $value ) ) |
|
| 434 | + } else if( is_array( $value ) ) |
|
| 436 | 435 | { |
| 437 | 436 | $this->setAddressFromArray( $address, $value ); |
| 438 | 437 | $this->get()->setAddress( $address, $type ); |
| 439 | - } |
|
| 440 | - else if( $value === null ) |
|
| 438 | + } else if( $value === null ) |
|
| 441 | 439 | { |
| 442 | 440 | $this->get()->deleteAddress( $type ); |
| 443 | - } |
|
| 444 | - else |
|
| 441 | + } else |
|
| 445 | 442 | { |
| 446 | 443 | $msg = $context->getI18n()->dt( 'controller/frontend', 'Invalid value for address type "%1$s"' ); |
| 447 | 444 | throw new \Aimeos\Controller\Frontend\Basket\Exception( sprintf( $msg, $type ) ); |
@@ -225,8 +225,7 @@ discard block |
||
| 225 | 225 | { |
| 226 | 226 | $this->setAddress( $type, $item->toArray() ); |
| 227 | 227 | $basket->deleteAddress( $type ); |
| 228 | - } |
|
| 229 | - catch( \Exception $e ) |
|
| 228 | + } catch( \Exception $e ) |
|
| 230 | 229 | { |
| 231 | 230 | $logger = $this->getContext()->getLogger(); |
| 232 | 231 | $str = 'Error migrating address with type "%1$s" in basket to locale "%2$s": %3$s'; |
@@ -255,8 +254,7 @@ discard block |
||
| 255 | 254 | { |
| 256 | 255 | $this->addCoupon( $code ); |
| 257 | 256 | $basket->deleteCoupon( $code, true ); |
| 258 | - } |
|
| 259 | - catch( \Exception $e ) |
|
| 257 | + } catch( \Exception $e ) |
|
| 260 | 258 | { |
| 261 | 259 | $logger = $this->getContext()->getLogger(); |
| 262 | 260 | $str = 'Error migrating coupon with code "%1$s" in basket to locale "%2$s": %3$s'; |
@@ -305,8 +303,7 @@ discard block |
||
| 305 | 303 | ); |
| 306 | 304 | |
| 307 | 305 | $basket->deleteProduct( $pos ); |
| 308 | - } |
|
| 309 | - catch( \Exception $e ) |
|
| 306 | + } catch( \Exception $e ) |
|
| 310 | 307 | { |
| 311 | 308 | $code = $product->getProductCode(); |
| 312 | 309 | $logger = $this->getContext()->getLogger(); |
@@ -344,8 +341,7 @@ discard block |
||
| 344 | 341 | |
| 345 | 342 | $this->addService( $type, $item->getServiceId(), $attributes ); |
| 346 | 343 | $basket->deleteService( $type ); |
| 347 | - } |
|
| 348 | - catch( \Exception $e ) { ; } // Don't notify the user as appropriate services can be added automatically |
|
| 344 | + } catch( \Exception $e ) { ; } // Don't notify the user as appropriate services can be added automatically |
|
| 349 | 345 | } |
| 350 | 346 | } |
| 351 | 347 | |