first commit

This commit is contained in:
2024-07-15 11:28:08 +02:00
commit f52d538ea5
21891 changed files with 6161164 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
<div class="flexible-shipping-pro-box">
<div class="metabox-holder">
<div class="stuffbox">
<h3 class="hndle"><?php _e( 'Get Flexible Shipping PRO!', 'flexible-shipping' ); ?></h3>
<?php
$fs_link = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/flexible-shipping-pro-woocommerce/' : 'https://flexibleshipping.com/table-rate/';
?>
<div class="inside">
<div class="main">
<ul>
<li><span class="dashicons dashicons-yes"></span> <?php _e( 'Shipping Classes support', 'flexible-shipping' ); ?></li>
<li><span class="dashicons dashicons-yes"></span> <?php _e( 'Product count based costs', 'flexible-shipping' ); ?></li>
<li><span class="dashicons dashicons-yes"></span> <?php _e( 'Stopping, Cancelling a rule', 'flexible-shipping' ); ?></li>
<li><span class="dashicons dashicons-yes"></span> <?php _e( 'Additional calculation methods', 'flexible-shipping' ); ?></li>
</ul>
<a class="button button-primary" href="<?php echo $fs_link; ?>?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=button&utm_term=upgrade-now&utm_content=fs-shippingzone-upgradenow" target="_blank"><?php _e( 'Upgrade Now &rarr;', 'flexible-shipping' ); ?></a>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="flexible_shipping_message">
<span class="<?php echo $messages[$post->ID]['status']; ?>">
<?php echo $messages[$post->ID]['message']; ?>
</span>
</div>

View File

@@ -0,0 +1,20 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="shipping">
<div class="shipping-status">
<a class="icon-status icon-status-<?php echo $shipping['status']; ?> tips" href="<?php echo $shipping['url']; ?>" data-tip="<?php echo esc_html( $statuses[$shipping['status']] ); ?>">
<?php echo esc_html( $statuses[$shipping['status']] ); ?>
</a>
<?php do_action( 'flexible_shipping_shipping_status_html', $shipping ); ?>
</div>
<div class="shipping-actions order_actions">
<?php if ( !empty( $shipping['label_url'] ) ) : ?>
<a class="button tips get-label" target="_blank" href="<?php echo $shipping['label_url']; ?>" data-tip="<?php _e( 'Get label for: ', 'flexible-shipping' ); ?><?php echo $shipping['tracking_number']; ?>"><?php _e( 'Get label for: ', 'flexible-shipping' ); ?><?php echo $shipping['tracking_number']; ?></a>
<?php endif; ?>
<?php if ( !empty( $shipping['tracking_url'] ) ) : ?>
<a class="button tips track" target="_blank" href="<?php echo $shipping['tracking_url']; ?>" data-tip="<?php _e( 'Track shipment for: ', 'flexible-shipping' ); ?><?php echo $shipping['tracking_number']; ?>"><?php _e( 'Track shipment for: ', 'flexible-shipping' ); ?><?php echo $shipping['tracking_number']; ?></a>
<?php endif; ?>
<?php do_action( 'flexible_shipping_shipping_actions_html', $shipping ); ?>
</div>
<div style="clear: both;"></div>
<?php do_action( 'flexible_shipping_shipping_html', $shipping ); ?>
</div>

View File

@@ -0,0 +1,45 @@
<tr valign="top">
<th scope="row" class="titledesc">
<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
<?php echo $this->get_tooltip_html( $data ); ?>
</th>
<td class="forminp">
<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
<span class="<?php echo esc_attr( $data['class'] ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>">
<table class="flexible_shipping_services wc_shipping widefat wp-list-table" cellspacing="0">
<thead>
<tr>
<th class="sort">&nbsp;</th>
<th class="service_code"><?php _e( 'Code', 'flexible-shipping' ); ?></th>
<th class="service_name"><?php _e( 'Name', 'flexible-shipping' ); ?></th>
<th class="select">
<?php _e( 'Enabled', 'flexible-shipping' ); ?><?php /* <input type="checkbox" class="tips checkbox-select-all-services" value="1" data-tip="<?php _e( 'Enable all', 'flexible-shipping' ); ?>" /> */ ?>
</th>
</tr>
</thead>
<tbody>
<?php foreach ( $services as $service_code => $service ) : ?>
<tr>
<td class="sort"></td>
<td class="service_code"><?php echo $service_code; ?></td>
<td class="service_name">
<input name="<?php echo esc_attr( $field_key ); ?>[<?php echo $service_code ?>][name]" type="text" value="<?php echo esc_attr( $service['name'] ); ?>" class="woocommerce_flexible_shipping_service_name"/>
</td>
<td width="1%" class="select" nowrap>
<input name="<?php echo esc_attr( $field_key ); ?>[<?php echo $service_code ?>][enabled]" type="checkbox" class="checkbox-select-service" value="<?php echo esc_attr( $service_code ); ?>" <?php echo $service['enabled'] ? 'checked' : ''; ;?> />
</td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot>
<tr>
<th colspan="4"><span class="description"><?php _e( 'Drag and drop the services to control their display order. Confirm by clicking Save changes button below.', 'flexible-shipping' ); ?></span></th>
</tr>
</tfoot>
</table>
</span>
<?php echo $this->get_description_html( $data ); ?>
</fieldset>
</td>
</tr>

