@@ -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 ) { |
@@ -50,19 +50,19 @@ |
||
| 50 | 50 | ?> |
| 51 | 51 | <?php if( isset( $this->detailProductItem ) ) : |
| 52 | 52 | |
| 53 | - // preselection of a variant product in a selection article |
|
| 54 | - $preSelectVariantAttributes = ''; |
|
| 55 | - if ($this->param( 'productId' ) && is_numeric($this->param( 'productId' ))): |
|
| 53 | + // preselection of a variant product in a selection article |
|
| 54 | + $preSelectVariantAttributes = ''; |
|
| 55 | + if ($this->param( 'productId' ) && is_numeric($this->param( 'productId' ))): |
|
| 56 | 56 | |
| 57 | - if(($listItem = $this->detailProductItem->getListItem( 'product', 'default', (int) $this->param( 'productId' ))) && ( $product = $listItem->getRefItem() ) ) |
|
| 57 | + if(($listItem = $this->detailProductItem->getListItem( 'product', 'default', (int) $this->param( 'productId' ))) && ( $product = $listItem->getRefItem() ) ) |
|
| 58 | 58 | |
| 59 | - $attributes = $product->getRefItems('attribute',null,'variant'); |
|
| 59 | + $attributes = $product->getRefItems('attribute',null,'variant'); |
|
| 60 | 60 | |
| 61 | - foreach($attributes as $attribId => $attribute): |
|
| 62 | - $preSelectVariantAttributes[$attribute->getType()] = $attribute->getId(); |
|
| 63 | - endforeach; |
|
| 61 | + foreach($attributes as $attribId => $attribute): |
|
| 62 | + $preSelectVariantAttributes[$attribute->getType()] = $attribute->getId(); |
|
| 63 | + endforeach; |
|
| 64 | 64 | |
| 65 | - endif; |
|
| 65 | + endif; |
|
| 66 | 66 | |
| 67 | 67 | ?> |
| 68 | 68 | |
@@ -52,14 +52,14 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | // preselection of a variant product in a selection article |
| 54 | 54 | $preSelectVariantAttributes = ''; |
| 55 | - if ($this->param( 'productId' ) && is_numeric($this->param( 'productId' ))): |
|
| 55 | + if( $this->param( 'productId' ) && is_numeric( $this->param( 'productId' ) ) ): |
|
| 56 | 56 | |
| 57 | - if(($listItem = $this->detailProductItem->getListItem( 'product', 'default', (int) $this->param( 'productId' ))) && ( $product = $listItem->getRefItem() ) ) |
|
| 57 | + if( ( $listItem = $this->detailProductItem->getListItem( 'product', 'default', (int) $this->param( 'productId' ) ) ) && ( $product = $listItem->getRefItem() ) ) |
|
| 58 | 58 | |
| 59 | - $attributes = $product->getRefItems('attribute',null,'variant'); |
|
| 59 | + $attributes = $product->getRefItems( 'attribute', null, 'variant' ); |
|
| 60 | 60 | |
| 61 | - foreach($attributes as $attribId => $attribute): |
|
| 62 | - $preSelectVariantAttributes[$attribute->getType()] = $attribute->getId(); |
|
| 61 | + foreach( $attributes as $attribId => $attribute ): |
|
| 62 | + $preSelectVariantAttributes[$attribute->getType()] = $attribute->getId(); |
|
| 63 | 63 | endforeach; |
| 64 | 64 | |
| 65 | 65 | endif; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | <article class="product row <?= $this->detailProductItem->getConfigValue( 'css-class' ) ?>" |
| 77 | 77 | data-id="<?= $this->detailProductItem->getId() ?>" data-reqstock="<?= $reqstock ?>" |
| 78 | - data-preselectvariant="<?= $enc->attr($preSelectVariantAttributes)?>" |
|
| 78 | + data-preselectvariant="<?= $enc->attr( $preSelectVariantAttributes )?>" |
|
| 79 | 79 | |
| 80 | 80 | <div class="col-sm-6"> |
| 81 | 81 | |
@@ -54,9 +54,10 @@ |
||
| 54 | 54 | $preSelectVariantAttributes = ''; |
| 55 | 55 | if ($this->param( 'productId' ) && is_numeric($this->param( 'productId' ))): |
| 56 | 56 | |
| 57 | - if(($listItem = $this->detailProductItem->getListItem( 'product', 'default', (int) $this->param( 'productId' ))) && ( $product = $listItem->getRefItem() ) ) |
|
| 58 | - |
|
| 57 | + if(($listItem = $this->detailProductItem->getListItem( 'product', 'default', (int) $this->param( 'productId' ))) && ( $product = $listItem->getRefItem() ) ) { |
|
| 58 | + |
|
| 59 | 59 | $attributes = $product->getRefItems('attribute',null,'variant'); |
| 60 | + } |
|
| 60 | 61 | |
| 61 | 62 | foreach($attributes as $attribId => $attribute): |
| 62 | 63 | $preSelectVariantAttributes[$attribute->getType()] = $attribute->getId(); |