replace buttons with dropdown
This commit is contained in:
@@ -26,24 +26,27 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||||||
<div>
|
<div>
|
||||||
<h1>Please select a process for the order:</h1>
|
<h1>Please select a process for the order:</h1>
|
||||||
<br/>
|
<br/>
|
||||||
|
<select id="delivery-process-selector">
|
||||||
|
<option value="" disabled selected>Select ... </option>
|
||||||
<?php
|
<?php
|
||||||
foreach($list_of_delivery_processes as $index => $process){
|
foreach($list_of_delivery_processes as $index => $process){
|
||||||
echo '<button class="delivery-process" id=' . $process['id'] . '>' . $process['title'] . '</button>';
|
echo '<option value=' . $process['id'] . '>' . $process['title'] . '</option>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript" >
|
<script type="text/javascript" >
|
||||||
jQuery(document).ready(function($) {
|
jQuery(document).ready(function($) {
|
||||||
|
|
||||||
$('.delivery-process').click(function(e){
|
$('#delivery-process-selector').change(function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
action: 'wiaas_create_order_delivery_process',
|
action: 'wiaas_create_order_delivery_process',
|
||||||
_ajax_nonce: '<?php echo wp_create_nonce( "wiaas_create_order_delivery_process" ) ?>',
|
_ajax_nonce: '<?php echo wp_create_nonce( "wiaas_create_order_delivery_process" ) ?>',
|
||||||
order: '<?php echo $order_id ?>',
|
order: '<?php echo $order_id ?>',
|
||||||
form: e.target.id
|
form: e.target.value
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user