@@ -287,9 +287,12 @@ discard block |
||
287 | 287 | { |
288 | 288 | $manager = \Aimeos\MShop::create( $this->context(), 'attribute' ); |
289 | 289 | |
290 | - try { |
|
290 | + try |
|
291 | + { |
|
291 | 292 | return $manager->find( 'custom', [], 'product', 'price' ); |
292 | - } catch( \Aimeos\MShop\Exception $e ) { |
|
293 | + } |
|
294 | + catch( \Aimeos\MShop\Exception $e ) |
|
295 | + { |
|
293 | 296 | return $manager->save( $manager->create()->setDomain( 'product' )->setType( 'price' )->setCode( 'custom' ) ); |
294 | 297 | } |
295 | 298 | } |
@@ -458,8 +461,7 @@ discard block |
||
458 | 461 | $listItem = \Aimeos\MShop::create( $this->context(), 'product' )->createListItem(); |
459 | 462 | $item = $item->addListItem( 'attribute', $listItem->setType( 'custom' ), $attrItem ); |
460 | 463 | } |
461 | - } |
|
462 | - else |
|
464 | + } else |
|
463 | 465 | { |
464 | 466 | if( ( $litem = $item->getListItem( 'attribute', 'custom', $attrItem->getId(), false ) ) !== null ) { |
465 | 467 | $item = $item->deleteListItem( 'attribute', $litem ); |