Skip to content

Commit aaf024f

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.3-develop expedited
Accepted Community Pull Requests: - #22624: Resolve Typo (by @prashantsharmacedcoss) - #20918: Enabled 'Shopping Cart' tab for customer edit interface in admin (by @rav-redchamps) Fixed GitHub Issues: - #6287: Customer Admin Shopping Cart View Missing (reported by @alexgoodey) has been fixed in #20918 by @rav-redchamps in 2.3-develop branch Related commits: 1. e062906 2. ae5b032 3. 1a73182 4. 33e702e 5. 1c3d10e 6. e3e65a4 7. 6d9d7f0 8. 9e07d6e 9. bca244c
2 parents 66bb273 + 943afc6 commit aaf024f

File tree

6 files changed

+118
-3
lines changed

6 files changed

+118
-3
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Customer\Model;
9+
10+
use Magento\Framework\App\RequestInterface;
11+
12+
/**
13+
* Provides customer id from request.
14+
*/
15+
class CustomerIdProvider
16+
{
17+
/**
18+
* @var RequestInterface
19+
*/
20+
private $request;
21+
22+
/**
23+
* @param RequestInterface $request
24+
*/
25+
public function __construct(
26+
RequestInterface $request
27+
) {
28+
$this->request = $request;
29+
}
30+
31+
/**
32+
* Get customer id from request.
33+
*
34+
* @return int
35+
*/
36+
public function getCustomerId(): int
37+
{
38+
return (int)$this->request->getParam('id');
39+
}
40+
}

app/code/Magento/Customer/view/adminhtml/layout/customer_index_edit.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
<referenceContainer name="content">
1616
<uiComponent name="customer_form"/>
1717
</referenceContainer>
18+
<referenceContainer name="after.body.start">
19+
<block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Configure" name="after.body.start.product_composite_configure" template="Magento_Catalog::catalog/product/composite/configure.phtml"/>
20+
</referenceContainer>
1821
</body>
1922
</page>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Sales\Block\Adminhtml;
7+
8+
use Magento\Backend\Block\Template\Context;
9+
use Magento\Customer\Model\CustomerIdProvider;
10+
use Magento\Ui\Component\Layout\Tabs\TabWrapper;
11+
12+
/**
13+
* Class ShoppingCarts
14+
*
15+
* @package Magento\Sales\Block\Adminhtml
16+
*/
17+
class ShoppingCartsTab extends TabWrapper
18+
{
19+
/**
20+
* @var bool
21+
*/
22+
protected $isAjaxLoaded = true;
23+
24+
/**
25+
* @var CustomerIdProvider
26+
*/
27+
private $customerIdProvider;
28+
29+
/**
30+
* @param Context $context
31+
* @param CustomerIdProvider $customerIdProvider
32+
* @param array $data
33+
*/
34+
public function __construct(Context $context, CustomerIdProvider $customerIdProvider, array $data = [])
35+
{
36+
parent::__construct($context, $data);
37+
$this->customerIdProvider = $customerIdProvider;
38+
}
39+
40+
/**
41+
* @inheritdoc
42+
*/
43+
public function canShowTab()
44+
{
45+
return $this->customerIdProvider->getCustomerId();
46+
}
47+
48+
/**
49+
* Return Tab label
50+
*
51+
* @codeCoverageIgnore
52+
*
53+
* @return \Magento\Framework\Phrase
54+
*/
55+
public function getTabLabel()
56+
{
57+
return __('Shopping cart');
58+
}
59+
60+
/**
61+
* Return URL link to Tab content
62+
*
63+
* @return string
64+
*/
65+
public function getTabUrl()
66+
{
67+
return $this->getUrl('customer/*/cart', ['_current' => true]);
68+
}
69+
}

app/code/Magento/Sales/view/base/ui_component/customer_form.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@
99
<htmlContent name="orders_content">
1010
<block acl="Magento_Sales::actions_view" class="Magento\Sales\Block\Adminhtml\CustomerOrdersTab" name="orders" />
1111
</htmlContent>
12+
<htmlContent name="cart_content">
13+
<block acl="Magento_Cart::manage" class="Magento\Sales\Block\Adminhtml\ShoppingCartsTab" name="cart"/>
14+
</htmlContent>
1215
</form>

lib/web/css/docs/source/_actions-toolbar.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
// <td>@actions-toolbar__padding</td>
8080
// <td class="vars_value">false</td>
8181
// <td class="vars_value">'' | false | value</td>
82-
// <td>Paddings of the Actions toolbar</td>
82+
// <td>Padding of the Actions toolbar</td>
8383
// </tr>
8484
// <tr>
8585
// <th>@_actions-toolbar-actions-margin</th>
@@ -298,7 +298,7 @@
298298
//
299299
// <code>@_actions-toolbar-margin</code> variable controls margins of the actions toolbar wrapper.
300300
//
301-
// <code>@_actions-toolbar-padding</code> variable controls paddings of the actions toolbar wrapper.
301+
// <code>@_actions-toolbar-padding</code> variable controls padding of the actions toolbar wrapper.
302302
//
303303
// ``` html
304304
// <div class="example-actions-toolbar-9">

lib/web/css/docs/source/_layout.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ footer.footer {
361361

362362
// # Layout width
363363
//
364-
// The <code>.lib-layout-width()</code> mixin is used to set default page width of the element the mixin is applied to. It can be used to set width for the whole page wrapper or for the page elements individualy like header, footer, and so on.
364+
// The <code>.lib-layout-width()</code> mixin is used to set default page width of the element the mixin is applied to. It can be used to set width for the whole page wrapper or for the page elements individually like header, footer, and so on.
365365

366366
// # Layout width variables
367367
//

0 commit comments

Comments
 (0)