@@ -268,28 +268,27 @@ |
||
| 268 | 268 | $orderItem = $orderCntl->add( $basket->getId(), ['order.type' => 'web'] )->store(); |
| 269 | 269 | |
| 270 | 270 | $context->session()->set( 'aimeos/orderid', $orderItem->getId() ); |
| 271 | - } |
|
| 272 | - elseif( ( $orderid = $context->session()->get( 'aimeos/orderid' ) ) !== null ) |
|
| 271 | + } elseif( ( $orderid = $context->session()->get( 'aimeos/orderid' ) ) !== null ) |
|
| 273 | 272 | { |
| 274 | 273 | $parts = ['order/base/address', 'order/base/coupon', 'order/base/product', 'order/base/service']; |
| 275 | 274 | $orderItem = $orderCntl->get( $orderid, false ); |
| 276 | 275 | $basket = $basketCntl->load( $orderItem->getBaseId(), $parts, false ); |
| 277 | - } |
|
| 278 | - else |
|
| 276 | + } else |
|
| 279 | 277 | { |
| 280 | 278 | return; |
| 281 | 279 | } |
| 282 | 280 | |
| 283 | - if( ( $form = $this->processPayment( $basket, $orderItem ) ) === null ) // no payment service available |
|
| 281 | + if( ( $form = $this->processPayment( $basket, $orderItem ) ) === null ) { |
|
| 282 | + // no payment service available |
|
| 284 | 283 | { |
| 285 | 284 | $services = $basket->getService( \Aimeos\MShop\Order\Item\Base\Service\Base::TYPE_PAYMENT ); |
| 285 | + } |
|
| 286 | 286 | $args = ( $service = reset( $services ) ) ? ['code' => $service->getCode()] : []; |
| 287 | 287 | |
| 288 | 288 | $orderCntl->save( $orderItem->setStatusPayment( \Aimeos\MShop\Order\Item\Base::PAY_AUTHORIZED ) ); |
| 289 | 289 | $view->standardUrlNext = $this->getUrlConfirm( $view, $args, ['absoluteUri' => true] ); |
| 290 | 290 | $view->standardMethod = 'POST'; |
| 291 | - } |
|
| 292 | - else |
|
| 291 | + } else |
|
| 293 | 292 | { |
| 294 | 293 | $view = $this->addFormData( $view, $form ); |
| 295 | 294 | } |
@@ -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 | } |
@@ -322,8 +322,7 @@ |
||
| 322 | 322 | { |
| 323 | 323 | $serviceCntl = \Aimeos\Controller\Frontend::create( $context, 'service' ); |
| 324 | 324 | $orderItem = $serviceCntl->updateSync( $view->request(), $code, $orderid ); |
| 325 | - } |
|
| 326 | - else |
|
| 325 | + } else |
|
| 327 | 326 | { |
| 328 | 327 | $orderCntl = \Aimeos\Controller\Frontend::create( $context, 'order' ); |
| 329 | 328 | $orderItem = $orderCntl->get( $orderid, false ); |
@@ -181,8 +181,7 @@ |
||
| 181 | 181 | array_filter( (array) $view->param( 'b_attrcustid', [] ) ), |
| 182 | 182 | (string) $view->param( 'b_stocktype', 'default' ) |
| 183 | 183 | ); |
| 184 | - } |
|
| 185 | - else |
|
| 184 | + } else |
|
| 186 | 185 | { |
| 187 | 186 | foreach( (array) $view->param( 'b_prod', [] ) as $values ) |
| 188 | 187 | { |
@@ -152,7 +152,8 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | </ul> |
| 154 | 154 | |
| 155 | - <?php else : ?> |
|
| 155 | + <?php else { |
|
| 156 | + : ?> |
|
| 156 | 157 | |
| 157 | 158 | <input type="hidden" value="1" name="<?= $enc->attr( $this->formparam( ['b_prod', 0, 'attrconfid', 'qty', ''] ) ) ?>"> |
| 158 | 159 | <select id="select-<?= $enc->attr( $key ) ?>" class="form-control select-list" |
@@ -204,7 +205,9 @@ discard block |
||
| 204 | 205 | value="<?= $enc->attr( $price->getValue() ) ?>" |
| 205 | 206 | <?php endif ?> |
| 206 | 207 | > |
| 207 | - <?php break; case 'date': ?> |
|
| 208 | + <?php break; |
|
| 209 | +} |
|
| 210 | +case 'date': ?> |
|
| 208 | 211 | <input id="select-<?= $enc->attr( $key ) ?>" class="form-control" type="date" name="<?= $enc->attr( $this->formparam( ['b_prod', 0, 'attrcustid', $id] ) ) ?>"> |
| 209 | 212 | <?php break; default: ?> |
| 210 | 213 | <input id="select-<?= $enc->attr( $key ) ?>" class="form-control" type="text" name="<?= $enc->attr( $this->formparam( ['b_prod', 0, 'attrcustid', $id] ) ) ?>"> |
@@ -64,15 +64,15 @@ discard block |
||
| 64 | 64 | <div class="col-sm-6"> |
| 65 | 65 | <?= $this->partial( |
| 66 | 66 | /** client/html/catalog/detail/partials/image |
| 67 | - * Relative path to the detail image partial template file |
|
| 68 | - * |
|
| 69 | - * Partials are templates which are reused in other templates and generate |
|
| 70 | - * reoccuring blocks filled with data from the assigned values. The image |
|
| 71 | - * partial creates an HTML block for the catalog detail images. |
|
| 72 | - * |
|
| 73 | - * @param string Relative path to the template file |
|
| 74 | - * @since 2017.01 |
|
| 75 | - */ |
|
| 67 | + * Relative path to the detail image partial template file |
|
| 68 | + * |
|
| 69 | + * Partials are templates which are reused in other templates and generate |
|
| 70 | + * reoccuring blocks filled with data from the assigned values. The image |
|
| 71 | + * partial creates an HTML block for the catalog detail images. |
|
| 72 | + * |
|
| 73 | + * @param string Relative path to the template file |
|
| 74 | + * @since 2017.01 |
|
| 75 | + */ |
|
| 76 | 76 | $this->config( 'client/html/catalog/detail/partials/image', 'catalog/detail/image-partial' ), |
| 77 | 77 | ['mediaItems' => $this->get( 'detailMediaItems', map() ), 'params' => $this->param()] |
| 78 | 78 | ) ?> |
@@ -185,21 +185,21 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | <?= $this->partial( |
| 187 | 187 | /** client/html/common/partials/selection |
| 188 | - * Relative path to the variant attribute partial template file |
|
| 189 | - * |
|
| 190 | - * Partials are templates which are reused in other templates and generate |
|
| 191 | - * reoccuring blocks filled with data from the assigned values. The selection |
|
| 192 | - * partial creates an HTML block for a list of variant product attributes |
|
| 193 | - * assigned to a selection product a customer must select from. |
|
| 194 | - * |
|
| 195 | - * The partial template files are usually stored in the templates/partials/ folder |
|
| 196 | - * of the core or the extensions. The configured path to the partial file must |
|
| 197 | - * be relative to the templates/ folder, e.g. "common/partials/selection". |
|
| 198 | - * |
|
| 199 | - * @param string Relative path to the template file |
|
| 200 | - * @since 2015.04 |
|
| 201 | - * @see client/html/common/partials/attribute |
|
| 202 | - */ |
|
| 188 | + * Relative path to the variant attribute partial template file |
|
| 189 | + * |
|
| 190 | + * Partials are templates which are reused in other templates and generate |
|
| 191 | + * reoccuring blocks filled with data from the assigned values. The selection |
|
| 192 | + * partial creates an HTML block for a list of variant product attributes |
|
| 193 | + * assigned to a selection product a customer must select from. |
|
| 194 | + * |
|
| 195 | + * The partial template files are usually stored in the templates/partials/ folder |
|
| 196 | + * of the core or the extensions. The configured path to the partial file must |
|
| 197 | + * be relative to the templates/ folder, e.g. "common/partials/selection". |
|
| 198 | + * |
|
| 199 | + * @param string Relative path to the template file |
|
| 200 | + * @since 2015.04 |
|
| 201 | + * @see client/html/common/partials/attribute |
|
| 202 | + */ |
|
| 203 | 203 | $this->config( 'client/html/common/partials/selection', 'common/partials/selection' ), |
| 204 | 204 | [ |
| 205 | 205 | 'productItems' => $this->detailProductItem->getRefItems( 'product', null, 'default' ), |
@@ -215,21 +215,21 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | <?= $this->partial( |
| 217 | 217 | /** client/html/common/partials/group |
| 218 | - * Relative path to the group product partial template file |
|
| 219 | - * |
|
| 220 | - * Partials are templates which are reused in other templates and generate |
|
| 221 | - * reoccuring blocks filled with data from the assigned values. The group |
|
| 222 | - * partial creates an HTML block for a list of sub-products assigned to a |
|
| 223 | - * group product a customer can select from. |
|
| 224 | - * |
|
| 225 | - * The partial template files are usually stored in the templates/partials/ folder |
|
| 226 | - * of the core or the extensions. The configured path to the partial file must |
|
| 227 | - * be relative to the templates/ folder, e.g. "common/partials/selection-list". |
|
| 228 | - * |
|
| 229 | - * @param string Relative path to the template file |
|
| 230 | - * @since 2021.07 |
|
| 231 | - * @see client/html/common/partials/attribute |
|
| 232 | - */ |
|
| 218 | + * Relative path to the group product partial template file |
|
| 219 | + * |
|
| 220 | + * Partials are templates which are reused in other templates and generate |
|
| 221 | + * reoccuring blocks filled with data from the assigned values. The group |
|
| 222 | + * partial creates an HTML block for a list of sub-products assigned to a |
|
| 223 | + * group product a customer can select from. |
|
| 224 | + * |
|
| 225 | + * The partial template files are usually stored in the templates/partials/ folder |
|
| 226 | + * of the core or the extensions. The configured path to the partial file must |
|
| 227 | + * be relative to the templates/ folder, e.g. "common/partials/selection-list". |
|
| 228 | + * |
|
| 229 | + * @param string Relative path to the template file |
|
| 230 | + * @since 2021.07 |
|
| 231 | + * @see client/html/common/partials/attribute |
|
| 232 | + */ |
|
| 233 | 233 | $this->config( 'client/html/common/partials/group', 'common/partials/selection-list' ), |
| 234 | 234 | [ |
| 235 | 235 | 'productItems' => $this->detailProductItem->getRefItems( 'product', null, 'default' ), |
@@ -245,21 +245,21 @@ discard block |
||
| 245 | 245 | |
| 246 | 246 | <?= $this->partial( |
| 247 | 247 | /** client/html/common/partials/attribute |
| 248 | - * Relative path to the product attribute partial template file |
|
| 249 | - * |
|
| 250 | - * Partials are templates which are reused in other templates and generate |
|
| 251 | - * reoccuring blocks filled with data from the assigned values. The attribute |
|
| 252 | - * partial creates an HTML block for a list of optional product attributes a |
|
| 253 | - * customer can select from. |
|
| 254 | - * |
|
| 255 | - * The partial template files are usually stored in the templates/partials/ folder |
|
| 256 | - * of the core or the extensions. The configured path to the partial file must |
|
| 257 | - * be relative to the templates/ folder, e.g. "partials/attribute.php". |
|
| 258 | - * |
|
| 259 | - * @param string Relative path to the template file |
|
| 260 | - * @since 2016.01 |
|
| 261 | - * @see client/html/common/partials/selection |
|
| 262 | - */ |
|
| 248 | + * Relative path to the product attribute partial template file |
|
| 249 | + * |
|
| 250 | + * Partials are templates which are reused in other templates and generate |
|
| 251 | + * reoccuring blocks filled with data from the assigned values. The attribute |
|
| 252 | + * partial creates an HTML block for a list of optional product attributes a |
|
| 253 | + * customer can select from. |
|
| 254 | + * |
|
| 255 | + * The partial template files are usually stored in the templates/partials/ folder |
|
| 256 | + * of the core or the extensions. The configured path to the partial file must |
|
| 257 | + * be relative to the templates/ folder, e.g. "partials/attribute.php". |
|
| 258 | + * |
|
| 259 | + * @param string Relative path to the template file |
|
| 260 | + * @since 2016.01 |
|
| 261 | + * @see client/html/common/partials/selection |
|
| 262 | + */ |
|
| 263 | 263 | $this->config( 'client/html/common/partials/attribute', 'common/partials/attribute' ), |
| 264 | 264 | ['productItem' => $this->detailProductItem] |
| 265 | 265 | ) ?> |
@@ -312,16 +312,16 @@ discard block |
||
| 312 | 312 | |
| 313 | 313 | <?= $this->partial( |
| 314 | 314 | /** client/html/catalog/partials/actions |
| 315 | - * Relative path to the catalog actions partial template file |
|
| 316 | - * |
|
| 317 | - * Partials are templates which are reused in other templates and generate |
|
| 318 | - * reoccuring blocks filled with data from the assigned values. The actions |
|
| 319 | - * partial creates an HTML block for the product actions (pin, like and watch |
|
| 320 | - * products). |
|
| 321 | - * |
|
| 322 | - * @param string Relative path to the template file |
|
| 323 | - * @since 2017.04 |
|
| 324 | - */ |
|
| 315 | + * Relative path to the catalog actions partial template file |
|
| 316 | + * |
|
| 317 | + * Partials are templates which are reused in other templates and generate |
|
| 318 | + * reoccuring blocks filled with data from the assigned values. The actions |
|
| 319 | + * partial creates an HTML block for the product actions (pin, like and watch |
|
| 320 | + * products). |
|
| 321 | + * |
|
| 322 | + * @param string Relative path to the template file |
|
| 323 | + * @since 2017.04 |
|
| 324 | + */ |
|
| 325 | 325 | $this->config( 'client/html/catalog/partials/actions', 'catalog/actions-partial' ), |
| 326 | 326 | ['productItem' => $this->detailProductItem] |
| 327 | 327 | ) ?> |
@@ -329,16 +329,16 @@ discard block |
||
| 329 | 329 | |
| 330 | 330 | <?= $this->partial( |
| 331 | 331 | /** client/html/catalog/partials/social |
| 332 | - * Relative path to the social partial template file |
|
| 333 | - * |
|
| 334 | - * Partials are templates which are reused in other templates and generate |
|
| 335 | - * reoccuring blocks filled with data from the assigned values. The social |
|
| 336 | - * partial creates an HTML block for links to social platforms in the |
|
| 337 | - * catalog components. |
|
| 338 | - * |
|
| 339 | - * @param string Relative path to the template file |
|
| 340 | - * @since 2017.04 |
|
| 341 | - */ |
|
| 332 | + * Relative path to the social partial template file |
|
| 333 | + * |
|
| 334 | + * Partials are templates which are reused in other templates and generate |
|
| 335 | + * reoccuring blocks filled with data from the assigned values. The social |
|
| 336 | + * partial creates an HTML block for links to social platforms in the |
|
| 337 | + * catalog components. |
|
| 338 | + * |
|
| 339 | + * @param string Relative path to the template file |
|
| 340 | + * @since 2017.04 |
|
| 341 | + */ |
|
| 342 | 342 | $this->config( 'client/html/catalog/partials/social', 'catalog/social-partial' ), |
| 343 | 343 | ['productItem' => $this->detailProductItem] |
| 344 | 344 | ) ?> |