@@ -267,14 +267,12 @@ discard block |
||
| 267 | 267 | $orderItem = $orderCntl->add( $basket->getId(), ['order.type' => 'web'] )->store(); |
| 268 | 268 | |
| 269 | 269 | $context->getSession()->set( 'aimeos/orderid', $orderItem->getId() ); |
| 270 | - } |
|
| 271 | - elseif( $view->param( 'cp_payment', null ) !== null ) |
|
| 270 | + } elseif( $view->param( 'cp_payment', null ) !== null ) |
|
| 272 | 271 | { |
| 273 | 272 | $parts = \Aimeos\MShop\Order\Item\Base\Base::PARTS_ALL; |
| 274 | 273 | $orderItem = $orderCntl->get( $context->getSession()->get( 'aimeos/orderid' ), false ); |
| 275 | 274 | $basket = $basketCntl->load( $orderItem->getBaseId(), $parts, false ); |
| 276 | - } |
|
| 277 | - else |
|
| 275 | + } else |
|
| 278 | 276 | { |
| 279 | 277 | return; |
| 280 | 278 | } |
@@ -286,8 +284,7 @@ discard block |
||
| 286 | 284 | $view->standardProcessParams = $form->getValues(); |
| 287 | 285 | $view->standardUrlExternal = $form->getExternal(); |
| 288 | 286 | $view->standardHtml = $form->getHtml(); |
| 289 | - } |
|
| 290 | - else // no payment service available |
|
| 287 | + } else // no payment service available |
|
| 291 | 288 | { |
| 292 | 289 | $orderCntl->save( $orderItem->setPaymentStatus( \Aimeos\MShop\Order\Item\Base::PAY_AUTHORIZED ) ); |
| 293 | 290 | $view->standardUrlNext = $this->getUrlConfirm( $view, [], [] ); |
@@ -122,10 +122,13 @@ |
||
| 122 | 122 | href="<?= $enc->attr( $this->url( $checkoutTarget, $checkoutController, $checkoutAction, [], [], $checkoutConfig ) ); ?>"> |
| 123 | 123 | <?= $enc->html( $this->translate( 'client', 'Checkout' ), $enc::TRUST ); ?> |
| 124 | 124 | </a> |
| 125 | - <?php else : ?> |
|
| 125 | + <?php else { |
|
| 126 | + : ?> |
|
| 126 | 127 | <input type="hidden" name="<?= $enc->attr( $this->formparam( 'b_action' ) ) ?>" value="1" /> |
| 127 | 128 | <button class="btn btn-primary btn-lg btn-action" type="submit"> |
| 128 | - <?= $enc->html( $this->translate( 'client', 'Check' ), $enc::TRUST ); ?> |
|
| 129 | + <?= $enc->html( $this->translate( 'client', 'Check' ), $enc::TRUST ); |
|
| 130 | +} |
|
| 131 | +?> |
|
| 129 | 132 | </button> |
| 130 | 133 | <?php endif; ?> |
| 131 | 134 | |
@@ -146,8 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | $html = $view->render( $view->config( $tplconf, $default ) ); |
| 148 | 148 | $this->setBasketCached( $key, $html ); |
| 149 | - } |
|
| 150 | - else |
|
| 149 | + } else |
|
| 151 | 150 | { |
| 152 | 151 | $html = $this->modifyBody( $html, $uid ); |
| 153 | 152 | } |
@@ -216,8 +215,7 @@ discard block |
||
| 216 | 215 | { |
| 217 | 216 | $this->logException( $e ); |
| 218 | 217 | } |
| 219 | - } |
|
| 220 | - else |
|
| 218 | + } else |
|
| 221 | 219 | { |
| 222 | 220 | $html = $this->modifyHeader( $html, $uid ); |
| 223 | 221 | } |
@@ -18,8 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | return $name; |
| 20 | 20 | }; |
| 21 | -} |
|
| 22 | -else |
|
| 21 | +} else |
|
| 23 | 22 | { |
| 24 | 23 | $namefcn = function( $view, $key ) { |
| 25 | 24 | return $view->formparam( (array) $key ); |
@@ -93,9 +92,12 @@ discard block |
||
| 93 | 92 | <p class="order-notice"> |
| 94 | 93 | <?= $enc->html( $this->translate( 'client', 'Please enter your payment details' ), $enc::TRUST ); ?> |
| 95 | 94 | </p> |
| 96 | - <?php else : ?> |
|
| 95 | + <?php else { |
|
| 96 | + : ?> |
|
| 97 | 97 | <p class="order-notice"> |
| 98 | - <?= $enc->html( $this->translate( 'client', 'You will now be forwarded to the next step' ), $enc::TRUST ); ?> |
|
| 98 | + <?= $enc->html( $this->translate( 'client', 'You will now be forwarded to the next step' ), $enc::TRUST ); |
|
| 99 | +} |
|
| 100 | +?> |
|
| 99 | 101 | </p> |
| 100 | 102 | <?php endif; ?> |
| 101 | 103 | |
@@ -111,8 +113,11 @@ discard block |
||
| 111 | 113 | /> |
| 112 | 114 | <?php endforeach; ?> |
| 113 | 115 | |
| 114 | - <?php else : ?> |
|
| 115 | - <input type="hidden" id="process-<?= $key; ?>" |
|
| 116 | + <?php else { |
|
| 117 | + : ?> |
|
| 118 | + <input type="hidden" id="process-<?= $key; |
|
| 119 | +} |
|
| 120 | +?>" |
|
| 116 | 121 | name="<?= $enc->attr( $namefcn( $this, $item->getInternalCode() ) ); ?>" |
| 117 | 122 | value="<?= $enc->attr( $item->getDefault() ); ?>" |
| 118 | 123 | /> |
@@ -205,8 +210,7 @@ discard block |
||
| 205 | 210 | foreach( (array) $item->getDefault() as $key2 => $value ) { |
| 206 | 211 | $urlParams[] = $namefcn( $this, array( $item->getInternalCode(), $key2 ) ) . '=' . urlencode( $value ); |
| 207 | 212 | } |
| 208 | - } |
|
| 209 | - else |
|
| 213 | + } else |
|
| 210 | 214 | { |
| 211 | 215 | $urlParams[] = $namefcn( $this, $item->getInternalCode() ) . '=' . urlencode( $item->getDefault() ); |
| 212 | 216 | } |
@@ -220,9 +224,12 @@ discard block |
||
| 220 | 224 | <?= $enc->html( $this->translate( 'client', 'Proceed' ), $enc::TRUST ); ?> |
| 221 | 225 | </a> |
| 222 | 226 | |
| 223 | - <?php else : ?> |
|
| 227 | + <?php else { |
|
| 228 | + : ?> |
|
| 224 | 229 | <button class="btn btn-primary btn-lg btn-action"> |
| 225 | - <?= $enc->html( $this->translate( 'client', 'Proceed' ), $enc::TRUST ); ?> |
|
| 230 | + <?= $enc->html( $this->translate( 'client', 'Proceed' ), $enc::TRUST ); |
|
| 231 | +} |
|
| 232 | +?> |
|
| 226 | 233 | </button> |
| 227 | 234 | |
| 228 | 235 | <?php endif; ?> |
@@ -471,19 +471,22 @@ discard block |
||
| 471 | 471 | $disable = $view->config( 'client/html/checkout/standard/address/delivery/disable-new', false ); |
| 472 | 472 | $type = \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_DELIVERY; |
| 473 | 473 | |
| 474 | - if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) === 'null' && $disable === false ) // new address |
|
| 474 | + if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) === 'null' && $disable === false ) { |
|
| 475 | + // new address |
|
| 475 | 476 | { |
| 476 | 477 | $params = $view->param( 'ca_delivery', [] ); |
| 478 | + } |
|
| 477 | 479 | |
| 478 | 480 | if( ( $view->deliveryError = $this->checkFields( $params ) ) !== [] ) { |
| 479 | 481 | throw new \Aimeos\Client\Html\Exception( sprintf( 'At least one delivery address part is missing or invalid' ) ); |
| 480 | 482 | } |
| 481 | 483 | |
| 482 | 484 | $ctrl->addAddress( $type, $params, 0 ); |
| 483 | - } |
|
| 484 | - else if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) !== '-1' ) // existing address |
|
| 485 | + } else if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) !== '-1' ) { |
|
| 486 | + // existing address |
|
| 485 | 487 | { |
| 486 | 488 | $params = $view->param( 'ca_delivery_' . $option, [] ); |
| 489 | + } |
|
| 487 | 490 | |
| 488 | 491 | if( !empty( $params ) && ( $view->deliveryError = $this->checkFields( $params ) ) !== [] ) { |
| 489 | 492 | throw new \Aimeos\Client\Html\Exception( sprintf( 'At least one delivery address part is missing or invalid' ) ); |
@@ -496,13 +499,11 @@ discard block |
||
| 496 | 499 | $params = array_replace( $address->toArray(), $params + ['order.base.address.addressid' => $option] ); |
| 497 | 500 | $addr = $ctrl->addAddress( $type, $params, 0 )->get()->getAddress( $type, 0 ); // sanitize address first |
| 498 | 501 | $custCntl->addAddressItem( $address->copyFrom( $addr ), $option )->store(); // update existing address |
| 499 | - } |
|
| 500 | - else |
|
| 502 | + } else |
|
| 501 | 503 | { |
| 502 | 504 | $ctrl->addAddress( $type, $params, 0 ); |
| 503 | 505 | } |
| 504 | - } |
|
| 505 | - else |
|
| 506 | + } else |
|
| 506 | 507 | { |
| 507 | 508 | $ctrl->deleteAddress( $type ); |
| 508 | 509 | } |
@@ -704,8 +705,7 @@ discard block |
||
| 704 | 705 | $invalid[$key] = $name; |
| 705 | 706 | unset( $params[$key] ); |
| 706 | 707 | } |
| 707 | - } |
|
| 708 | - else |
|
| 708 | + } else |
|
| 709 | 709 | { |
| 710 | 710 | unset( $params[$key] ); |
| 711 | 711 | } |
@@ -166,8 +166,7 @@ discard block |
||
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | $html = $view->render( $config->get( $tplconf, $default ) ); |
| 169 | - } |
|
| 170 | - else |
|
| 169 | + } else |
|
| 171 | 170 | { |
| 172 | 171 | $html = $this->modifyBody( $html, $uid ); |
| 173 | 172 | } |
@@ -236,8 +235,7 @@ discard block |
||
| 236 | 235 | { |
| 237 | 236 | $this->logException( $e ); |
| 238 | 237 | } |
| 239 | - } |
|
| 240 | - else |
|
| 238 | + } else |
|
| 241 | 239 | { |
| 242 | 240 | $html = $this->modifyHeader( $html, $uid ); |
| 243 | 241 | } |
@@ -401,8 +401,7 @@ discard block |
||
| 401 | 401 | $controller = $view->config( 'client/html/catalog/detail/url/controller', 'catalog' ); |
| 402 | 402 | $action = $view->config( 'client/html/catalog/detail/url/action', 'detail' ); |
| 403 | 403 | $config = $view->config( 'client/html/catalog/detail/url/config', [] ); |
| 404 | - } |
|
| 405 | - else |
|
| 404 | + } else |
|
| 406 | 405 | { |
| 407 | 406 | $params = $context->getSession()->get( 'aimeos/catalog/lists/params/last/' . $site, [] ); |
| 408 | 407 | |
@@ -468,8 +467,7 @@ discard block |
||
| 468 | 467 | $view->param( 'b_supplier', '' ), |
| 469 | 468 | $view->param( 'b_siteid' ) |
| 470 | 469 | ); |
| 471 | - } |
|
| 472 | - else |
|
| 470 | + } else |
|
| 473 | 471 | { |
| 474 | 472 | $list = []; |
| 475 | 473 | $entries = (array) $view->param( 'b_prod', [] ); |