@@ -42,6 +42,11 @@ class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Action\Attribut
42
42
*/
43
43
private $ userContext ;
44
44
45
+ /**
46
+ * @var int
47
+ */
48
+ private $ bulkSize ;
49
+
45
50
/**
46
51
* @param Action\Context $context
47
52
* @param \Magento\Catalog\Helper\Product\Edit\Action\Attribute $attributeHelper
@@ -50,6 +55,7 @@ class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Action\Attribut
50
55
* @param \Magento\Framework\DataObject\IdentityGeneratorInterface $identityService
51
56
* @param \Magento\Framework\Serialize\SerializerInterface $serializer
52
57
* @param \Magento\Authorization\Model\UserContextInterface $userContext
58
+ * @param int $bulkSize
53
59
*/
54
60
public function __construct (
55
61
Action \Context $ context ,
@@ -58,14 +64,16 @@ public function __construct(
58
64
\Magento \AsynchronousOperations \Api \Data \OperationInterfaceFactory $ operartionFactory ,
59
65
\Magento \Framework \DataObject \IdentityGeneratorInterface $ identityService ,
60
66
\Magento \Framework \Serialize \SerializerInterface $ serializer ,
61
- \Magento \Authorization \Model \UserContextInterface $ userContext
67
+ \Magento \Authorization \Model \UserContextInterface $ userContext ,
68
+ int $ bulkSize = 100
62
69
) {
63
70
parent ::__construct ($ context , $ attributeHelper );
64
71
$ this ->bulkManagement = $ bulkManagement ;
65
72
$ this ->operationFactory = $ operartionFactory ;
66
73
$ this ->identityService = $ identityService ;
67
74
$ this ->serializer = $ serializer ;
68
75
$ this ->userContext = $ userContext ;
76
+ $ this ->bulkSize = $ bulkSize ;
69
77
}
70
78
71
79
/**
@@ -171,9 +179,9 @@ private function publish(
171
179
$ websiteId ,
172
180
$ productIds
173
181
):void {
174
- $ productIdsChunks = array_chunk ($ productIds , 100 );
182
+ $ productIdsChunks = array_chunk ($ productIds , $ this -> bulkSize );
175
183
$ bulkUuid = $ this ->identityService ->generateId ();
176
- $ bulkDescription = __ ('Update attributes to ' . count ($ productIds ) . ' selected products ' );
184
+ $ bulkDescription = __ ('Update attributes for ' . count ($ productIds ) . ' selected products ' );
177
185
$ operations = [];
178
186
foreach ($ productIdsChunks as $ productIdsChunk ) {
179
187
if ($ websiteRemoveData || $ websiteAddData ) {
0 commit comments