index.php
32 lines
| 1 | <div class="wrap"> |
| 2 | <?php |
| 3 | \SureCart::render( |
| 4 | 'layouts/partials/admin-index-header', |
| 5 | [ |
| 6 | 'title' => __( 'Dynamic Pricing', 'surecart' ), |
| 7 | 'new_link' => \SureCart::getUrl()->edit( 'auto-fees' ), |
| 8 | ] |
| 9 | ); |
| 10 | ?> |
| 11 | |
| 12 | <?php $table->search_form( __( 'Search', 'surecart' ), 'sc-search-auto-fees' ); ?> |
| 13 | |
| 14 | <form id="auto-fees-filter" method="get"> |
| 15 | <?php $table->views(); ?> |
| 16 | <?php $table->display(); ?> |
| 17 | </form> |
| 18 | </div> |
| 19 | |
| 20 | <script> |
| 21 | const deleteLinks = document.querySelectorAll( '.row-actions .delete>a' ); |
| 22 | Array.from( deleteLinks ).forEach( button => { |
| 23 | button.addEventListener( 'click', event => { |
| 24 | event.preventDefault(); |
| 25 | const confirmed = confirm("<?php echo esc_js( __( 'Are you sure you want to delete this dynamic price? This action cannot be undone.', 'surecart' ) ); ?>"); |
| 26 | if ( confirmed ) { |
| 27 | window.location.href = event.target.href; |
| 28 | } |
| 29 | } ); |
| 30 | } ); |
| 31 | </script> |
| 32 |