File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed
Model/Sales/Order/Pdf/Items Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Bundle \Block \Adminhtml \Sales \Order \Items ;
7
7
8
+ use Magento \Catalog \Helper \Data as CatalogHelper ;
8
9
use Magento \Catalog \Model \Product \Type \AbstractType ;
9
- use Magento \Framework \Serialize \Serializer \Json ;
10
10
use Magento \Framework \App \ObjectManager ;
11
- use Magento \Catalog \ Helper \ Data as CatalogHelper ;
11
+ use Magento \Framework \ Serialize \ Serializer \ Json ;
12
12
13
13
/**
14
14
* Adminhtml sales order item renderer
19
19
class Renderer extends \Magento \Sales \Block \Adminhtml \Items \Renderer \DefaultRenderer
20
20
{
21
21
/**
22
- * Serializer
22
+ * Serializer interface instance.
23
23
*
24
24
* @var Json
25
25
*/
@@ -248,7 +248,7 @@ public function getValueHtml($item)
248
248
if (!$ this ->isShipmentSeparately ($ item )) {
249
249
$ attributes = $ this ->getSelectionAttributes ($ item );
250
250
if ($ attributes ) {
251
- $ result = sprintf ( ' %d ' , $ attributes ['qty ' ]) . ' x ' . $ result ;
251
+ $ result = ( float ) $ attributes ['qty ' ] . ' x ' . $ result ;
252
252
}
253
253
}
254
254
if (!$ this ->isChildCalculated ($ item )) {
Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Bundle \Block \Adminhtml \Sales \Order \View \Items ;
7
7
8
+ use Magento \Catalog \Helper \Data as CatalogHelper ;
8
9
use Magento \Catalog \Model \Product \Type \AbstractType ;
9
10
use Magento \Framework \App \ObjectManager ;
10
11
use Magento \Framework \Serialize \Serializer \Json ;
11
- use Magento \Catalog \Helper \Data as CatalogHelper ;
12
12
13
13
/**
14
14
* Adminhtml sales order item renderer
@@ -203,7 +203,7 @@ public function getValueHtml($item)
203
203
if (!$ this ->isShipmentSeparately ($ item )) {
204
204
$ attributes = $ this ->getSelectionAttributes ($ item );
205
205
if ($ attributes ) {
206
- $ result = sprintf ( ' %d ' , $ attributes ['qty ' ]) . ' x ' . $ result ;
206
+ $ result = ( float ) $ attributes ['qty ' ] . ' x ' . $ result ;
207
207
}
208
208
}
209
209
if (!$ this ->isChildCalculated ($ item )) {
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ public function getSelectionAttributes($item)
150
150
public function getValueHtml ($ item )
151
151
{
152
152
if ($ attributes = $ this ->getSelectionAttributes ($ item )) {
153
- return sprintf ( ' %d ' , $ attributes ['qty ' ]) . ' x ' . $ this ->escapeHtml ($ item ->getName ()) . " "
153
+ return ( float ) $ attributes ['qty ' ] . ' x ' . $ this ->escapeHtml ($ item ->getName ()) . " "
154
154
. $ this ->getOrder ()->formatPrice ($ attributes ['price ' ]);
155
155
}
156
156
return $ this ->escapeHtml ($ item ->getName ());
Original file line number Diff line number Diff line change 23
23
abstract class AbstractItems extends \Magento \Sales \Model \Order \Pdf \Items \AbstractItems
24
24
{
25
25
/**
26
- * Serializer
26
+ * Serializer interface instance.
27
27
*
28
28
* @var Json
29
29
*/
@@ -263,7 +263,8 @@ public function getValueHtml($item)
263
263
if (!$ this ->isShipmentSeparately ($ item )) {
264
264
$ attributes = $ this ->getSelectionAttributes ($ item );
265
265
if ($ attributes ) {
266
- $ result = $ this ->filterManager ->sprintf ($ attributes ['qty ' ], ['format ' => '%d ' ]) . ' x ' . $ result ;
266
+ $ qty = $ this ->filterManager ->sprintf ($ attributes ['qty ' ], ['format ' => '%f ' ]);
267
+ $ result = (float ) $ qty . ' x ' . $ result ;
267
268
}
268
269
}
269
270
if (!$ this ->isChildCalculated ($ item )) {
You can’t perform that action at this time.
0 commit comments