html-column-shipping-message.php
1 week ago
html-custom-services.php
1 week ago
html-menu-icon.php
1 week ago
html-shipping-method-scripts.php
1 week ago
html-shipping-method-settings.php
1 week ago
html-shipping-settings-advanced.php
1 week ago
html-shipping-settings-info-description.php
1 week ago
html-shipping-method-scripts.php
37 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package Flexible Shipping |
| 4 | * |
| 5 | * Shipping method scripts. |
| 6 | */ |
| 7 | |
| 8 | ?> |
| 9 | <script type="text/javascript"> |
| 10 | var url = document.location.href; |
| 11 | url = fs_removeParam( 'action', url ); |
| 12 | url = fs_removeParam( 'methods_id', url ); |
| 13 | url = fs_removeParam( 'added', url ); |
| 14 | url = fs_trimChar( url, '?' ); |
| 15 | if ( url.includes( 'method_id=' ) ) { |
| 16 | url = url + "&action=edit"; |
| 17 | } |
| 18 | jQuery( '#mainform' ).attr( 'action', url ); |
| 19 | </script> |
| 20 | <?php if ( isset( $_GET['action'] ) && isset( $_GET['instance_id'] ) ) : ?> |
| 21 | <script type="text/javascript"> |
| 22 | <?php |
| 23 | $zone = WC_Shipping_Zones::get_zone_by( 'instance_id', sanitize_key( $_GET['instance_id'] ) ); |
| 24 | $shipping_method_woo = WC_Shipping_Zones::get_shipping_method( sanitize_key( $_GET['instance_id'] ) ); |
| 25 | $content = '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=shipping' ) . '">' . __( 'Shipping Zones', 'flexible-shipping' ) . '</a> > '; |
| 26 | $content .= '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=shipping&zone_id=' . absint( $zone->get_id() ) ) . '">' . esc_html( $zone->get_zone_name() ) . '</a> > '; |
| 27 | $content .= '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=shipping&instance_id=' . sanitize_key( $_GET['instance_id'] ) ) . '">' . esc_html( $shipping_method_woo->get_title() ) . '</a>'; |
| 28 | $content .= ' > <span class="flexible-shipping-method-title"></span>'; |
| 29 | ?> |
| 30 | jQuery('#mainform h2').first().replaceWith( '<h2>' + '<?php echo $content; // phpcs:ignore ?>' + '</h2>' ); |
| 31 | jQuery('.flexible-shipping-method-title').text(jQuery('#woocommerce_flexible_shipping_method_title').val()); |
| 32 | jQuery('#woocommerce_flexible_shipping_method_title').on('keyup',function(){ |
| 33 | jQuery('.flexible-shipping-method-title').text(jQuery('#woocommerce_flexible_shipping_method_title').val()); |
| 34 | }); |
| 35 | </script> |
| 36 | <?php endif; ?> |
| 37 |