@@ -522,12 +522,10 @@ |
||
| 522 | 522 | { |
| 523 | 523 | throw new \Aimeos\Client\Html\Exception( $e->getMessage() ); |
| 524 | 524 | } |
| 525 | - } |
|
| 526 | - else if( function_exists( 'mime_content_type' ) ) |
|
| 525 | + } else if( function_exists( 'mime_content_type' ) ) |
|
| 527 | 526 | { |
| 528 | 527 | $mimetype = mime_content_type( $filename ); |
| 529 | - } |
|
| 530 | - else |
|
| 528 | + } else |
|
| 531 | 529 | { |
| 532 | 530 | $mimetype = 'application/binary'; |
| 533 | 531 | } |
@@ -457,12 +457,10 @@ |
||
| 457 | 457 | { |
| 458 | 458 | throw new \Aimeos\Client\Html\Exception( $e->getMessage() ); |
| 459 | 459 | } |
| 460 | - } |
|
| 461 | - else if( function_exists( 'mime_content_type' ) ) |
|
| 460 | + } else if( function_exists( 'mime_content_type' ) ) |
|
| 462 | 461 | { |
| 463 | 462 | $mimetype = mime_content_type( $filename ); |
| 464 | - } |
|
| 465 | - else |
|
| 463 | + } else |
|
| 466 | 464 | { |
| 467 | 465 | $mimetype = 'application/binary'; |
| 468 | 466 | } |
@@ -301,7 +301,9 @@ |
||
| 301 | 301 | $controller = \Aimeos\Controller\Frontend::create( $context, 'customer' ); |
| 302 | 302 | $view->summaryCustomerId = $controller->findItem( $addr->getEmail() )->getId(); |
| 303 | 303 | } |
| 304 | - catch( \Exception $e ) {} |
|
| 304 | + catch( \Exception $e ) |
|
| 305 | + { |
|
| 306 | +} |
|
| 305 | 307 | } |
| 306 | 308 | |
| 307 | 309 | $view->summaryTaxRates = $this->getTaxRates( $view->standardBasket ); |
@@ -249,8 +249,7 @@ |
||
| 249 | 249 | { |
| 250 | 250 | $view->standardErrorList = $view->get( 'standardErrorList', [] ) + $errors; |
| 251 | 251 | throw new \Aimeos\Client\Html\Exception( sprintf( 'Please recheck your delivery choice' ) ); |
| 252 | - } |
|
| 253 | - else |
|
| 252 | + } else |
|
| 254 | 253 | { |
| 255 | 254 | $basketCtrl->addService( 'delivery', $serviceId, $attributes ); |
| 256 | 255 | } |
@@ -249,8 +249,7 @@ |
||
| 249 | 249 | { |
| 250 | 250 | $view->standardErrorList = $view->get( 'standardErrorList', [] ) + $errors; |
| 251 | 251 | throw new \Aimeos\Client\Html\Exception( sprintf( 'Please recheck your payment choice' ) ); |
| 252 | - } |
|
| 253 | - else |
|
| 252 | + } else |
|
| 254 | 253 | { |
| 255 | 254 | $basketCtrl->addService( 'payment', $serviceId, $attributes ); |
| 256 | 255 | } |
@@ -463,9 +463,11 @@ discard block |
||
| 463 | 463 | $disable = $view->config( 'client/html/checkout/standard/address/delivery/disable-new', false ); |
| 464 | 464 | $type = \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_DELIVERY; |
| 465 | 465 | |
| 466 | - if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) === 'null' && $disable === false ) // new address |
|
| 466 | + if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) === 'null' && $disable === false ) { |
|
| 467 | + // new address |
|
| 467 | 468 | { |
| 468 | 469 | $params = $view->param( 'ca_delivery', [] ); |
| 470 | + } |
|
| 469 | 471 | $invalid = $this->checkFields( $params ); |
| 470 | 472 | |
| 471 | 473 | if( count( $invalid ) > 0 ) |
@@ -475,10 +477,11 @@ discard block |
||
| 475 | 477 | } |
| 476 | 478 | |
| 477 | 479 | $basketCtrl->setAddress( $type, $params ); |
| 478 | - } |
|
| 479 | - else if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) !== '-1' ) // existing address |
|
| 480 | + } else if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) !== '-1' ) { |
|
| 481 | + // existing address |
|
| 480 | 482 | { |
| 481 | 483 | $list = []; |
| 484 | + } |
|
| 482 | 485 | $params = $view->param( 'ca_delivery_' . $option, [] ); |
| 483 | 486 | |
| 484 | 487 | if( !empty( $params ) && ( $invalid = $this->checkFields( $params ) ) !== [] ) |
@@ -495,8 +498,7 @@ discard block |
||
| 495 | 498 | $address = $controller->editAddressItem( $option, $list ); |
| 496 | 499 | |
| 497 | 500 | $basketCtrl->setAddress( $type, $address ); |
| 498 | - } |
|
| 499 | - else |
|
| 501 | + } else |
|
| 500 | 502 | { |
| 501 | 503 | $basketCtrl->setAddress( $type, null ); |
| 502 | 504 | } |
@@ -516,9 +518,12 @@ discard block |
||
| 516 | 518 | $context = $this->getContext(); |
| 517 | 519 | $basketCntl = \Aimeos\Controller\Frontend::create( $context, 'basket' ); |
| 518 | 520 | |
| 519 | - try { |
|
| 521 | + try |
|
| 522 | + { |
|
| 520 | 523 | $langid = $basketCntl->get()->getAddress( 'delivery' )->getLanguageId(); |
| 521 | - } catch( \Exception $e ) { |
|
| 524 | + } |
|
| 525 | + catch( \Exception $e ) |
|
| 526 | + { |
|
| 522 | 527 | $langid = $view->param( 'ca_delivery/order.base.address.languageid', $context->getLocale()->getLanguageId() ); |
| 523 | 528 | } |
| 524 | 529 | $view->deliveryLanguage = $langid; |
@@ -697,8 +702,7 @@ discard block |
||
| 697 | 702 | $invalid[$key] = $name; |
| 698 | 703 | unset( $params[$key] ); |
| 699 | 704 | } |
| 700 | - } |
|
| 701 | - else |
|
| 705 | + } else |
|
| 702 | 706 | { |
| 703 | 707 | unset( $params[$key] ); |
| 704 | 708 | } |
@@ -319,7 +319,9 @@ |
||
| 319 | 319 | $view->addressPaymentItem = $paymentAddressItem; |
| 320 | 320 | $view->addressDeliveryItems = $deliveryAddressItems; |
| 321 | 321 | } |
| 322 | - catch( \Exception $e ) {} // customer has no account yet |
|
| 322 | + catch( \Exception $e ) |
|
| 323 | + { |
|
| 324 | +} // customer has no account yet |
|
| 323 | 325 | |
| 324 | 326 | |
| 325 | 327 | $localeManager = \Aimeos\MShop::create( $context, 'locale' ); |
@@ -540,9 +540,11 @@ discard block |
||
| 540 | 540 | $disable = $view->config( 'client/html/checkout/standard/address/billing/disable-new', false ); |
| 541 | 541 | $type = \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT; |
| 542 | 542 | |
| 543 | - if( ( $option = $view->param( 'ca_billingoption', 'null' ) ) === 'null' && $disable === false ) // new address |
|
| 543 | + if( ( $option = $view->param( 'ca_billingoption', 'null' ) ) === 'null' && $disable === false ) { |
|
| 544 | + // new address |
|
| 544 | 545 | { |
| 545 | 546 | $params = $view->param( 'ca_billing', [] ); |
| 547 | + } |
|
| 546 | 548 | |
| 547 | 549 | if( ( $invalid = $this->checkFields( $params ) ) !== [] ) |
| 548 | 550 | { |
@@ -551,8 +553,7 @@ discard block |
||
| 551 | 553 | } |
| 552 | 554 | |
| 553 | 555 | $basketCtrl->setAddress( $type, $params ); |
| 554 | - } |
|
| 555 | - else // existing address |
|
| 556 | + } else // existing address |
|
| 556 | 557 | { |
| 557 | 558 | $list = []; |
| 558 | 559 | $params = $view->param( 'ca_billing_' . $option, [] ); |
@@ -588,9 +589,12 @@ discard block |
||
| 588 | 589 | $context = $this->getContext(); |
| 589 | 590 | $basketCntl = \Aimeos\Controller\Frontend::create( $context, 'basket' ); |
| 590 | 591 | |
| 591 | - try { |
|
| 592 | + try |
|
| 593 | + { |
|
| 592 | 594 | $langid = $basketCntl->get()->getAddress( 'payment' )->getLanguageId(); |
| 593 | - } catch( \Exception $e ) { |
|
| 595 | + } |
|
| 596 | + catch( \Exception $e ) |
|
| 597 | + { |
|
| 594 | 598 | $langid = $view->param( 'ca_billing/order.base.address.languageid', $context->getLocale()->getLanguageId() ); |
| 595 | 599 | } |
| 596 | 600 | $view->billingLanguage = $langid; |
@@ -769,8 +773,7 @@ discard block |
||
| 769 | 773 | $invalid[$key] = $name; |
| 770 | 774 | unset( $params[$key] ); |
| 771 | 775 | } |
| 772 | - } |
|
| 773 | - else |
|
| 776 | + } else |
|
| 774 | 777 | { |
| 775 | 778 | unset( $params[$key] ); |
| 776 | 779 | } |
@@ -268,14 +268,12 @@ discard block |
||
| 268 | 268 | $orderCntl->block( $orderItem ); |
| 269 | 269 | |
| 270 | 270 | $context->getSession()->set( 'aimeos/orderid', $orderItem->getId() ); |
| 271 | - } |
|
| 272 | - elseif ( $view->param( 'cp_payment', null ) !== null ) |
|
| 271 | + } elseif ( $view->param( 'cp_payment', null ) !== null ) |
|
| 273 | 272 | { |
| 274 | 273 | $parts = \Aimeos\MShop\Order\Item\Base\Base::PARTS_ALL; |
| 275 | 274 | $orderItem = $orderCntl->getItem( $context->getSession()->get( 'aimeos/orderid' ) ); |
| 276 | 275 | $basket = $basketCntl->load( $orderItem->getBaseId(), $parts, false ); |
| 277 | - } |
|
| 278 | - else |
|
| 276 | + } else |
|
| 279 | 277 | { |
| 280 | 278 | return; |
| 281 | 279 | } |
@@ -289,8 +287,7 @@ discard block |
||
| 289 | 287 | $orderCntl = \Aimeos\Controller\Frontend::create( $context, 'order' ); |
| 290 | 288 | $orderCntl->saveItem( $orderItem ); |
| 291 | 289 | |
| 292 | - } |
|
| 293 | - elseif( ( $form = $this->processPayment( $basket, $orderItem ) ) !== null ) |
|
| 290 | + } elseif( ( $form = $this->processPayment( $basket, $orderItem ) ) !== null ) |
|
| 294 | 291 | { |
| 295 | 292 | $view->standardUrlNext = $form->getUrl(); |
| 296 | 293 | $view->standardMethod = $form->getMethod(); |