@@ -41,27 +41,27 @@ |
||
41 | 41 | * @param string $stocktype Unique code of the stock type to deliver the products from |
42 | 42 | * @throws \Aimeos\Controller\Frontend\Basket\Exception If the product isn't available |
43 | 43 | */ |
44 | - public function addProduct( $prodid, $quantity = 1, array $options = array(), array $variantAttributeIds = array(), |
|
44 | + public function addProduct($prodid, $quantity = 1, array $options = array(), array $variantAttributeIds = array(), |
|
45 | 45 | array $configAttributeIds = array(), array $hiddenAttributeIds = array(), array $customAttributeValues = array(), |
46 | - $stocktype = 'default' ) |
|
46 | + $stocktype = 'default') |
|
47 | 47 | { |
48 | - $catalogListManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'catalog/lists' ); |
|
48 | + $catalogListManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'catalog/lists'); |
|
49 | 49 | |
50 | - $search = $catalogListManager->createSearch( true ); |
|
50 | + $search = $catalogListManager->createSearch(true); |
|
51 | 51 | $expr = array( |
52 | - $search->compare( '==', 'catalog.lists.domain', 'product' ), |
|
53 | - $search->compare( '==', 'catalog.lists.refid', $prodid ), |
|
52 | + $search->compare('==', 'catalog.lists.domain', 'product'), |
|
53 | + $search->compare('==', 'catalog.lists.refid', $prodid), |
|
54 | 54 | $search->getConditions() |
55 | 55 | ); |
56 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
57 | - $search->setSlice( 0, 1 ); |
|
56 | + $search->setConditions($search->combine('&&', $expr)); |
|
57 | + $search->setSlice(0, 1); |
|
58 | 58 | |
59 | - $result = $catalogListManager->searchItems( $search ); |
|
59 | + $result = $catalogListManager->searchItems($search); |
|
60 | 60 | |
61 | - if( reset( $result ) === false ) |
|
61 | + if (reset($result) === false) |
|
62 | 62 | { |
63 | - $msg = sprintf( 'Adding product with ID "%1$s" is not allowed', $prodid ); |
|
64 | - throw new \Aimeos\Controller\Frontend\Basket\Exception( $msg ); |
|
63 | + $msg = sprintf('Adding product with ID "%1$s" is not allowed', $prodid); |
|
64 | + throw new \Aimeos\Controller\Frontend\Basket\Exception($msg); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | $this->getController()->addProduct( |