Skip to content

Commit ee53fb0

Browse files
author
Susan Wright
committed
Merge remote-tracking branch 'mainline/develop' into MAGETWO-36298
2 parents b739792 + 385f475 commit ee53fb0

File tree

100 files changed

+6220
-492
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+6220
-492
lines changed

app/code/Magento/Customer/Model/Resource/GroupRepository.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ public function getList(SearchCriteriaInterface $searchCriteria)
164164

165165
/** @var \Magento\Customer\Model\Resource\Group\Collection $collection */
166166
$collection = $this->groupFactory->create()->getCollection();
167+
$collection->addTaxClass();
167168

168169
//Add filters from root filter group to the collection
169170
/** @var FilterGroup $group */
@@ -234,6 +235,8 @@ protected function translateField($field)
234235
return 'customer_group_code';
235236
case GroupInterface::ID:
236237
return 'customer_group_id';
238+
case GroupInterface::TAX_CLASS_NAME:
239+
return 'class_name';
237240
default:
238241
return $field;
239242
}

app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/View/PersonalInfoTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function testGetCurrentStatus($status, $lastLoginAt, $lastVisitAt, $lastL
171171
'customer/online_customers/online_minutes_interval',
172172
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
173173
)
174-
->willReturn(60); //TODO: it's value mocked because unit tests run data providers before all testsuite
174+
->willReturn(240); //TODO: it's value mocked because unit tests run data providers before all testsuite
175175

176176
$this->customerLog->expects($this->any())->method('getLastLoginAt')->willReturn($lastLoginAt);
177177
$this->customerLog->expects($this->any())->method('getLastVisitAt')->willReturn($lastVisitAt);

app/code/Magento/Quote/Api/CartItemRepositoryInterface.php

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,45 @@ public function getList($cartId);
2828
public function save(\Magento\Quote\Api\Data\CartItemInterface $cartItem);
2929

3030
/**
31-
* Remove bundle option
31+
* Removes the specified item from the specified cart.
32+
*
33+
* @param int $cartId The cart ID.
34+
* @param int $itemId The item ID of the item to be removed.
35+
* @return bool
36+
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified item or cart does not exist.
37+
* @throws \Magento\Framework\Exception\CouldNotSaveException The item could not be removed.
38+
*/
39+
public function deleteById($cartId, $itemId);
40+
41+
/**
42+
* Lists items that are assigned to a specified cart.
43+
*
44+
* @param int $customerId Customer ID.
45+
* @return \Magento\Quote\Api\Data\CartItemInterface[] Array of items.
46+
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
47+
*/
48+
public function getListForCustomer($customerId);
49+
50+
/**
51+
* Adds the specified item to the specified cart.
3252
*
33-
* @param \Magento\Quote\Api\Data\CartItemInterface $cartItem
34-
* @return void
35-
* @throws \Magento\Framework\Exception\CouldNotSaveException
53+
* @param int $customerId Customer ID.
54+
* @param \Magento\Quote\Api\Data\CartItemInterface $cartItem The item.
55+
* @return \Magento\Quote\Api\Data\CartItemInterface Item.
56+
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
57+
* @throws \Magento\Framework\Exception\CouldNotSaveException The specified item could not be saved to the cart.
58+
* @throws \Magento\Framework\Exception\InputException The specified item or cart is not valid.
3659
*/
37-
public function delete(\Magento\Quote\Api\Data\CartItemInterface $cartItem);
60+
public function saveForCustomer($customerId, \Magento\Quote\Api\Data\CartItemInterface $cartItem);
3861

3962
/**
4063
* Removes the specified item from the specified cart.
4164
*
42-
* @param int $cartId The cart ID.
65+
* @param int $customerId Customer ID.
4366
* @param int $itemId The item ID of the item to be removed.
4467
* @return bool
4568
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified item or cart does not exist.
4669
* @throws \Magento\Framework\Exception\CouldNotSaveException The item could not be removed.
4770
*/
48-
public function deleteById($cartId, $itemId);
71+
public function deleteByIdForCustomer($customerId, $itemId);
4972
}