View File

@@ -0,0 +1,15 @@
<style type="text/css" media="screen">
#adminmenu #toplevel_page_flexible-shipping-menu a div.wp-menu-image::before {
font-family: WooCommerce !important;
content: '\e019';
}
.toplevel_page_flexible-shipping-menu #wpdesk_tracker_notice {
margin: 10px 20px 0 2px;
}
.fs-connect__inner-container {
background-color: #FFF;
margin-bottom: 20px;
}
</style>

View File

@@ -0,0 +1,19 @@
<?php ?>
<div class="alignleft actions">
<select name="flexible_shipping_integration_filter">
<option value=""><?php _e( 'All shippings', 'flexible-shipping' ); ?></option>
<optgroup label="<?php _e( 'Integration', 'flexible-shipping' ); ?>">
<?php foreach ( $integrations as $key => $val ) : ?>
<option value="<?php echo $key; ?>" <?php echo ($key == $integration ? 'selected' : '' ); ?>><?php echo $val; ?></option>
<?php endforeach; ?>
</optgroup>
</select>
<select name="flexible_shipping_status_filter">
<option value=""><?php _e( 'All shippings', 'flexible-shipping' ); ?></option>
<optgroup label="<?php _e( 'Shipment status', 'flexible-shipping' ); ?>">
<?php foreach ( $statuses as $key => $val ) : ?>
<option value="<?php echo $key; ?>" <?php echo ($key == $status ? 'selected' : '' ); ?>><?php echo $val; ?></option>
<?php endforeach; ?>
</optgroup>
</select>
</div>

View File

