Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-checkout
Model
Cart
RequestQuantityProcessor.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\Checkout\Model\Cart
;
9
10
use
Magento\Framework\Locale\ResolverInterface
;
11
12
class
RequestQuantityProcessor
13
{
17
private
$localeResolver;
18
23
public
function
__construct
(
24
ResolverInterface
$localeResolver
25
) {
26
$this->localeResolver = $localeResolver;
27
}
28
35
public
function
process
(array $cartData): array
36
{
37
$filter = new \Zend\I18n\Filter\NumberParse($this->localeResolver->getLocale());
38
39
foreach
($cartData as
$index
=>
$data
) {
40
if
(isset(
$data
[
'qty'
])) {
41
$data
[
'qty'
] = is_string(
$data
[
'qty'
]) ? trim(
$data
[
'qty'
]) :
$data
[
'qty'
];
42
$cartData[
$index
][
'qty'
] = $filter->filter(
$data
[
'qty'
]);
43
}
44
}
45
46
return
$cartData;
47
}
48
}
Magento\Checkout\Model\Cart
Definition:
CartInterface.php:6
Magento\Checkout\Model\Cart\RequestQuantityProcessor
Definition:
RequestQuantityProcessor.php:12
Magento\Checkout\Model\Cart\RequestQuantityProcessor\__construct
__construct(ResolverInterface $localeResolver)
Definition:
RequestQuantityProcessor.php:23
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Framework\Locale\ResolverInterface
Definition:
ResolverInterface.php:14
$index
$index
Definition:
list.phtml:44
Magento\Checkout\Model\Cart\RequestQuantityProcessor\process
process(array $cartData)
Definition:
RequestQuantityProcessor.php:35