-
Notifications
You must be signed in to change notification settings - Fork 61
/
options.phtml
55 lines (54 loc) · 2.29 KB
/
options.phtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* @var \TIG\PostNL\Block\Adminhtml\Shipment\Options\Create $block
*/
?>
<?php if ($block->getIsPostNLOrder()):?>
<!--@todo move style to less and add style to header trough xml-->
<div id="postnl_shipping_options" style="margin-top: 20px; border-top: 1px solid #cecece; padding-top: 5px;">
<?php if ($block->isMultiColliAllowed()): ?>
<div class="field admin__field admin__field-option field-postnl-colli">
<label for="tig_postnl_colli"
class="admin__field-label" style="display:inline-block; min-width: 170px;">
<span><?= $block->escapeHtml(__('Colli amount')); ?></span>
</label>
<input id="tig_postnl_colli"
name="shipment[tig_postnl_colli_amount]"
value="<?= $block->escapeHtml($block->getParcelCount()); ?>"
class="admin__control-text">
</div>
<?php endif; ?>
<?php if ($block->getProductOptions()):?>
<div class="field admin__field admin__field-option field-postnl-products">
<label for="tig_postnl_product"
class="admin__field-label" style="display:inline-block; min-width: 170px;">
<span><?= $block->escapeHtml(__('PostNL Shipping options')); ?></span>
</label>
<select id="tig_postnl_product"
name="shipment[tig_postnl_product_code]"
class="admin__control-select" style="max-width:300px !important;">
<?php foreach ($block->getProductOptions() as $code => $option):?>
<?php $selected = $block->getProductCode() == $code ? ' selected="selected"' : ''; ?>
<option
value="<?= $block->escapeHtml($code); ?>"
<?= $block->escapeHtml($selected); ?>
><?= $block->escapeHtml(__($option['label'])); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<?php endif; ?>
</div>
<!-- Javascript to append the postnl div inside the form elements -->
<script>
require([
"jquery"
], function (jQuery) {
var items = jQuery('.admin__page-section-item-content');
var field = items.find('.order-history-comments-actions');
jQuery(function () {
field.before(jQuery('#postnl_shipping_options'));
});
})
</script>
<?php endif;?>