@@ -0,0 +1,249 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$field = $this->get_field_key( $key );
$options_based_on = apply_filters( 'flexible_shipping_method_rule_options_based_on', array(
'none' => __( 'None', 'flexible-shipping' ),
'value' => __( 'Price', 'flexible-shipping' ),
'weight' => __( 'Weight', 'flexible-shipping' ),
));
$key = 'method_rules[xxx][based_on]';
$args = array(
'type' => 'select',
'options' => $options_based_on,
'return' => true,
);
$value = 'none';
$field_based_on = woocommerce_form_field( $key, $args, $value );
$key = 'method_rules[xxx][min]';
$args = array(
'type' => 'text',
'return' => true,
'input_class' => array( 'wc_input_price' ),
);
$value = '';
$field_min = woocommerce_form_field( $key, $args, wc_format_localized_price( $value ) );
$key = 'method_rules[xxx][max]';
$args = array(
'type' => 'text',
'return' => true,
'input_class' => array( 'wc_input_price' ),
);
$value = '';
$field_max = woocommerce_form_field( $key, $args, wc_format_localized_price( $value ) );
$key = 'method_rules[xxx][cost_per_order]';
$args = array(
'type' => 'text',
'return' => true,
'input_class' => array( 'wc_input_price' ),
);
$value = '';
$field_cost_per_order = woocommerce_form_field( $key, $args, wc_format_localized_price( $value ) );
$count_rules = 0;
?>
<tr valign="top" class="flexible_shipping_method_rules">
<th class="forminp" colspan="2">
<label for="<?php echo esc_attr( $field ); ?>"><?php echo $data['title']; ?></label>
<?php
$fs_pro_link = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/flexible-shipping-pro-woocommerce/' : 'https://flexibleshipping.com/table-rate/';
if ( ! in_array( 'flexible-shipping-pro/flexible-shipping-pro.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ):
?>
<p><?php printf( __( 'Check %sFlexible Shipping PRO &rarr;%s to add advanced rules based on shipment classes, product/item count or additional handling fees/insurance.', 'flexible-shipping' ), '<a href="' . $fs_pro_link . '?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=link&utm_term=flexible-shipping-pro&utm_content=fs-shippingzone-addnew-rules" target="_blank">', '</a>' ); ?></p>
<?php endif; ?>
</th>
</tr>
<tr valign="top" class="flexible_shipping_method_rules">
<td colspan="2" style="padding:0;">
<table id="<?php echo esc_attr( $field ); ?>" class="flexible_shipping_method_rules wc_input_table sortable widefat">
<thead>
<tr>
<th class="sort">&nbsp;</th>
<th class="based_on">
<?php _e( 'Based on', 'flexible-shipping' ); ?>
<span class="woocommerce-help-tip" data-tip="<?php _e( 'Shipping cost will be calculated based on the selected parameter.', 'flexible-shipping' ); ?>"></span>
</th>
<th class="min">
<?php _e( 'Min', 'flexible-shipping' ); ?>
<span class="woocommerce-help-tip" data-tip="<?php _e( 'Enter minimum value for the &quot;Based on&quot; parameter. Value based on the price will be calculated by WooCommerce tax settings &quot;Display prices during cart and checkout&quot;', 'flexible-shipping' ); ?>"></span>
</th>
<th class="max">
<?php _e( 'Max', 'flexible-shipping' ); ?>
<span class="woocommerce-help-tip" data-tip="<?php _e( 'Enter maximum value for the &quot;Based on&quot; parameter. Value based on the price will be calculated by WooCommerce tax settings &quot;Display prices during cart and checkout&quot;', 'flexible-shipping' ); ?>"></span>
</th>
<th class="cost_per_order">
<?php _e( 'Cost per<br/>order', 'flexible-shipping' ); ?>
<span class="woocommerce-help-tip" data-tip="<?php _e( 'Enter shipment cost for this rule.', 'flexible-shipping' ); ?>"></span>
</th>
<?php do_action( 'flexible_shipping_method_rule_thead', '' ); ?>
</tr>
</thead>
<tbody>
<?php if ( isset( $data['default'] ) ) : ?>
<?php foreach ( $data['default'] as $key => $rule ) : $count_rules++; ?>
<tr>
<td class="sort"></td>
<td class="based_on">
<?php
$key = 'method_rules[' . $count_rules . '][based_on]';
$args = array(
'type' => 'select',
'options' => $options_based_on,
);
$value = '';
if ( isset( $rule['based_on'] ) ) {
$value = $rule['based_on'];
}
woocommerce_form_field( $key, $args, $value );
?>
</td>
<td class="min">
<?php
$key = 'method_rules[' . $count_rules . '][min]';
$args = array(
'type' => 'text',
'input_class' => array( 'wc_input_price' ),
);
$value = '';
if ( isset( $rule['min'] ) ) {
$value = $rule['min'];
}
woocommerce_form_field( $key, $args, wc_format_localized_price( $value ) );
?>
</td>
<td class="max">
<?php
$key = 'method_rules[' . $count_rules . '][max]';
$args = array(
'type' => 'text',
'input_class' => array( 'wc_input_price' ),
);
$value = '';
if ( isset( $rule['max'] ) ) {
$value = $rule['max'];
}
woocommerce_form_field( $key, $args, wc_format_localized_price( $value ) );
?>
</td>
<td class="cost_per_order">
<?php
$key = 'method_rules[' . $count_rules . '][cost_per_order]';
$args = array(
'type' => 'text',
'input_class' => array( 'wc_input_price' ),
);
$value = '';
if ( isset( $rule['cost_per_order'] ) ) {
$value = $rule['cost_per_order'];
}
woocommerce_form_field( $key, $args, wc_format_localized_price( $value ) );
?>
</td>
<?php do_action( 'flexible_shipping_method_rule_row', $rule, $count_rules ); ?>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
<tfoot>
<tr>
<th colspan="99">
<a id="insert_rule" href="#" class="button plus insert"><?php _e( 'Insert rule', 'flexible-shipping' ); ?></a>
<a id="remove_rules" href="#" class="button minus"><?php _e( 'Delete selected rules', 'flexible-shipping' ); ?></a>
</th>
</tr>
</tfoot>
</table>
<script type="text/javascript">
function append_row( id ) {
var code = '<tr class="new">\
<td class="sort"></td>\
<td class="based_on">\
<?php echo str_replace( "'", '"', str_replace( "\r", "", str_replace( "\n", "", $field_based_on ) ) ); ?> \
</td>\
<td class="min">\
<?php echo str_replace( "'", '"', str_replace( "\r", "", str_replace( "\n", "", $field_min ) ) ); ?> \
</td>\
<td class="max">\
<?php echo str_replace( "'", '"', str_replace( "\r", "", str_replace( "\n", "", $field_max ) ) ); ?> \
</td>\
<td class="cost_per_order">\
<?php echo str_replace( "'", '"', str_replace( "\r", "", str_replace( "\n", "", $field_cost_per_order ) ) ); ?> \
</td>\
<?php do_action( 'flexible_shipping_method_rule_js', '' ); ?>
</tr>';
var code2 = code.replace(/xxx/g, id );
var $tbody = jQuery('#<?php echo esc_attr( $field ); ?>').find('tbody');
$tbody.append( code2 );
}
jQuery(document).ready(function() {
var tbody = jQuery('#<?php echo esc_attr( $field ); ?>').find('tbody');
var append_id = <?php echo $count_rules ?>;
var size = tbody.find('tr').size();
if ( size == 0 ) {
append_id = append_id+1;
append_row(append_id);
jQuery('#insert_rule').trigger( 'insert_rule' , [append_id] );
}
jQuery('#insert_rule').click(function() {
append_id = append_id+1;
append_row(append_id);
jQuery('#rules_'+append_id+'_min').focus();
jQuery('#insert_rule').trigger( 'insert_rule' , [append_id] );
return false;
});
jQuery('#remove_rules').click(function() {
if ( current = tbody.children( '.current' ) ) {
current.each(function() {
jQuery(this).remove();
});
} else {
alert( '<?php _e( 'No rows selected.' , 'flexible-shipping' ); ?>' );
}
return false;
});
jQuery(document).on('click', '.delete_rule', function() {
if (confirm('<?php _e( 'Are you sure?' , 'flexible-shipping' ); ?>')) {
jQuery(this).closest('tr').remove();
}
return false;
});
jQuery('#mainform').attr('action', '<?php echo remove_query_arg( 'added', add_query_arg( 'added', '1' ) ); ?>' );
});
</script>
<?php
if( version_compare( WC()->version, '2.6.0', ">=" ) ) {
?>
<script type="text/javascript">
<?php
$zone = WC_Shipping_Zones::get_zone_by( 'instance_id', $_GET['instance_id'] );
$shipping_method_woo = WC_Shipping_Zones::get_shipping_method( $_GET['instance_id'] );
$content = '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=shipping' ) . '">' . __( 'Shipping Zones', 'woocommerce' ) . '</a> &gt ';
$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> &gt ';
$content .= '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=shipping&instance_id=' . $_GET['instance_id'] ) . '">' . esc_html( $shipping_method_woo->get_title() ) . '</a>';
if ( isset( $data['method_title'] ) && $data['method_title'] != '' ) {
$content .= ' &gt ';
$content .= esc_html( $data['method_title'] );
}
else {
$content .= ' &gt ';
$content .= __( 'Add New', 'flexible-shipping' );
}
?>
jQuery('#mainform h2').first().replaceWith( '<h2>' + '<?php echo $content; ?>' + '</h2>' );
</script>
<?php
}
?>
</td>
</tr>

