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 55 */
66namespace Magento \Bundle \Block \Adminhtml \Sales \Order \Items ;
77
8+ use Magento \Catalog \Helper \Data as CatalogHelper ;
89use Magento \Catalog \Model \Product \Type \AbstractType ;
9- use Magento \Framework \Serialize \Serializer \Json ;
1010use Magento \Framework \App \ObjectManager ;
11- use Magento \Catalog \ Helper \ Data as CatalogHelper ;
11+ use Magento \Framework \ Serialize \ Serializer \ Json ;
1212
1313/**
1414 * Adminhtml sales order item renderer
1919class Renderer extends \Magento \Sales \Block \Adminhtml \Items \Renderer \DefaultRenderer
2020{
2121 /**
22- * Serializer
22+ * Serializer interface instance.
2323 *
2424 * @var Json
2525 */
@@ -248,7 +248,7 @@ public function getValueHtml($item)
248248 if (!$ this ->isShipmentSeparately ($ item )) {
249249 $ attributes = $ this ->getSelectionAttributes ($ item );
250250 if ($ attributes ) {
251- $ result = sprintf ( ' %d ' , $ attributes ['qty ' ]) . ' x ' . $ result ;
251+ $ result = ( float ) $ attributes ['qty ' ] . ' x ' . $ result ;
252252 }
253253 }
254254 if (!$ this ->isChildCalculated ($ item )) {
Original file line number Diff line number Diff line change 55 */
66namespace Magento \Bundle \Block \Adminhtml \Sales \Order \View \Items ;
77
8+ use Magento \Catalog \Helper \Data as CatalogHelper ;
89use Magento \Catalog \Model \Product \Type \AbstractType ;
910use Magento \Framework \App \ObjectManager ;
1011use Magento \Framework \Serialize \Serializer \Json ;
11- use Magento \Catalog \Helper \Data as CatalogHelper ;
1212
1313/**
1414 * Adminhtml sales order item renderer
@@ -203,7 +203,7 @@ public function getValueHtml($item)
203203 if (!$ this ->isShipmentSeparately ($ item )) {
204204 $ attributes = $ this ->getSelectionAttributes ($ item );
205205 if ($ attributes ) {
206- $ result = sprintf ( ' %d ' , $ attributes ['qty ' ]) . ' x ' . $ result ;
206+ $ result = ( float ) $ attributes ['qty ' ] . ' x ' . $ result ;
207207 }
208208 }
209209 if (!$ this ->isChildCalculated ($ item )) {
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ public function getSelectionAttributes($item)
150150 public function getValueHtml ($ item )
151151 {
152152 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 ()) . " "
154154 . $ this ->getOrder ()->formatPrice ($ attributes ['price ' ]);
155155 }
156156 return $ this ->escapeHtml ($ item ->getName ());
Original file line number Diff line number Diff line change 2323abstract class AbstractItems extends \Magento \Sales \Model \Order \Pdf \Items \AbstractItems
2424{
2525 /**
26- * Serializer
26+ * Serializer interface instance.
2727 *
2828 * @var Json
2929 */
@@ -263,7 +263,8 @@ public function getValueHtml($item)
263263 if (!$ this ->isShipmentSeparately ($ item )) {
264264 $ attributes = $ this ->getSelectionAttributes ($ item );
265265 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 ;
267268 }
268269 }
269270 if (!$ this ->isChildCalculated ($ item )) {
You can’t perform that action at this time.
0 commit comments