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