@@ -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(); |