@@ -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 ); |
@@ -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 | |
@@ -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 | } |
@@ -81,23 +81,19 @@ discard block |
||
| 81 | 81 | $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
| 82 | 82 | } |
| 83 | 83 | $view->updateBody = $html; |
| 84 | - } |
|
| 85 | - catch( \Aimeos\Client\Html\Exception $e ) |
|
| 84 | + } catch( \Aimeos\Client\Html\Exception $e ) |
|
| 86 | 85 | { |
| 87 | 86 | $error = array( $this->getContext()->getI18n()->dt( 'client', $e->getMessage() ) ); |
| 88 | 87 | $view->updateErrorList = $view->get( 'updateErrorList', array() ) + $error; |
| 89 | - } |
|
| 90 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 88 | + } catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 91 | 89 | { |
| 92 | 90 | $error = array( $this->getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) ); |
| 93 | 91 | $view->updateErrorList = $view->get( 'updateErrorList', array() ) + $error; |
| 94 | - } |
|
| 95 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 92 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 96 | 93 | { |
| 97 | 94 | $error = array( $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 98 | 95 | $view->updateErrorList = $view->get( 'updateErrorList', array() ) + $error; |
| 99 | - } |
|
| 100 | - catch( \Exception $e ) |
|
| 96 | + } catch( \Exception $e ) |
|
| 101 | 97 | { |
| 102 | 98 | $context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
| 103 | 99 | |
@@ -177,8 +173,7 @@ discard block |
||
| 177 | 173 | $default = 'checkout/update/header-default.php'; |
| 178 | 174 | |
| 179 | 175 | return $view->render( $view->config( $tplconf, $default ) ); |
| 180 | - } |
|
| 181 | - catch( \Exception $e ) |
|
| 176 | + } catch( \Exception $e ) |
|
| 182 | 177 | { |
| 183 | 178 | $this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
| 184 | 179 | } |
@@ -307,8 +302,7 @@ discard block |
||
| 307 | 302 | } |
| 308 | 303 | |
| 309 | 304 | $view->updateMessage = $response; |
| 310 | - } |
|
| 311 | - catch( \Aimeos\MShop\Service\Exception $e ) |
|
| 305 | + } catch( \Aimeos\MShop\Service\Exception $e ) |
|
| 312 | 306 | { |
| 313 | 307 | $view->updateMessage = $e->getMessage(); |
| 314 | 308 | } |
@@ -318,8 +312,7 @@ discard block |
||
| 318 | 312 | } |
| 319 | 313 | |
| 320 | 314 | parent::process(); |
| 321 | - } |
|
| 322 | - catch( \Exception $e ) |
|
| 315 | + } catch( \Exception $e ) |
|
| 323 | 316 | { |
| 324 | 317 | /** client/html/checkout/standard/update/http-error |
| 325 | 318 | * HTTP header sent for failed attempts to update the order status |
@@ -203,8 +203,7 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | parent::process(); |
| 206 | - } |
|
| 207 | - catch( \Exception $e ) |
|
| 206 | + } catch( \Exception $e ) |
|
| 208 | 207 | { |
| 209 | 208 | $context->getLogger()->log( $e->getMessage() ); |
| 210 | 209 | } |
@@ -252,13 +251,11 @@ discard block |
||
| 252 | 251 | $response->withHeader( 'Expires', '0' ); |
| 253 | 252 | |
| 254 | 253 | $response->withBody( $response->createStream( $fs->reads( $value ) ) ); |
| 255 | - } |
|
| 256 | - elseif( filter_var( $value, FILTER_VALIDATE_URL ) !== false ) |
|
| 254 | + } elseif( filter_var( $value, FILTER_VALIDATE_URL ) !== false ) |
|
| 257 | 255 | { |
| 258 | 256 | $response->withHeader( 'Location', $value ); |
| 259 | 257 | $response->withStatus( 303 ); |
| 260 | - } |
|
| 261 | - else |
|
| 258 | + } else |
|
| 262 | 259 | { |
| 263 | 260 | $response->withStatus( 404 ); |
| 264 | 261 | } |
@@ -82,23 +82,19 @@ discard block |
||
| 82 | 82 | $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
| 83 | 83 | } |
| 84 | 84 | $view->watchBody = $html; |
| 85 | - } |
|
| 86 | - catch( \Aimeos\Client\Html\Exception $e ) |
|
| 85 | + } catch( \Aimeos\Client\Html\Exception $e ) |
|
| 87 | 86 | { |
| 88 | 87 | $error = array( $this->getContext()->getI18n()->dt( 'client', $e->getMessage() ) ); |
| 89 | 88 | $view->watchErrorList = $view->get( 'watchErrorList', array() ) + $error; |
| 90 | - } |
|
| 91 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 89 | + } catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 92 | 90 | { |
| 93 | 91 | $error = array( $this->getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) ); |
| 94 | 92 | $view->watchErrorList = $view->get( 'watchErrorList', array() ) + $error; |
| 95 | - } |
|
| 96 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 93 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 97 | 94 | { |
| 98 | 95 | $error = array( $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 99 | 96 | $view->watchErrorList = $view->get( 'watchErrorList', array() ) + $error; |
| 100 | - } |
|
| 101 | - catch( \Exception $e ) |
|
| 97 | + } catch( \Exception $e ) |
|
| 102 | 98 | { |
| 103 | 99 | $context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
| 104 | 100 | |
@@ -178,8 +174,7 @@ discard block |
||
| 178 | 174 | $default = 'account/watch/header-default.php'; |
| 179 | 175 | |
| 180 | 176 | return $view->render( $view->config( $tplconf, $default ) ); |
| 181 | - } |
|
| 182 | - catch( \Exception $e ) |
|
| 177 | + } catch( \Exception $e ) |
|
| 183 | 178 | { |
| 184 | 179 | $this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
| 185 | 180 | } |
@@ -27,8 +27,7 @@ discard block |
||
| 27 | 27 | $priceRebate = $price->getRebate(); |
| 28 | 28 | $priceTaxflag = $price->getTaxFlag(); |
| 29 | 29 | $priceCurrency = $this->translate( 'client/currency', $price->getCurrencyId() ); |
| 30 | -} |
|
| 31 | -catch( Exception $e ) |
|
| 30 | +} catch( Exception $e ) |
|
| 32 | 31 | { |
| 33 | 32 | $priceValue = '0.00'; |
| 34 | 33 | $priceRebate = '0.00'; |
@@ -42,8 +41,7 @@ discard block |
||
| 42 | 41 | $deliveryPriceItem = $this->extOrderBaseItem->getService( 'delivery' )->getPrice(); |
| 43 | 42 | $deliveryPriceService = $deliveryPriceItem->getCosts(); |
| 44 | 43 | $deliveryPriceValue = $deliveryPriceItem->getValue(); |
| 45 | -} |
|
| 46 | -catch( Exception $e ) |
|
| 44 | +} catch( Exception $e ) |
|
| 47 | 45 | { |
| 48 | 46 | $deliveryPriceValue = '0.00'; |
| 49 | 47 | $deliveryPriceService = '0.00'; |
@@ -54,8 +52,7 @@ discard block |
||
| 54 | 52 | $paymentPriceItem = $this->extOrderBaseItem->getService( 'payment' )->getPrice(); |
| 55 | 53 | $paymentPriceService = $paymentPriceItem->getCosts(); |
| 56 | 54 | $paymentPriceValue = $paymentPriceItem->getValue(); |
| 57 | -} |
|
| 58 | -catch( Exception $e ) |
|
| 55 | +} catch( Exception $e ) |
|
| 59 | 56 | { |
| 60 | 57 | $paymentPriceValue = '0.00'; |
| 61 | 58 | $paymentPriceService = '0.00'; |