View File

@@ -0,0 +1,205 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<tr valign="top">
<td class="forminp" style="padding-left:0;padding-right:0;">
<fieldset>
<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
<table class="flexible_shipping_methods wc_shipping widefat wp-list-table" cellspacing="0">
<thead>
<tr>
<th class="sort">&nbsp;</th>
<th class="title"><?php _e( 'Title', 'flexible-shipping' ); ?></th>
<th class="status"><?php _e( 'Enabled', 'flexible-shipping' ); ?></th>
<th class="visibility"><?php _e( 'Visibility', 'flexible-shipping' ); ?></th>
<th class="default"><?php _e( 'Default', 'flexible-shipping' ); ?></th>
<th class="integration"><?php _e( 'Integration', 'flexible-shipping' ); ?></th>
<th class="select"><input type="checkbox" class="tips checkbox-select-all" value="1" data-tip="<?php _e( 'Select all', 'flexible-shipping' ); ?>" /></th>
</tr>
</thead>
<tbody>
<?php if ( isset( $shipping_method_order ) && is_array( $shipping_method_order ) ) : ?>
<?php foreach ( $shipping_method_order as $shipping_method_id ) : $shipping_method = $shipping_methods[$shipping_method_id]; ?>
<?php $tr_class = ''; ?>
<?php if ( isset( $_GET['added'] ) && $_GET['added'] == $shipping_method_id ) $tr_class = 'highlight'; ?>
<?php if ( isset( $_GET['updated'] ) && $_GET['updated'] == $shipping_method_id ) $tr_class = 'highlight'; ?>
<tr id="method_<?php echo $shipping_method_id; ?>" class="<?php echo $tr_class; ?>">
<td width="1%" class="sort">
<input type="hidden" name="method_order[<?php echo esc_attr( $shipping_method['id'] ); ?>]" value="<?php echo esc_attr( $shipping_method['id'] ); ?>" />
</td>
<td class="title">
<a data-qa-id="shipping-method-<?php echo esc_attr( $shipping_method['method_title'] ); ?>" href="<?php echo add_query_arg( 'method_id' , $shipping_method_id, add_query_arg( 'action', 'edit' ) ); ?>">
<strong><?php echo esc_html( $shipping_method['method_title'] ); ?></strong>
</a>
<?php if ( isset( $shipping_method['method_description'] ) && $shipping_method['method_description'] != '' ) : ?>
(<?php echo esc_html( $shipping_method['method_description'] ); ?>)
<?php endif; ?>
</td>
<td width="1%" class="status">
<?php if ( isset($shipping_method['method_enabled']) && 'yes' === $shipping_method['method_enabled'] ) : ?>
<span class="status-enabled tips" data-tip="<?php _e( 'yes', 'flexible-shipping' ); ?>"><?php _e( 'yes', 'flexible-shipping' ); ?></span>
<?php else : ?>
<span class="na">-</span>
<?php endif; ?>
</td>
<td width="1%" class="default visibility">
<?php if ( isset( $shipping_method['method_visibility'] ) && 'yes' === $shipping_method['method_visibility'] ) : ?>
<span class="status-enabled tips" data-tip="<?php _e( 'Show only for logged in users', 'flexible-shipping' ); ?>"><?php _e( 'yes', 'flexible-shipping' ); ?></span>
<?php else : ?>
<span class="na tips" data-tip="<?php _e( 'Show for all users', 'flexible-shipping' ); ?>">-</span>
<?php endif; ?>
</td>
<td width="1%" class="default">
<?php if ( 'yes' === $shipping_method['method_default'] ) : ?>
<span class="status-enabled tips" data-tip="<?php _e( 'yes', 'flexible-shipping' ); ?>"><?php _e( 'yes', 'flexible-shipping' ); ?></span>
<?php else : ?>
<span class="na">-</span>
<?php endif; ?>
</td>
<?php echo apply_filters( 'flexible_shipping_method_integration_col', '<td width="1%" class="integration default">-</td>', $shipping_method );?>
<td width="1%" class="select" nowrap>
<input type="checkbox" class="tips checkbox-select" value="<?php echo esc_attr( $shipping_method['id'] ); ?>" data-tip="<?php echo esc_html( $shipping_method['method_title'] ); ?>" />
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
<tfoot>
<tr>
<th>&nbsp;</th>
<th colspan="8"><span class="description"><?php _e( 'Drag and drop the above shipment methods to control their display order. Confirm by clicking Save changes button below.', 'flexible-shipping' ); ?></span></th>
</tr>
<tr>
<th>&nbsp;</th>
<th colspan="8">
<button id="flexible_shipping_remove_selected" class="button" disabled><?php _e( 'Remove selected', 'flexible-shipping' ); ?></button>
<div class="flexilble_shipping_export_import">
<input id="flexible_shipping_import_file" type="file" name="import_file" style="display:none;" accept=".csv" />
<input id="flexible_shipping_import_action" type="hidden" name="import_action" value="0" />
<button id="flexible_shipping_import_cancel" class="button" style="display:none;"><?php _e( 'Cancel import', 'flexible-shipping' ); ?></button>
<input id="flexible_shipping_do_import" style="display:none;" class="button button-primary" data-instance-id="<?php echo isset( $_GET['instance_id'] ) ? $_GET['instance_id'] : '1'; ?>" data-nonce="<?php echo wp_create_nonce( "flexible_shipping" ); ?>" type="submit" value="<?php _e( 'Import', 'flexible-shipping' ); ?>" />
<button id="flexible_shipping_import" class="button" data-instance-id="<?php isset( $_GET['instance_id'] ) ? $_GET['instance_id'] : '1'; ?>" data-nonce="<?php echo wp_create_nonce( "flexible_shipping" ); ?>" ><?php _e( 'Import', 'flexible-shipping' ); ?></button>
<?php do_action( 'flexible_shipping_actions_row' ); ?>
</div>
<div style="clear:both;"></div>
</th>
</tr>
</tfoot>
</table>
<?php echo $this->get_description_html( $data ); ?>
</fieldset>
</td>
</tr>
<?php
if ( ! wpdesk_is_plugin_active( 'flexible-shipping-pro/flexible-shipping-pro.php' ) )
include( 'html-ads.php' );
?>
<script type="text/javascript">
<?php
if( version_compare( WC()->version, '2.6.0', ">=" ) ) :
?>
<?php
$zone = WC_Shipping_Zones::get_zone_by( 'instance_id', $_GET['instance_id'] );
$shipping_method_woo = WC_Shipping_Zones::get_shipping_method( $_GET['instance_id'] );
$content = '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=shipping' ) . '">' . __( 'Shipping Zones', 'woocommerce' ) . '</a> &gt ';
$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> &gt';
$content .= esc_html( $shipping_method_woo->get_title() );
?>
jQuery('#mainform h2').first().replaceWith( '<h2>' + '<?php echo $content; ?>' + '</h2>' );
<?php
global $wp;
$current_url = 'admin.php?page=wc-settings&tab=shipping&instance_id=' . $_GET['instance_id'];
?>
jQuery('#mainform').attr('action', '<?php echo $current_url; ?>' );
<?php
endif;
?>
jQuery("input.checkbox-select-all").click(function(){
if ( jQuery(this).is(':checked') ) {
jQuery('input.checkbox-select').prop('checked', true);
}
else {
jQuery('input.checkbox-select').prop('checked', false);
}
})
/**
* Enable Bulk Action Buttons when at least one Shipping Method is selected
*
*/
jQuery( '.flexible_shipping_methods input[type="checkbox"]' ).click( function() {
jQuery( '#flexible_shipping_export_selected, #flexible_shipping_remove_selected' ).attr( 'disabled', ! jQuery( '.flexible_shipping_methods td input[type="checkbox"]' ).is( ':checked' ) );
} );
jQuery('#flexible_shipping_remove_selected').click(function(){
var url = '<?php echo add_query_arg( 'methods_id' , '', add_query_arg( 'action', 'delete' ) ); ?>';
var first = true;
jQuery('input.checkbox-select').each(function(){
if ( jQuery(this).is(':checked')) {
if ( !first ) {
url = url + ',';
}
else {
url = url + '=';
}
url = url + jQuery(this).val();
first = false;
}
})
if ( first ) {
alert( '<?php _e( 'Please select shipment methods to remove', 'flexible-shipping' ); ?>' );
return false;
}
if ( url != '<?php echo add_query_arg( 'method_id' , '', add_query_arg( 'action', 'delete' ) ); ?>' ) {
jQuery('#flexible_shipping_remove_selected').prop('disabled',true);
jQuery('.woocommerce-save-button').prop('disabled',true);
window.location.href = url;
}
return false;
})
jQuery('#flexible_shipping_import').click(function(){
jQuery(this).hide();
jQuery('#flexible_shipping_do_import').show();
jQuery('#flexible_shipping_import_file').show();
jQuery('#flexible_shipping_import_cancel').show();
jQuery('input[name=save]').prop('disabled',true);
return false;
})
jQuery('#flexible_shipping_import_cancel').click(function(){
jQuery(this).hide();
jQuery('#flexible_shipping_do_import').hide();
jQuery('#flexible_shipping_import_file').hide();
jQuery('#flexible_shipping_import_cancel').hide();
jQuery('#flexible_shipping_import').show();
jQuery('input[name=save]').prop('disabled',false);
return false;
})
jQuery('#flexible_shipping_do_import').click(function(){
if ( jQuery('#flexible_shipping_import_file').val() == '' ) {
alert('<?php _e( 'Select file to import', 'flexible-shipping' ); ?>');
return false;
}
jQuery('#flexible_shipping_import_action').val('1');
jQuery('input[name=save]').prop('disabled',false);
jQuery('.woocommerce-save-button').click();
return false;
})
<?php
if ( isset( $_POST['import_action'] ) && $_POST['import_action'] == '1' ) {
?>
jQuery('.updated.inline:lt(1)').hide();
jQuery('.updated.inline:lt(2)').hide();
<?php
}
?>
</script>
<?php