app/code/Magento/Quote/Api/CartManagementInterface.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,21 @@
88
interface CartManagementInterface
99
{
1010
/**
11-
* Enables an administrative or guest user to create an empty cart and quote for an anonymous customer.
11+
* Creates an empty cart and quote for a guest.
1212
*
13-
* @param int $storeId
13+
* @return int Cart ID.
1414
* @throws \Magento\Framework\Exception\CouldNotSaveException The empty cart and quote could not be created.
15+
*/
16+
public function createEmptyCart();
17+
18+
/**
19+
* Creates an empty cart and quote for a specified customer.
20+
*
21+
* @param int $customerId The customer ID.
1522
* @return int Cart ID.
23+
* @throws \Magento\Framework\Exception\CouldNotSaveException The empty cart and quote could not be created.
1624
*/
17-
public function createEmptyCart($storeId);
25+
public function createEmptyCartForCustomer($customerId);
1826

1927
/**
2028
* Returns information for the cart for a specified customer.

app/code/Magento/Quote/Api/Data/CartItemInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ public function setProductType($productType);
119119
/**
120120
* Returns Quote id.
121121
*
122-
* @return int
122+
* @return string
123123
*/
124124
public function getQuoteId();
125125

126126
/**
127127
* Sets Quote id.
128128
*
129-
* @param int $quoteId
129+
* @param string $quoteId
130130
* @return $this
131131
*/
132132
public function setQuoteId($quoteId);
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Quote\Api;
7+
8+
/**
9+
* Billing address management interface for guest carts.
10+
*/
11+
interface GuestBillingAddressManagementInterface
12+
{
13+
/**
14+
* Assigns a specified billing address to a specified cart.
15+
*
16+
* @param string $cartId The cart ID.
17+
* @param \Magento\Quote\Api\Data\AddressInterface $address Billing address data.
18+
* @return int Address ID.
19+
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
20+
* @throws \Magento\Framework\Exception\InputException The specified cart ID or address data is not valid.
21+
*/
22+
public function assign($cartId, \Magento\Quote\Api\Data\AddressInterface $address);
23+
24+
/**
25+
* Returns the billing address for a specified quote.
26+
*
27+
* @param string $cartId The cart ID.
28+
* @return \Magento\Quote\Api\Data\AddressInterface Quote billing address object.
29+
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
30+
*/
31+
public function get($cartId);
32+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Quote\Api;
7+
8+
/**
9+
* Cart Item repository interface for guest carts.
10+
*/
11+
interface GuestCartItemRepositoryInterface
12+
{
13+
/**
14+
* Lists items that are assigned to a specified cart.
15+
*
16+
* @param string $cartId The cart ID.
17+
* @return \Magento\Quote\Api\Data\CartItemInterface[] Array of items.
18+
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
19+
*/
20+
public function getList($cartId);
21+
22+
/**
23+
* Adds the specified item to the specified cart.
24+
*
25+
* @param \Magento\Quote\Api\Data\CartItemInterface $cartItem The item.
26+
* @return \Magento\Quote\Api\Data\CartItemInterface Item.
27+
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
28+
* @throws \Magento\Framework\Exception\CouldNotSaveException The specified item could not be saved to the cart.
29+
* @throws \Magento\Framework\Exception\InputException The specified item or cart is not valid.
30+
*/
31+
public function save(\Magento\Quote\Api\Data\CartItemInterface $cartItem);
32+
33+
/**
34+
* Removes the specified item from the specified cart.
35+
*
36+
* @param string $cartId The cart ID.
37+
* @param int $itemId The item ID of the item to be removed.
38+
* @return bool
39+
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified item or cart does not exist.
40+
* @throws \Magento\Framework\Exception\CouldNotSaveException The item could not be removed.
41+
*/
42+
public function deleteById($cartId, $itemId);
43+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Quote\Api;
7+
8+
/**
9+
* Cart Management interface for guest carts.
10+
*/
11+
interface GuestCartManagementInterface
12+
{
13+
/**
14+
* Enables an customer or guest user to create an empty cart and quote for an anonymous customer.
15+
*
16+
* @return string Cart ID.
17+
* @throws \Magento\Framework\Exception\CouldNotSaveException The empty cart and quote could not be created.
18+
*/
19+
public function createEmptyCart();
20+
21+
/**
22+
* Assigns a specified customer to a specified shopping cart.
23+
*
24+
* @param string $cartId The cart ID.
25+
* @param int $customerId The customer ID.
26+
* @param int $storeId
27+
* @return boolean
28+
*/
29+
public function assignCustomer($cartId, $customerId, $storeId);
30+
31+
/**
32+
* Places an order for a specified cart.
33+
*
34+
* @param string $cartId The cart ID.
35+
* @return int Order ID.
36+
*/
37+
public function placeOrder($cartId);
38+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Quote\Api;
7+
8+
/**
9+
* Cart Repository interface for guest carts.
10+
*/
11+
interface GuestCartRepositoryInterface
12+
{
13+
/**
14+
* Enables a guest user to return information for a specified cart.
15+
*
16+
* @param string $cartId
17+
* @return \Magento\Quote\Api\Data\CartInterface
18+
* @throws \Magento\Framework\Exception\NoSuchEntityException
19+
*/
20+
public function get($cartId);
21+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Quote\Api;
8+
9+
/**
10+
* Cart totals repository interface for guest carts.
11+
*/
12+
interface GuestCartTotalRepositoryInterface
13+
{
14+
/**
15+
* Returns quote totals data for a specified cart.
16+
*
17+
* @param string $cartId The cart ID.
18+
* @return \Magento\Quote\Api\Data\TotalsInterface Quote totals data.
19+
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
20+
*/
21+
public function get($cartId);
22+
}

0 commit comments

Comments
 (0)