shipping-method-after.php
43 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Display collection point select. |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/flexible-shipping/checkout/shipping-method-after.php |
| 6 | * |
| 7 | * @package Flexible Shipping. |
| 8 | * |
| 9 | * @var $collection_point_label string |
| 10 | * @var $select_options array |
| 11 | * @var $selected_collection_point string |
| 12 | * @var $collection_point_field_name string |
| 13 | * @var $collection_point_description string |
| 14 | * @var $collection_point_map_selector_label string |
| 15 | * @car $collection_point_service_id string |
| 16 | */ |
| 17 | |
| 18 | ?><tr class="shipping flexible-shipping-collection-point"> |
| 19 | <td colspan="2"> |
| 20 | <h4><?php echo esc_html( $collection_point_label ); ?></h4> |
| 21 | <?php |
| 22 | |
| 23 | $field_args = array( |
| 24 | 'type' => 'select', |
| 25 | 'options' => $select_options, |
| 26 | 'description' => $collection_point_description, |
| 27 | 'class' => array( 'flexible-shipping-collection-point-select' ), |
| 28 | ); |
| 29 | woocommerce_form_field( $collection_point_field_name, $field_args, $selected_collection_point ); |
| 30 | ?> |
| 31 | <a |
| 32 | class="flexible-shipping-collection-point-map-selector" |
| 33 | data-select-id="<?php echo esc_attr( $collection_point_field_name ); ?>" href="#<?php echo esc_attr( $collection_point_field_name ); ?>" |
| 34 | data-service-id="<?php echo esc_attr( $collection_point_service_id ); ?>" href="#<?php echo esc_attr( $collection_point_field_name ); ?>" |
| 35 | ><?php echo esc_html( $collection_point_map_selector_label ); ?></a> |
| 36 | <script type="text/javascript"> |
| 37 | if (jQuery().select2) { |
| 38 | jQuery('#<?php echo esc_attr( $collection_point_field_name ); ?>').select2(); |
| 39 | } |
| 40 | </script> |
| 41 | </td> |
| 42 | </tr> |
| 43 |