View File

@@ -0,0 +1,76 @@
<?php
/**
* @var $integration_checkbox bool
* @var $show_fs_connect bool
*/
$pl = get_locale() === 'pl_PL';
$youtube_url = 'https://www.youtube.com/embed/qsFvYoiNDgU';
$general_settings_url = $pl ? 'https://www.wpdesk.pl/docs/flexible-shipping-pro-woocommerce-docs/?utm_source=flexible-shipping-info&utm_medium=link&utm_campaign=flexible-shipping-resources-box&utm_content=general-settings#Ustawienia_glowne' : 'https://docs.flexibleshipping.com/article/25-general-settings/?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=link&utm_term=general-settings&utm_content=fs-configuration-flexibleshippingtablerate';
$adding_a_shipping_method_url = $pl ? 'https://www.wpdesk.pl/docs/flexible-shipping-pro-woocommerce-docs/?utm_source=flexible-shipping-info&utm_medium=link&utm_campaign=flexible-shipping-resources-box&utm_content=adding-a-shipping-method#Metody_wysylki' : 'https://docs.flexibleshipping.com/article/29-shipping-methods/?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=link&utm_term=adding-a-shipping-method&utm_content=fs-configuration-flexibleshippingtablerate';
$currency_support_url = $pl ? 'https://www.wpdesk.pl/docs/flexible-shipping-pro-woocommerce-docs/?utm_source=flexible-shipping-info&utm_medium=link&utm_campaign=flexible-shipping-resources-box&utm_content=currency-support#Waluty' : 'https://docs.flexibleshipping.com/article/30-currency-support/?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=link&utm_term=currency-support&utm_content=fs-configuration-flexibleshippingtablerate';
$weight_based_shipping_url = $pl ? 'https://www.wpdesk.pl/docs/flexible-shipping-pro-woocommerce-docs/?utm_source=flexible-shipping-info&utm_medium=link&utm_campaign=flexible-shipping-resources-box&utm_content=weight-based-shipping#Koszt_na_wage' : 'https://docs.flexibleshipping.com/article/32-weight-based-shipping-woocommerce/?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=link&utm_term=weight-based-shipping&utm_content=fs-configuration-flexibleshippingtablerate';
$shipping_insurance_url = $pl ? 'https://www.wpdesk.pl/docs/flexible-shipping-pro-woocommerce-docs/?utm_source=flexible-shipping-info&utm_medium=link&utm_campaign=flexible-shipping-resources-box&utm_content=shipping-insurance#Ubezpieczenie_przesylki' : 'https://docs.flexibleshipping.com/article/34-shipping-insurance/?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=link&utm_term=shipping-insurance&utm_content=fs-configuration-flexibleshippingtablerate';
$conditional_cash_on_delivery_url = $pl ? 'https://www.wpdesk.pl/docs/flexible-shipping-pro-woocommerce-docs/?utm_source=flexible-shipping-info&utm_medium=link&utm_campaign=flexible-shipping-resources-box&utm_content=conditional-cash-on-delivery#Przesylka_za_pobraniem' : 'https://docs.flexibleshipping.com/article/35-conditional-cash-on-delivery/?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=link&utm_term=contitional-cash-on-delivery&utm_content=fs-configuration-flexibleshippingtablerate';
?>
</table>
<div class="fs-page-wrap">
<div class="fs-box">
<h3 class="wc-settings-sub-title"><?php _e( 'How to use Flexible Shipping?', 'flexible-shipping' ); ?></h3>
<ol>
<li>
<?php
echo sprintf(
__( 'To add first Flexible Shipping method go to %sShipping zones%s and add Flexible Shipping to a shipping zone.', 'flexible-shipping' ),
'<a href="' . admin_url( 'admin.php?page=wc-settings&tab=shipping&section' ) . '">',
'</a>'
);
?>
</li>
<li><?php _e( 'You can start the configuration by clicking the Flexible Shipping link in the Shipping methods table.', 'flexible-shipping' ); ?></li>
</ol>
<h4><?php _e( 'Quick Video Overview', 'flexible-shipping' ); ?></h4>
<div class="flexible-shipping-video">
<iframe width="688" height="387" src="<?php echo $youtube_url?>?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
<h4><?php _e( 'More resources', 'flexible-shipping' ); ?></h4>
<ul>
<li><a href="<?php echo $general_settings_url; ?>"><?php _e( 'General Settings', 'flexible-shipping' ); ?></a></li>
<li><a href="<?php echo $adding_a_shipping_method_url; ?>"><?php _e( 'Adding a shipping method', 'flexible-shipping' ); ?></a></li>
<li><a href="<?php echo $currency_support_url; ?>"><?php _e( 'Currency Support', 'flexible-shipping' ); ?></a></li>
<li><a href="<?php echo $weight_based_shipping_url; ?>"><?php _e( 'Weight Based Shipping', 'flexible-shipping' ); ?></a></li>
<li><a href="<?php echo $shipping_insurance_url; ?>"><?php _e( 'Shipping Insurance', 'flexible-shipping' ); ?></a></li>
<li><a href="<?php echo $conditional_cash_on_delivery_url; ?>"><?php _e( 'Conditional Cash on Delivery', 'flexible-shipping' ); ?></a></li>
</ul>
<?php if ( $show_fs_connect ) : ?>
<h3 class="wc-settings-sub-title fs-connect-box-header"><?php _e( 'Integrations', 'flexible-shipping' ); ?></h3>
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row" class="titledesc">
<label for="enable-fs-connect-box"><?php _e( 'FS Connect', 'flexible-shipping' ); ?></label>
</th>
<td class="forminp">
<fieldset>
<legend class="screen-reader-text"><span><?php _e( 'FS Connect', 'flexible-shipping' ); ?></span></legend>
<label for="enable-fs-connect-box">
<input class="enable-fs-connect-box" <?php checked( $integration_checkbox, 1 ); ?> type="checkbox" name="fsconnect_box" id="enable-fs-connect-box" style="" value="1"> <?php _e( 'Enable integration with Flexible Shipping Connect', 'flexible-shipping' ); ?>
</label>
</fieldset>
</td>
</tr>
</tbody>
</table>
<?php endif; ?>
</div>
</div>
<table>

