@@ -155,7 +155,8 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | </ul> |
| 157 | 157 | |
| 158 | - <?php else : ?> |
|
| 158 | + <?php else { |
|
| 159 | + : ?> |
|
| 159 | 160 | |
| 160 | 161 | <input type="hidden" value="1" name="<?= $enc->attr( $this->formparam( ['b_prod', 0, 'attrconfid', 'qty', ''] ) ) ?>"> |
| 161 | 162 | <select id="select-<?= $enc->attr( $this->productItem->getId() . '-' . $code ) ?>" 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( $this->productItem->getId() . '-' . $key ) ?>" class="form-control" type="date" name="<?= $enc->attr( $this->formparam( ['b_prod', 0, 'attrcustid', $id] ) ) ?>"> |
| 209 | 212 | <?php break;case 'upload': ?> |
| 210 | 213 | <div class="upload-wrapper"> |
@@ -465,11 +465,11 @@ discard block |
||
| 465 | 465 | |
| 466 | 466 | $attrIds[] = \Aimeos\MShop::create( $this->getContext(), 'attribute' )->find( 'file', [], 'product', 'upload' )->getId(); |
| 467 | 467 | |
| 468 | - $fs = $this->getContext()->fs( 'fs' ); |
|
| 468 | + $fs = $this->getContext()->fs( 'fs' ); |
|
| 469 | 469 | |
| 470 | - if( !$fs->has('basket-upload' ) ) { |
|
| 471 | - $fs->mkdir( 'basket-upload' ); |
|
| 472 | - } |
|
| 470 | + if( !$fs->has('basket-upload' ) ) { |
|
| 471 | + $fs->mkdir( 'basket-upload' ); |
|
| 472 | + } |
|
| 473 | 473 | |
| 474 | 474 | $context = $this->getContext(); |
| 475 | 475 | $domains = ['attribute', 'media', 'price', 'product', 'text', 'custom']; |
@@ -496,7 +496,7 @@ discard block |
||
| 496 | 496 | $entries = (array) $view->param( 'b_prod', [] ); |
| 497 | 497 | |
| 498 | 498 | for($i = 0; $i < count($entries); ++$i) { |
| 499 | - $paths = []; |
|
| 499 | + $paths = []; |
|
| 500 | 500 | foreach ($attrIds as $attrId) { |
| 501 | 501 | if (isset($entries[$i]['attrcustid'][$attrId]) && is_array($entries[$i]['attrcustid'][$attrId])) { |
| 502 | 502 | /** @var UploadedFile $file */ |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | $list[] = $entries[$i]['prodid']; |
| 518 | 518 | } |
| 519 | 519 | } |
| 520 | - } |
|
| 520 | + } |
|
| 521 | 521 | |
| 522 | 522 | foreach( $entries as $values ) |
| 523 | 523 | { |
@@ -392,8 +392,7 @@ discard block |
||
| 392 | 392 | $controller = $view->config( 'client/html/catalog/detail/url/controller', 'catalog' ); |
| 393 | 393 | $action = $view->config( 'client/html/catalog/detail/url/action', 'detail' ); |
| 394 | 394 | $config = $view->config( 'client/html/catalog/detail/url/config', [] ); |
| 395 | - } |
|
| 396 | - else |
|
| 395 | + } else |
|
| 397 | 396 | { |
| 398 | 397 | $params = $context->getSession()->get( 'aimeos/catalog/lists/params/last/' . $site, [] ); |
| 399 | 398 | |
@@ -489,8 +488,7 @@ discard block |
||
| 489 | 488 | (string) $view->param( 'b_supplier', '' ), |
| 490 | 489 | $view->param( 'b_siteid' ) |
| 491 | 490 | ); |
| 492 | - } |
|
| 493 | - else |
|
| 491 | + } else |
|
| 494 | 492 | { |
| 495 | 493 | $list = []; |
| 496 | 494 | $entries = (array) $view->param( 'b_prod', [] ); |
@@ -502,11 +500,14 @@ discard block |
||
| 502 | 500 | /** @var UploadedFile $file */ |
| 503 | 501 | foreach ($entries[$i]['attrcustid'][$attrId] as $file) { |
| 504 | 502 | $filepath = 'basket-upload/' . md5($file->getFilename() . microtime(true)) . '.' . $file->extension(); |
| 505 | - try { |
|
| 503 | + try |
|
| 504 | + { |
|
| 506 | 505 | $stream = fopen($file->getRealPath(), 'r+'); |
| 507 | 506 | $fs->writes($filepath, $stream); |
| 508 | 507 | fclose($stream); |
| 509 | - } catch (\Exception $ex) { |
|
| 508 | + } |
|
| 509 | + catch (\Exception $ex) |
|
| 510 | + { |
|
| 510 | 511 | Log::error($ex->getMessage()); |
| 511 | 512 | } |
| 512 | 513 | $paths[] = $filepath; |