@@ -58,7 +58,10 @@ |
||
| 58 | 58 | <?php $current = $params; if( is_array( $current['f_optid'] ) ) { unset( $current['f_optid'][$key] ); } ?> |
| 59 | 59 | <?php elseif( isset( $oneIds[$attrType] ) && ( $key = array_search( $id, (array) $oneIds[$attrType] ) ) !== false ) : ?> |
| 60 | 60 | <?php $current = $params; if( is_array( $current['f_oneid'][$attrType] ) ) { unset( $current['f_oneid'][$attrType][$key] ); } ?> |
| 61 | - <?php else : continue; ?> |
|
| 61 | + <?php else { |
|
| 62 | + : continue; |
|
| 63 | +} |
|
| 64 | +?> |
|
| 62 | 65 | <?php endif; ?> |
| 63 | 66 | |
| 64 | 67 | <a class="minibutton close" href="<?= $enc->attr( $this->link( $linkKey, $attribute->get( 'params', [] ) ) ); ?>"> |
@@ -43,8 +43,7 @@ |
||
| 43 | 43 | { |
| 44 | 44 | $serviceCntl = \Aimeos\Controller\Frontend::create( $context, 'service' ); |
| 45 | 45 | $orderItem = $serviceCntl->updateSync( $view->request(), $code, $orderid ); |
| 46 | - } |
|
| 47 | - else |
|
| 46 | + } else |
|
| 48 | 47 | { |
| 49 | 48 | $orderCntl = \Aimeos\Controller\Frontend::create( $context, 'order' ); |
| 50 | 49 | $orderItem = $orderCntl->get( $orderid, false ); |
@@ -211,28 +211,27 @@ |
||
| 211 | 211 | $orderItem = $orderCntl->add( $basket->getId(), ['order.type' => 'web'] )->store(); |
| 212 | 212 | |
| 213 | 213 | $context->session()->set( 'aimeos/orderid', $orderItem->getId() ); |
| 214 | - } |
|
| 215 | - elseif( ( $orderid = $context->session()->get( 'aimeos/orderid' ) ) !== null ) |
|
| 214 | + } elseif( ( $orderid = $context->session()->get( 'aimeos/orderid' ) ) !== null ) |
|
| 216 | 215 | { |
| 217 | 216 | $parts = ['order/base/address', 'order/base/coupon', 'order/base/product', 'order/base/service']; |
| 218 | 217 | $orderItem = $orderCntl->get( $orderid, false ); |
| 219 | 218 | $basket = $basketCntl->load( $orderItem->getBaseId(), $parts, false ); |
| 220 | - } |
|
| 221 | - else |
|
| 219 | + } else |
|
| 222 | 220 | { |
| 223 | 221 | return; |
| 224 | 222 | } |
| 225 | 223 | |
| 226 | - if( ( $form = $this->processPayment( $basket, $orderItem ) ) === null ) // no payment service available |
|
| 224 | + if( ( $form = $this->processPayment( $basket, $orderItem ) ) === null ) { |
|
| 225 | + // no payment service available |
|
| 227 | 226 | { |
| 228 | 227 | $services = $basket->getService( \Aimeos\MShop\Order\Item\Base\Service\Base::TYPE_PAYMENT ); |
| 228 | + } |
|
| 229 | 229 | $args = ( $service = reset( $services ) ) ? ['code' => $service->getCode()] : []; |
| 230 | 230 | |
| 231 | 231 | $orderCntl->save( $orderItem->setStatusPayment( \Aimeos\MShop\Order\Item\Base::PAY_AUTHORIZED ) ); |
| 232 | 232 | $view->standardUrlNext = $this->getUrlConfirm( $view, $args, ['absoluteUri' => true] ); |
| 233 | 233 | $view->standardMethod = 'POST'; |
| 234 | - } |
|
| 235 | - else |
|
| 234 | + } else |
|
| 236 | 235 | { |
| 237 | 236 | $this->addFormData( $view, $form ); |
| 238 | 237 | } |
@@ -149,8 +149,7 @@ |
||
| 149 | 149 | $value = $oservice->getAttribute( $key, 'delivery' ) ?: $value; |
| 150 | 150 | $item->value = $oservice->getAttribute( $key . '/hidden', 'delivery' ) ?: $value; |
| 151 | 151 | } |
| 152 | - } |
|
| 153 | - else |
|
| 152 | + } else |
|
| 154 | 153 | { |
| 155 | 154 | foreach( $attr as $key => $item ) { |
| 156 | 155 | $item->value = is_array( $item->getDefault() ) ? key( $item->getDefault() ) : $item->getDefault(); |
@@ -149,8 +149,7 @@ |
||
| 149 | 149 | $value = $oservice->getAttribute( $key, 'payment' ) ?: $value; |
| 150 | 150 | $item->value = $oservice->getAttribute( $key . '/hidden', 'payment' ) ?: $value; |
| 151 | 151 | } |
| 152 | - } |
|
| 153 | - else |
|
| 152 | + } else |
|
| 154 | 153 | { |
| 155 | 154 | foreach( $attr as $key => $item ) { |
| 156 | 155 | $item->value = is_array( $item->getDefault() ) ? key( $item->getDefault() ) : $item->getDefault(); |
@@ -138,7 +138,7 @@ |
||
| 138 | 138 | public function data( \Aimeos\Base\View\Iface $view, array &$tags = [], string &$expire = null ) : \Aimeos\Base\View\Iface |
| 139 | 139 | { |
| 140 | 140 | $tree = \Aimeos\Controller\Frontend::create( $this->context(), 'catalog' )->uses( $this->domains() ) |
| 141 | - ->getTree( \Aimeos\Controller\Frontend\Catalog\Iface::LIST ); |
|
| 141 | + ->getTree( \Aimeos\Controller\Frontend\Catalog\Iface::list ); |
|
| 142 | 142 | |
| 143 | 143 | $products = \Aimeos\Controller\Frontend::create( $this->context(), 'product' )->uses( $this->domains() ) |
| 144 | 144 | ->category( $tree->getChildren()->getId()->all(), 'promotion' )->search(); |
@@ -384,7 +384,7 @@ |
||
| 384 | 384 | $domain = str_replace( '/', '_', $item->getResourceType() ); // maximum compatiblity |
| 385 | 385 | |
| 386 | 386 | if( in_array( $item->getResourceType(), ['catalog', 'product', 'supplier'] ) ) { |
| 387 | - $tags[] = $tagAll ? $domain . '-' . $item->getId() : $domain ; |
|
| 387 | + $tags[] = $tagAll ? $domain . '-' . $item->getId() : $domain; |
|
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | if( $item instanceof \Aimeos\MShop\Common\Item\Time\Iface && ( $date = $item->getDateEnd() ) !== null ) { |
@@ -625,25 +625,25 @@ |
||
| 625 | 625 | // preselection of a variant in a selection article |
| 626 | 626 | if (isset($_GET['productId']) && is_numeric($_GET['productId'])): |
| 627 | 627 | |
| 628 | - foreach( $this->detailProductItem->getRefItems( 'product', null, 'default' ) as $prodid => $product ) : |
|
| 628 | + foreach( $this->detailProductItem->getRefItems( 'product', null, 'default' ) as $prodid => $product ) : |
|
| 629 | 629 | |
| 630 | - if ($prodid == $_GET['productId']): |
|
| 630 | + if ($prodid == $_GET['productId']): |
|
| 631 | 631 | |
| 632 | - $attributes = $product->getRefItems('attribute',null,'variant'); |
|
| 633 | - $js = ''; |
|
| 634 | - foreach($attributes as $attribId => $attribute): |
|
| 635 | - $js .= '"' . $attribute->getType() . '": "' . $attribute->getId() . '", |
|
| 632 | + $attributes = $product->getRefItems('attribute',null,'variant'); |
|
| 633 | + $js = ''; |
|
| 634 | + foreach($attributes as $attribId => $attribute): |
|
| 635 | + $js .= '"' . $attribute->getType() . '": "' . $attribute->getId() . '", |
|
| 636 | 636 | '; |
| 637 | - endforeach; |
|
| 637 | + endforeach; |
|
| 638 | 638 | |
| 639 | - if (!empty($js)): ?> |
|
| 639 | + if (!empty($js)): ?> |
|
| 640 | 640 | <script> |
| 641 | 641 | AimeosVariantSelectionProduct = {"prodId": "<?= $this->detailProductItem->getId() ?>", "attributes": {<?= $js ?>}}; |
| 642 | 642 | </script> |
| 643 | 643 | |
| 644 | 644 | <?php endif; |
| 645 | - endif; |
|
| 646 | - endforeach; |
|
| 645 | + endif; |
|
| 646 | + endforeach; |
|
| 647 | 647 | endif; |
| 648 | 648 | |
| 649 | 649 | ?> |
@@ -623,20 +623,20 @@ |
||
| 623 | 623 | |
| 624 | 624 | <?php |
| 625 | 625 | // preselection of a variant in a selection article |
| 626 | -if (isset($_GET['productId']) && is_numeric($_GET['productId'])): |
|
| 626 | +if( isset( $_GET['productId'] ) && is_numeric( $_GET['productId'] ) ): |
|
| 627 | 627 | |
| 628 | 628 | foreach( $this->detailProductItem->getRefItems( 'product', null, 'default' ) as $prodid => $product ) : |
| 629 | 629 | |
| 630 | - if ($prodid == $_GET['productId']): |
|
| 630 | + if( $prodid == $_GET['productId'] ): |
|
| 631 | 631 | |
| 632 | - $attributes = $product->getRefItems('attribute',null,'variant'); |
|
| 632 | + $attributes = $product->getRefItems( 'attribute', null, 'variant' ); |
|
| 633 | 633 | $js = ''; |
| 634 | - foreach($attributes as $attribId => $attribute): |
|
| 635 | - $js .= '"' . $attribute->getType() . '": "' . $attribute->getId() . '", |
|
| 634 | + foreach( $attributes as $attribId => $attribute ): |
|
| 635 | + $js .= '"' . $attribute->getType() . '": "' . $attribute->getId() . '", |
|
| 636 | 636 | '; |
| 637 | 637 | endforeach; |
| 638 | 638 | |
| 639 | - if (!empty($js)): ?> |
|
| 639 | + if( !empty( $js ) ): ?> |
|
| 640 | 640 | <script> |
| 641 | 641 | AimeosVariantSelectionProduct = {"prodId": "<?= $this->detailProductItem->getId() ?>", "attributes": {<?= $js ?>}}; |
| 642 | 642 | </script> |