View File

@@ -0,0 +1,55 @@
<?php
/**
* @var $integration_checkbox bool
* @var $show_fs_connect bool
*/
$pl = get_locale() === 'pl_PL';
$youtube_url = 'https://www.youtube.com/embed/qsFvYoiNDgU';
$general_settings_url = $pl ? 'https://www.wpdesk.pl/docs/flexible-shipping-pro-woocommerce-docs/?utm_source=flexible-shipping-info&utm_medium=link&utm_campaign=flexible-shipping-resources-box&utm_content=general-settings#Ustawienia_glowne' : 'https://docs.flexibleshipping.com/article/25-general-settings/?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=link&utm_term=general-settings&utm_content=fs-configuration-flexibleshippingtablerate';
$adding_a_shipping_method_url = $pl ? 'https://www.wpdesk.pl/docs/flexible-shipping-pro-woocommerce-docs/?utm_source=flexible-shipping-info&utm_medium=link&utm_campaign=flexible-shipping-resources-box&utm_content=adding-a-shipping-method#Metody_wysylki' : 'https://docs.flexibleshipping.com/article/29-shipping-methods/?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=link&utm_term=adding-a-shipping-method&utm_content=fs-configuration-flexibleshippingtablerate';
$currency_support_url = $pl ? 'https://www.wpdesk.pl/docs/flexible-shipping-pro-woocommerce-docs/?utm_source=flexible-shipping-info&utm_medium=link&utm_campaign=flexible-shipping-resources-box&utm_content=currency-support#Waluty' : 'https://docs.flexibleshipping.com/article/30-currency-support/?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=link&utm_term=currency-support&utm_content=fs-configuration-flexibleshippingtablerate';
$weight_based_shipping_url = $pl ? 'https://www.wpdesk.pl/docs/flexible-shipping-pro-woocommerce-docs/?utm_source=flexible-shipping-info&utm_medium=link&utm_campaign=flexible-shipping-resources-box&utm_content=weight-based-shipping#Koszt_na_wage' : 'https://docs.flexibleshipping.com/article/32-weight-based-shipping-woocommerce/?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=link&utm_term=weight-based-shipping&utm_content=fs-configuration-flexibleshippingtablerate';
$shipping_insurance_url = $pl ? 'https://www.wpdesk.pl/docs/flexible-shipping-pro-woocommerce-docs/?utm_source=flexible-shipping-info&utm_medium=link&utm_campaign=flexible-shipping-resources-box&utm_content=shipping-insurance#Ubezpieczenie_przesylki' : 'https://docs.flexibleshipping.com/article/34-shipping-insurance/?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=link&utm_term=shipping-insurance&utm_content=fs-configuration-flexibleshippingtablerate';
$conditional_cash_on_delivery_url = $pl ? 'https://www.wpdesk.pl/docs/flexible-shipping-pro-woocommerce-docs/?utm_source=flexible-shipping-info&utm_medium=link&utm_campaign=flexible-shipping-resources-box&utm_content=conditional-cash-on-delivery#Przesylka_za_pobraniem' : 'https://docs.flexibleshipping.com/article/35-conditional-cash-on-delivery/?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=link&utm_term=contitional-cash-on-delivery&utm_content=fs-configuration-flexibleshippingtablerate';
?>
</table>
<div class="fs-page-wrap">
<div class="fs-box">
<h3 class="wc-settings-sub-title"><?php _e( 'How to use Flexible Shipping?', 'flexible-shipping' ); ?></h3>
<ol>
<li>
<?php
echo sprintf(
__( 'To add first Flexible Shipping method go to %sShipping zones%s and add Flexible Shipping to a shipping zone.', 'flexible-shipping' ),
'<a href="' . admin_url( 'admin.php?page=wc-settings&tab=shipping&section' ) . '">',
'</a>'
);
?>
</li>
<li><?php _e( 'You can start the configuration by clicking the Flexible Shipping link in the Shipping methods table.', 'flexible-shipping' ); ?></li>
</ol>
<h4><?php _e( 'Quick Video Overview', 'flexible-shipping' ); ?></h4>
<div class="flexible-shipping-video">
<iframe width="688" height="387" src="<?php echo $youtube_url?>?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
<h4><?php _e( 'More resources', 'flexible-shipping' ); ?></h4>
<ul>
<li><a href="<?php echo $general_settings_url; ?>"><?php _e( 'General Settings', 'flexible-shipping' ); ?></a></li>
<li><a href="<?php echo $adding_a_shipping_method_url; ?>"><?php _e( 'Adding a shipping method', 'flexible-shipping' ); ?></a></li>
<li><a href="<?php echo $currency_support_url; ?>"><?php _e( 'Currency Support', 'flexible-shipping' ); ?></a></li>
<li><a href="<?php echo $weight_based_shipping_url; ?>"><?php _e( 'Weight Based Shipping', 'flexible-shipping' ); ?></a></li>
<li><a href="<?php echo $shipping_insurance_url; ?>"><?php _e( 'Shipping Insurance', 'flexible-shipping' ); ?></a></li>
<li><a href="<?php echo $conditional_cash_on_delivery_url; ?>"><?php _e( 'Conditional Cash on Delivery', 'flexible-shipping' ); ?></a></li>
</ul>
</div>
</div>
<table>