@@ -266,8 +266,7 @@ |
||
| 266 | 266 | $addr->setAddressId( $item->getId() ); |
| 267 | 267 | $orderAddrManager->saveItem( $addr, false ); |
| 268 | 268 | } |
| 269 | - } |
|
| 270 | - catch( \Exception $e ) |
|
| 269 | + } catch( \Exception $e ) |
|
| 271 | 270 | { |
| 272 | 271 | $msg = sprintf( 'Unable to save address for customer "%1$s": %2$s', $customerId, $e->getMessage() ); |
| 273 | 272 | $this->getContext()->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::INFO ); |
@@ -278,8 +278,7 @@ |
||
| 278 | 278 | |
| 279 | 279 | $orderBaseManager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' ); |
| 280 | 280 | $orderBaseManager->saveItem( $basket, false ); |
| 281 | - } |
|
| 282 | - catch( \Exception $e ) |
|
| 281 | + } catch( \Exception $e ) |
|
| 283 | 282 | { |
| 284 | 283 | $msg = sprintf( 'Unable to create an account for "%1$s": %2$s', $email, $e->getMessage() ); |
| 285 | 284 | $context->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::INFO ); |
@@ -331,8 +331,7 @@ |
||
| 331 | 331 | $controller->get()->check( \Aimeos\MShop\Order\Item\Base\Base::PARTS_ALL ); |
| 332 | 332 | |
| 333 | 333 | parent::process(); |
| 334 | - } |
|
| 335 | - catch( \Exception $e ) |
|
| 334 | + } catch( \Exception $e ) |
|
| 336 | 335 | { |
| 337 | 336 | $view->standardStepActive = 'summary'; |
| 338 | 337 | throw $e; |
@@ -148,23 +148,19 @@ discard block |
||
| 148 | 148 | $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
| 149 | 149 | } |
| 150 | 150 | $view->standardBody = $html; |
| 151 | - } |
|
| 152 | - catch( \Aimeos\Client\Html\Exception $e ) |
|
| 151 | + } catch( \Aimeos\Client\Html\Exception $e ) |
|
| 153 | 152 | { |
| 154 | 153 | $error = array( $this->getContext()->getI18n()->dt( 'client', $e->getMessage() ) ); |
| 155 | 154 | $view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error; |
| 156 | - } |
|
| 157 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 155 | + } catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 158 | 156 | { |
| 159 | 157 | $error = array( $this->getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) ); |
| 160 | 158 | $view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error; |
| 161 | - } |
|
| 162 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 159 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 163 | 160 | { |
| 164 | 161 | $error = array( $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 165 | 162 | $view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error; |
| 166 | - } |
|
| 167 | - catch( \Exception $e ) |
|
| 163 | + } catch( \Exception $e ) |
|
| 168 | 164 | { |
| 169 | 165 | $context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
| 170 | 166 | |
@@ -244,8 +240,7 @@ discard block |
||
| 244 | 240 | $default = 'checkout/standard/header-default.php'; |
| 245 | 241 | |
| 246 | 242 | return $view->render( $view->config( $tplconf, $default ) ); |
| 247 | - } |
|
| 248 | - catch( \Exception $e ) |
|
| 243 | + } catch( \Exception $e ) |
|
| 249 | 244 | { |
| 250 | 245 | $this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
| 251 | 246 | } |
@@ -352,31 +347,26 @@ discard block |
||
| 352 | 347 | try |
| 353 | 348 | { |
| 354 | 349 | parent::process(); |
| 355 | - } |
|
| 356 | - catch( \Aimeos\Client\Html\Exception $e ) |
|
| 350 | + } catch( \Aimeos\Client\Html\Exception $e ) |
|
| 357 | 351 | { |
| 358 | 352 | $error = array( $this->getContext()->getI18n()->dt( 'client', $e->getMessage() ) ); |
| 359 | 353 | $view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error; |
| 360 | - } |
|
| 361 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 354 | + } catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 362 | 355 | { |
| 363 | 356 | $error = array( $this->getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) ); |
| 364 | 357 | $view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error; |
| 365 | - } |
|
| 366 | - catch( \Aimeos\MShop\Plugin\Provider\Exception $e ) |
|
| 358 | + } catch( \Aimeos\MShop\Plugin\Provider\Exception $e ) |
|
| 367 | 359 | { |
| 368 | 360 | $errors = array( $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 369 | 361 | $errors = array_merge( $errors, $this->translatePluginErrorCodes( $e->getErrorCodes() ) ); |
| 370 | 362 | |
| 371 | 363 | $view->summaryErrorCodes = $e->getErrorCodes(); |
| 372 | 364 | $view->standardErrorList = $view->get( 'standardErrorList', array() ) + $errors; |
| 373 | - } |
|
| 374 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 365 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 375 | 366 | { |
| 376 | 367 | $error = array( $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 377 | 368 | $view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error; |
| 378 | - } |
|
| 379 | - catch( \Exception $e ) |
|
| 369 | + } catch( \Exception $e ) |
|
| 380 | 370 | { |
| 381 | 371 | $context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
| 382 | 372 | |
@@ -307,8 +307,7 @@ |
||
| 307 | 307 | $view->standardStepActive = 'delivery'; |
| 308 | 308 | return false; |
| 309 | 309 | } |
| 310 | - } |
|
| 311 | - catch( \Exception $e ) |
|
| 310 | + } catch( \Exception $e ) |
|
| 312 | 311 | { |
| 313 | 312 | $view->standardStepActive = 'delivery'; |
| 314 | 313 | throw $e; |
@@ -307,8 +307,7 @@ |
||
| 307 | 307 | $view->standardStepActive = 'payment'; |
| 308 | 308 | return false; |
| 309 | 309 | } |
| 310 | - } |
|
| 311 | - catch( \Exception $e ) |
|
| 310 | + } catch( \Exception $e ) |
|
| 312 | 311 | { |
| 313 | 312 | $view->standardStepActive = 'payment'; |
| 314 | 313 | throw $e; |
@@ -297,9 +297,11 @@ discard block |
||
| 297 | 297 | $disable = $view->config( 'client/html/checkout/standard/address/billing/disable-new', false ); |
| 298 | 298 | $type = \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT; |
| 299 | 299 | |
| 300 | - if( ( $option = $view->param( 'ca_billingoption', 'null' ) ) === 'null' && $disable === false ) // new address |
|
| 300 | + if( ( $option = $view->param( 'ca_billingoption', 'null' ) ) === 'null' && $disable === false ) { |
|
| 301 | + // new address |
|
| 301 | 302 | { |
| 302 | 303 | $params = $view->param( 'ca_billing', array() ); |
| 304 | + } |
|
| 303 | 305 | $invalid = $this->checkFields( $params ); |
| 304 | 306 | |
| 305 | 307 | if( count( $invalid ) > 0 ) |
@@ -309,8 +311,7 @@ discard block |
||
| 309 | 311 | } |
| 310 | 312 | |
| 311 | 313 | $basketCtrl->setAddress( $type, $params ); |
| 312 | - } |
|
| 313 | - else // existing address |
|
| 314 | + } else // existing address |
|
| 314 | 315 | { |
| 315 | 316 | $customerManager = \Aimeos\MShop\Factory::createManager( $context, 'customer' ); |
| 316 | 317 | |
@@ -356,8 +357,7 @@ discard block |
||
| 356 | 357 | } |
| 357 | 358 | |
| 358 | 359 | parent::process(); |
| 359 | - } |
|
| 360 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 360 | + } catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 361 | 361 | { |
| 362 | 362 | $view->billingError = $e->getErrorList(); |
| 363 | 363 | throw $e; |
@@ -630,8 +630,7 @@ discard block |
||
| 630 | 630 | $invalid[$key] = sprintf( $msg, $name ); |
| 631 | 631 | unset( $params[$key] ); |
| 632 | 632 | } |
| 633 | - } |
|
| 634 | - else |
|
| 633 | + } else |
|
| 635 | 634 | { |
| 636 | 635 | unset( $params[$key] ); |
| 637 | 636 | } |
@@ -303,8 +303,7 @@ |
||
| 303 | 303 | $view->standardStepActive = 'address'; |
| 304 | 304 | return false; |
| 305 | 305 | } |
| 306 | - } |
|
| 307 | - catch( \Exception $e ) |
|
| 306 | + } catch( \Exception $e ) |
|
| 308 | 307 | { |
| 309 | 308 | $this->getView()->standardStepActive = 'address'; |
| 310 | 309 | throw $e; |
@@ -307,9 +307,11 @@ discard block |
||
| 307 | 307 | $disable = $view->config( 'client/html/checkout/standard/address/delivery/disable-new', false ); |
| 308 | 308 | $type = \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_DELIVERY; |
| 309 | 309 | |
| 310 | - if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) === 'null' && $disable === false ) // new address |
|
| 310 | + if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) === 'null' && $disable === false ) { |
|
| 311 | + // new address |
|
| 311 | 312 | { |
| 312 | 313 | $params = $view->param( 'ca_delivery', array() ); |
| 314 | + } |
|
| 313 | 315 | $invalid = $this->checkFields( $params ); |
| 314 | 316 | |
| 315 | 317 | if( count( $invalid ) > 0 ) |
@@ -319,10 +321,11 @@ discard block |
||
| 319 | 321 | } |
| 320 | 322 | |
| 321 | 323 | $basketCtrl->setAddress( $type, $params ); |
| 322 | - } |
|
| 323 | - else if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) !== '-1' ) // existing address |
|
| 324 | + } else if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) !== '-1' ) { |
|
| 325 | + // existing address |
|
| 324 | 326 | { |
| 325 | 327 | $customerAddressManager = \Aimeos\MShop\Factory::createManager( $context, 'customer/address' ); |
| 328 | + } |
|
| 326 | 329 | $address = $customerAddressManager->getItem( $option ); |
| 327 | 330 | |
| 328 | 331 | if( $address->getParentId() != $context->getUserId() ) { |
@@ -352,15 +355,13 @@ discard block |
||
| 352 | 355 | } |
| 353 | 356 | |
| 354 | 357 | $basketCtrl->setAddress( $type, $address ); |
| 355 | - } |
|
| 356 | - else |
|
| 358 | + } else |
|
| 357 | 359 | { |
| 358 | 360 | $basketCtrl->setAddress( $type, null ); |
| 359 | 361 | } |
| 360 | 362 | |
| 361 | 363 | parent::process(); |
| 362 | - } |
|
| 363 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 364 | + } catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 364 | 365 | { |
| 365 | 366 | $view->deliveryError = $e->getErrorList(); |
| 366 | 367 | throw $e; |
@@ -480,8 +481,7 @@ discard block |
||
| 480 | 481 | $invalid[$key] = sprintf( $msg, $name ); |
| 481 | 482 | unset( $params[$key] ); |
| 482 | 483 | } |
| 483 | - } |
|
| 484 | - else |
|
| 484 | + } else |
|
| 485 | 485 | { |
| 486 | 486 | unset( $params[$key] ); |
| 487 | 487 | } |