@@ -60,7 +60,8 @@ discard block |
||
| 60 | 60 | <p class="order-notice"> |
| 61 | 61 | <?= $enc->html( $this->translate( 'client', 'Please enter your payment details' ), $enc::TRUST ) ?> |
| 62 | 62 | </p> |
| 63 | - <?php else : ?> |
|
| 63 | + <?php else { |
|
| 64 | + : ?> |
|
| 64 | 65 | <p class="order-notice"> |
| 65 | 66 | <?= $enc->html( $this->translate( 'client', 'You will now be forwarded to the next step' ), $enc::TRUST ) ?> |
| 66 | 67 | </p> |
@@ -103,7 +104,9 @@ discard block |
||
| 103 | 104 | <?php endforeach ?> |
| 104 | 105 | </select> |
| 105 | 106 | |
| 106 | - <?php break; case 'container': ?> |
|
| 107 | + <?php break; |
|
| 108 | +} |
|
| 109 | +case 'container': ?> |
|
| 107 | 110 | <div id="process-<?= $key ?>"></div> |
| 108 | 111 | |
| 109 | 112 | <?php break; case 'boolean': ?> |
@@ -95,8 +95,7 @@ |
||
| 95 | 95 | $textStock[$level], |
| 96 | 96 | date_create( $date )->format( $dateFormat ) |
| 97 | 97 | ); |
| 98 | - } |
|
| 99 | - else |
|
| 98 | + } else |
|
| 100 | 99 | { |
| 101 | 100 | $text = sprintf( $textStockIn, |
| 102 | 101 | $typeText[$stockType], |
@@ -37,14 +37,17 @@ |
||
| 37 | 37 | <span class="name"> |
| 38 | 38 | <?php if( $attribute->getName() != '' ) : ?> |
| 39 | 39 | <?= $enc->html( $attribute->getName() ) ?> |
| 40 | - <?php else : ?> |
|
| 40 | + <?php else { |
|
| 41 | + : ?> |
|
| 41 | 42 | <?= $enc->html( $this->translate( 'client/code', $attribute->getCode() ) ) ?> |
| 42 | 43 | <?php endif ?> |
| 43 | 44 | </span> |
| 44 | 45 | |
| 45 | 46 | <?php switch( $attribute->getValue() ) : case 'array': case 'object': ?> |
| 46 | 47 | <span class="value"><?= $enc->html( join( ', ', (array) $attribute->getValue() ) ) ?></span> |
| 47 | - <?php break; default: ?> |
|
| 48 | + <?php break; |
|
| 49 | +} |
|
| 50 | +default: ?> |
|
| 48 | 51 | <span class="value"><?= $enc->html( $attribute->getValue() ) ?></span> |
| 49 | 52 | <?php endswitch ?> |
| 50 | 53 | |
@@ -145,8 +145,7 @@ discard block |
||
| 145 | 145 | |
| 146 | 146 | $html = $view->render( $view->config( $tplconf, $default ) ); |
| 147 | 147 | $this->setBasketCached( $key, $html ); |
| 148 | - } |
|
| 149 | - else |
|
| 148 | + } else |
|
| 150 | 149 | { |
| 151 | 150 | $html = $this->modify( $html, $uid ); |
| 152 | 151 | } |
@@ -215,8 +214,7 @@ discard block |
||
| 215 | 214 | { |
| 216 | 215 | $this->logException( $e ); |
| 217 | 216 | } |
| 218 | - } |
|
| 219 | - else |
|
| 217 | + } else |
|
| 220 | 218 | { |
| 221 | 219 | $html = $this->modify( $html, $uid ); |
| 222 | 220 | } |
@@ -320,13 +320,11 @@ |
||
| 320 | 320 | { |
| 321 | 321 | $item = $item->set( 'checked', true ); |
| 322 | 322 | unset( $attrparams['f_attrid'][$key] ); |
| 323 | - } |
|
| 324 | - elseif( ( $key = array_search( $id, $optIds ) ) !== false ) |
|
| 323 | + } elseif( ( $key = array_search( $id, $optIds ) ) !== false ) |
|
| 325 | 324 | { |
| 326 | 325 | $item = $item->set( 'checked', true ); |
| 327 | 326 | unset( $attrparams['f_optid'][$key] ); |
| 328 | - } |
|
| 329 | - elseif( isset( $oneIds[$type] ) && ( $key = array_search( $id, (array) $oneIds[$type] ) ) !== false ) |
|
| 327 | + } elseif( isset( $oneIds[$type] ) && ( $key = array_search( $id, (array) $oneIds[$type] ) ) !== false ) |
|
| 330 | 328 | { |
| 331 | 329 | $item = $item->set( 'checked', true ); |
| 332 | 330 | unset( $attrparams['f_oneid'][$key] ); |
@@ -249,13 +249,11 @@ |
||
| 249 | 249 | $response->withHeader( 'Expires', '0' ); |
| 250 | 250 | |
| 251 | 251 | $response->withBody( $response->createStream( $fs->reads( $value ) ) ); |
| 252 | - } |
|
| 253 | - elseif( filter_var( $value, FILTER_VALIDATE_URL ) !== false ) |
|
| 252 | + } elseif( filter_var( $value, FILTER_VALIDATE_URL ) !== false ) |
|
| 254 | 253 | { |
| 255 | 254 | $response->withHeader( 'Location', $value ); |
| 256 | 255 | $response->withStatus( 303 ); |
| 257 | - } |
|
| 258 | - else |
|
| 256 | + } else |
|
| 259 | 257 | { |
| 260 | 258 | $response->withStatus( 404 ); |
| 261 | 259 | } |
@@ -221,9 +221,12 @@ |
||
| 221 | 221 | $context = $this->context(); |
| 222 | 222 | $cntl = \Aimeos\Controller\Frontend::create( $context, 'customer' ); |
| 223 | 223 | |
| 224 | - try { |
|
| 224 | + try |
|
| 225 | + { |
|
| 225 | 226 | $id = $cntl->find( $addr->getEmail() )->getId(); |
| 226 | - } catch( \Exception $e ) { |
|
| 227 | + } |
|
| 228 | + catch( \Exception $e ) |
|
| 229 | + { |
|
| 227 | 230 | $id = $new ? $cntl->add( $addr->toArray() )->store()->get()->getId() : null; |
| 228 | 231 | } |
| 229 | 232 | |
@@ -645,15 +645,16 @@ discard block |
||
| 645 | 645 | $disable = $view->config( 'client/html/checkout/standard/address/billing/disable-new', false ); |
| 646 | 646 | $type = \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT; |
| 647 | 647 | |
| 648 | - if( ( $option = $view->param( 'ca_billingoption', 'null' ) ) === 'null' && $disable === false ) // new address |
|
| 648 | + if( ( $option = $view->param( 'ca_billingoption', 'null' ) ) === 'null' && $disable === false ) { |
|
| 649 | + // new address |
|
| 649 | 650 | { |
| 650 | 651 | $params = $view->param( 'ca_billing', [] ); |
| 652 | + } |
|
| 651 | 653 | |
| 652 | 654 | if( ( $view->addressBillingError = $this->checkFields( $params ) ) !== [] ) { |
| 653 | 655 | throw new \Aimeos\Client\Html\Exception( sprintf( 'At least one billing address part is missing or invalid' ) ); |
| 654 | 656 | } |
| 655 | - } |
|
| 656 | - else // existing address |
|
| 657 | + } else // existing address |
|
| 657 | 658 | { |
| 658 | 659 | $params = $view->param( 'ca_billing_' . $option, [] ) + $view->param( 'ca_extra', [] ); |
| 659 | 660 | |
@@ -797,8 +798,7 @@ discard block |
||
| 797 | 798 | $invalid[$key] = $name; |
| 798 | 799 | unset( $params[$key] ); |
| 799 | 800 | } |
| 800 | - } |
|
| 801 | - else |
|
| 801 | + } else |
|
| 802 | 802 | { |
| 803 | 803 | unset( $params[$key] ); |
| 804 | 804 | } |
@@ -524,19 +524,22 @@ discard block |
||
| 524 | 524 | $disable = $view->config( 'client/html/checkout/standard/address/delivery/disable-new', false ); |
| 525 | 525 | $type = \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_DELIVERY; |
| 526 | 526 | |
| 527 | - if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) === 'null' && $disable === false ) // new address |
|
| 527 | + if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) === 'null' && $disable === false ) { |
|
| 528 | + // new address |
|
| 528 | 529 | { |
| 529 | 530 | $params = $view->param( 'ca_delivery', [] ); |
| 531 | + } |
|
| 530 | 532 | |
| 531 | 533 | if( ( $view->addressDeliveryError = $this->checkFields( $params ) ) !== [] ) { |
| 532 | 534 | throw new \Aimeos\Client\Html\Exception( sprintf( 'At least one delivery address part is missing or invalid' ) ); |
| 533 | 535 | } |
| 534 | 536 | |
| 535 | 537 | $ctrl->addAddress( $type, $params, 0 ); |
| 536 | - } |
|
| 537 | - else if( ( $option = $view->param( 'ca_deliveryoption' ) ) !== 'like' ) // existing address |
|
| 538 | + } else if( ( $option = $view->param( 'ca_deliveryoption' ) ) !== 'like' ) { |
|
| 539 | + // existing address |
|
| 538 | 540 | { |
| 539 | 541 | $params = $view->param( 'ca_delivery_' . $option, [] ); |
| 542 | + } |
|
| 540 | 543 | |
| 541 | 544 | if( !empty( $params ) && ( $view->addressDeliveryError = $this->checkFields( $params ) ) !== [] ) { |
| 542 | 545 | throw new \Aimeos\Client\Html\Exception( sprintf( 'At least one delivery address part is missing or invalid' ) ); |
@@ -549,13 +552,11 @@ discard block |
||
| 549 | 552 | $params = array_replace( $address->toArray(), $params + ['order.base.address.addressid' => $option] ); |
| 550 | 553 | $addr = $ctrl->addAddress( $type, $params, 0 )->get()->getAddress( $type, 0 ); // sanitize address first |
| 551 | 554 | $custCntl->addAddressItem( $address->copyFrom( $addr ), $option )->store(); // update existing address |
| 552 | - } |
|
| 553 | - else |
|
| 555 | + } else |
|
| 554 | 556 | { |
| 555 | 557 | $ctrl->addAddress( $type, $params, 0 ); |
| 556 | 558 | } |
| 557 | - } |
|
| 558 | - else |
|
| 559 | + } else |
|
| 559 | 560 | { |
| 560 | 561 | $ctrl->deleteAddress( $type ); |
| 561 | 562 | } |
@@ -787,8 +788,7 @@ discard block |
||
| 787 | 788 | $invalid[$key] = $name; |
| 788 | 789 | unset( $params[$key] ); |
| 789 | 790 | } |
| 790 | - } |
|
| 791 | - else |
|
| 791 | + } else |
|
| 792 | 792 | { |
| 793 | 793 | unset( $params[$key] ); |
| 794 | 794 | } |