8
8
9
9
/**
10
10
* @var $block \Magento\Shipping\Block\Adminhtml\Order\Packaging
11
+ * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
11
12
*/
12
13
?>
13
14
<?php
@@ -61,7 +62,7 @@ $girthEnabled = $block->isDisplayGirthValue() && $block->isGirthAllowed() ? 1 :
61
62
weight_units: pack.select('select[name="container_weight_units"]')[0].value,
62
63
dimension_units: pack.select('select[name="container_dimension_units"]')[0].value,
63
64
shipping_product: pack.select('select[name="shipping_product"]')[0].value,
64
- product_type: pack.select('input[name="product_type"]')[0].value
65
+ product_type: 'default'
65
66
};
66
67
67
68
if ('undefined' != typeof pack.select('input[name="expiration_date"]')[0]) {
@@ -247,32 +248,6 @@ $girthEnabled = $block->isDisplayGirthValue() && $block->isGirthAllowed() ? 1 :
247
248
});
248
249
packItems = packagePrepareGrid.removeClassName('grid_prepare').addClassName('package_items');
249
250
packItems.select('.grid tbody tr').each(function (item) {
250
- // Set the package type if not currently set
251
- if ("" === packageBlock.select('input[name="product_type"]')[0].value) {
252
- var productType = jQuery(item).data('product-type');
253
- packageBlock.select('input[name="product_type"]')[0].value = productType;
254
-
255
- // Lock the label type if needed and hide fields if needed
256
- switch(productType) {
257
- case 'fresh':
258
- packageBlock.select('select[name="shipping_product"]')[0].value = 'FRESH';
259
- break;
260
-
261
- case 'freeze':
262
- packageBlock.select('select[name="shipping_product"]')[0].value = 'FREEZE';
263
- break;
264
-
265
- case 'default':
266
- default:
267
- packageBlock.select('.freshfreeze').each(function(item) { item.remove(); });
268
- break;
269
- }
270
- }
271
- // Don't allow different product types in one package
272
- else if (jQuery(item).data('product_type') !== packageBlock.select('input[name="product_type"]')[0].value) {
273
- item.remove();
274
- return;
275
- }
276
251
277
252
var itemId = item.select('[type="checkbox"]')[0].value;
278
253
var qtyValue = parseFloat(item.select('[name="qty"]')[0].value);
@@ -294,11 +269,6 @@ $girthEnabled = $block->isDisplayGirthValue() && $block->isGirthAllowed() ? 1 :
294
269
}.bind(packaging));
295
270
} else {
296
271
packagePrepareGrid.select('.grid tbody tr').each(function (item) {
297
- // Skip the product if the type is not the same as the package product type
298
- if (jQuery(item).data('product-type') !== packageBlock.select('input[name="product_type"]')[0].value) {
299
- item.remove();
300
- return;
301
- }
302
272
303
273
var itemId = item.select('[type="checkbox"]')[0].value;
304
274
var qtyValue = parseFloat(item.select('[name="qty"]')[0].value);
@@ -367,21 +337,21 @@ $girthEnabled = $block->isDisplayGirthValue() && $block->isGirthAllowed() ? 1 :
367
337
click: function () {
368
338
packaging.cancelPackaging();
369
339
this.closeModal();
370
- }
371
- }, {
340
+ }
341
+ }, {
372
342
text: '<?php echo $ block ->escapeJs (__ ('Save ' )) ?> ',
373
343
'attr': {'disabled':'disabled', 'data-action':'save-packages'},
374
344
'class': 'action-primary _disabled',
375
345
click: function () {
376
346
packaging.confirmPackaging();
377
- }
378
- }, {
379
- text: '<?php echo $ block ->escapeJs (__ ('Add Package ' )) ?> ',
380
- 'attr': {'data-action':'add-packages'},
381
- 'class': 'action-secondary',
382
- click: function () {
383
- packaging.newPackage();
384
- }
347
+ }
348
+ }, {
349
+ text: '<?php echo $ block ->escapeJs (__ ('Add Package ' )) ?> ',
350
+ 'attr': {'data-action':'add-packages'},
351
+ 'class': 'action-secondary',
352
+ click: function () {
353
+ packaging.newPackage();
354
+ }
385
355
}]
386
356
});
387
357
jQuery(document).trigger('packaging:inited');
0 commit comments