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,140 @@
<?php
/** @var bool $is_without_any_settings */
$is_without_any_settings = $args['is_without_any_settings'];
?>
<form action="" method="post">
<?php settings_fields( 'woocommerce_activepayments_settings' ); ?>
<?php if (!empty($_POST['option_page']) && $_POST['option_page'] === 'woocommerce_activepayments_settings'): ?>
<div id="message" class="updated fade"><p><strong><?php _e( 'Settings saved.', 'woocommerce_activepayments' ); ?></strong></p></div>
<?php endif; ?>
<?php
$plugin_link = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/flexible-shipping-pro-woocommerce/' : 'https://www.wpdesk.net/products/flexible-shipping-pro-woocommerce/';
$utm = '?utm_source=active-payments-settings&utm_medium=link&utm_campaign=active-payments-fs-pro-main-link'
?>
<p><?php _e( 'Select which payments methods will be available for shipping methods.', 'woocommerce_activepayments' ); ?> <?php printf( wp_kses( __( 'Active Payments works great with <a href="%s" target="_blank">Flexible Shipping for WooCommerce</a>.', 'woocommerce_activepayments' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( $plugin_link . $utm ) ); ?></p>
<table class="active-payments-main widefat">
<colgroup></colgroup>
<?php for($i = 0; $i < count($args['paymentGateways']); $i++): ?>
<colgroup></colgroup>
<?php endfor; ?>
<thead>
<tr>
<th width="250"></th>
<?php foreach ( $args['paymentGateways'] as $payment ): ?>
<th><?php echo $payment->get_title(); ?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ( $args['shippingMethods'] as $method ): ?>
<?php $title = $method->get_title(); ?>
<?php if ($method->enabled == 'yes'): ?>
<?php if (!empty($title) && !in_array($method->id, array('flat_rate', 'table_rate_shipping', 'kurjerzy_shipping_method', 'flexible_shipping')) ): ?>
<tr>
<th><?php echo $title; ?></th>
<?php foreach ($args['paymentGateways'] as $payment): ?>
<td>
<label for="payment_method_<?php echo $method->id?>_<?php echo $payment->id?>">
<input type="checkbox" <?php if ($this->getSettingValue('pm_' . md5($method->id . '_' . $payment->id), $is_without_any_settings) != ''): ?>checked="checked"<?php endif; ?> id="payment_method_<?php echo $method->id?>_<?php echo $payment->id?>" name="payment_method[<?php echo $method->id?>][<?php echo $payment->id?>]" value="1" />
</label>
</td>
<?php endforeach; ?>
</tr>
<?php endif; ?>
<?php if ($method->id == 'flat_rate'): ?>
<?php $options = ActivePayments::get_options_from_gateway($method); ?>
<?php foreach ($options as $methodOption): ?>
<?php //$x = new WC_Shipping_Flat_Rate();
$fname = @trim(reset(explode('|', $methodOption)));
$fname_id = ActivePayments::generate_flat_id_from_title($fname);
?>
<tr>
<th><?php if (!empty($title)): ?><?php echo $title; ?> - <?php endif; ?><?php echo $fname ?></th>
<?php foreach ($args['paymentGateways'] as $payment): ?>
<td>
<label for="payment_method_<?php echo $method->id?>_<?php echo $fname_id; ?>_<?php echo $payment->id?>">
<input type="checkbox" <?php if ($this->getSettingValue('pm_' . md5($method->id . '_' . $payment->id . '_' . $fname_id), $is_without_any_settings) != ''): ?>checked="checked"<?php endif; ?> id="payment_method_<?php echo $method->id?>_<?php echo $fname_id; ?>_<?php echo $payment->id?>" name="payment_method[<?php echo $method->id?>:<?php echo $fname_id; ?>][<?php echo $payment->id?>]" value="1" />
</label>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
<?php elseif($method->id == 'table_rate_shipping'): // table rate shipping intergration ?>
<?php foreach ($args['shippingTableMethods'] as $stMethod): ?>
<tr>
<th><?php echo $stMethod['title'] ?></th>
<?php foreach ($args['paymentGateways'] as $payment): ?>
<td>
<label for="payment_method_<?php echo $method->id?>_<?php echo $stMethod['identifier']; ?>_<?php echo $payment->id?>">
<input type="checkbox" <?php if ($this->getSettingValue('pm_' . md5($method->id . '_' . $payment->id . '_' . $stMethod['identifier']), $is_without_any_settings) != ''): ?>checked="checked"<?php endif; ?> id="payment_method_<?php echo $method->id?>_<?php echo $stMethod['identifier']; ?>_<?php echo $payment->id?>" name="payment_method[<?php echo $method->id?>:<?php echo $stMethod['identifier']; ?>][<?php echo $payment->id?>]" value="1" />
</label>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
<?php elseif($method->id == 'flexible_shipping'): /* flexible shipping intergration */ ?>
<?php foreach ($args['shippingFSMethods'] as $stMethod): ?>
<tr>
<th><?php echo $stMethod['title'] ?></th>
<?php foreach ($args['paymentGateways'] as $payment): ?>
<td>
<label for="payment_method_<?php echo $method->id?>_<?php echo $stMethod['identifier']; ?>_<?php echo $payment->id?>">
<input type="checkbox" <?php if ($this->getSettingValue('pm_' . md5($method->id . '_' . $payment->id . '_' . $stMethod['identifier']), $is_without_any_settings) != ''): ?>checked="checked"<?php endif; ?> id="payment_method_<?php echo $method->id?>_<?php echo $stMethod['identifier']; ?>_<?php echo $payment->id?>" name="payment_method[<?php echo $method->id?>:<?php echo $stMethod['identifier']; ?>][<?php echo $payment->id?>]" value="1" />
</label>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
<?php foreach ($args['shippingFSMethods_woo'] as $stMethod): ?>
<tr>
<th><?php echo $stMethod['title'] ?></th>
<?php foreach ($args['paymentGateways'] as $payment): ?>
<td>
<label for="payment_method_<?php echo $method->id?>_<?php echo $stMethod['identifier']; ?>_<?php echo $payment->id?>">
<input type="checkbox" <?php if ($this->getSettingValue('pm_' . md5($method->id . '_' . $payment->id . '_' . $stMethod['identifier']), $is_without_any_settings) != ''): ?>checked="checked"<?php endif; ?> id="payment_method_<?php echo $method->id?>_<?php echo $stMethod['identifier']; ?>_<?php echo $payment->id?>" name="payment_method[<?php echo $method->id?>:<?php echo $stMethod['identifier']; ?>][<?php echo $payment->id?>]" value="1" />
</label>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
<?php elseif($method->id == 'kurjerzy_shipping_method'): // kurJerzy intergration ?>
<?php //foreach ($args['shippingTableMethods'] as $stMethod): ?>
<?php foreach($method->couriers as $courier): ?>
<tr>
<th>kurJerzy - <?php echo $courier; ?></th>
<?php foreach ($args['paymentGateways'] as $payment): ?>
<td>
<label for="payment_method_<?php echo $method->id?>_<?php echo $courier?>_<?php echo $payment->id?>">
<input type="checkbox" <?php if ($this->getSettingValue('pm_' . md5($method->id . '_' . $courier . '_' . $payment->id ), $is_without_any_settings) != ''): ?>checked="checked"<?php endif; ?> id="payment_method_<?php echo $method->id?>_<?php echo $courier?>_<?php echo $payment->id?>" name="payment_method[<?php echo $method->id?>_<?php echo $courier?>][<?php echo $payment->id?>]" value="1" />
</label>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach ?>
<?php //endforeach; ?>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
<tr>
<th><?php _e( 'Disable Payment Method', 'woocommerce_activepayments' ); ?> <?php echo wc_help_tip( __( 'Disable payment method above entered cart total (shipping costs excluded)', 'woocommerce_activepayments' ) ); ?></th>
<?php foreach ($args['paymentGateways'] as $payment): ?>
<td><input class="amount" type="number" step="any" min="0" name="payment_method[<?php echo $payment->id?>][amount]" value="<?php echo $this->getSettingValue('pm_' . md5($payment->id . '_amount')) ?>" /></td>
<?php endforeach; ?>
</tr>
</tbody>
</table>
<p class="submit"><input type="submit" value="<?php _e( 'Save Changes', 'woocommerce_activepayments' ); ?>" class="button button-primary" id="submit" name=""></p>
</form>

View File

@@ -0,0 +1,173 @@
<?php
/** @var bool $is_without_any_settings */
$is_without_any_settings = $args['is_without_any_settings'];
$ap_options = $args['ap_options'];
?>
<form action="" method="post">
<?php settings_fields( 'woocommerce_activepayments_settings' ); ?>
<?php wp_nonce_field( 'save_settings', $this->plugin->get_namespace() ); ?>
<?php if (!empty($_POST['option_page']) && $_POST['option_page'] === 'woocommerce_activepayments_settings'): ?>
<div id="message" class="updated fade"><p><strong><?php _e( 'Settings saved.', 'woocommerce_activepayments' ); ?></strong></p></div>
<?php endif; ?>
<?php
$plugin_link = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/flexible-shipping-pro-woocommerce/' : 'https://www.wpdesk.net/products/flexible-shipping-pro-woocommerce/';
$utm = '?utm_source=active-payments-settings&utm_medium=link&utm_campaign=active-payments-fs-pro-main-link'
?>
<p><?php _e( 'Select which payments methods will be available for shipping methods.', 'woocommerce_activepayments' ); ?> <?php printf( wp_kses( __( 'Active Payments works great with <a href="%s" target="_blank">Flexible Shipping for WooCommerce</a>.', 'woocommerce_activepayments' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( $plugin_link . $utm ) ); ?></p>
<table class="active-payments-main widefat">
<colgroup></colgroup>
<?php for($i = 0; $i < count($args['paymentGateways']); $i++): ?>
<colgroup></colgroup>
<?php endfor; ?>
<thead>
<tr>
<th width="250"></th>
<?php foreach ( $args['paymentGateways'] as $payment ): ?>
<th><?php echo $payment->get_title(); ?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ( $args['shippingZones'] as $zone ): ?>
<tr class="shipping-zone">
<th><strong><?php echo $zone['zone_name']; ?></strong></th>
<?php for($i = 0; $i < count($args['paymentGateways']); $i++): ?>
<td></td>
<?php endfor; ?>
</tr>
<?php foreach ( $args['shippingMethods'][$zone['zone_id']] as $method ): ?>
<?php $title = $method->get_title(); ?>
<?php if ($method->enabled == 'yes'): ?>
<?php if (!empty($title) && !in_array($method->id, array('flat_rate_', 'table_rate_shipping', 'kurjerzy_shipping_method', 'flexible_shipping')) ): ?>
<tr>
<th><?php echo $title; ?></th>
<?php foreach ($args['paymentGateways'] as $payment): ?>
<?php $checked = ''; ?>
<?php
if ( ( isset( $ap_options[$method->id . ':' . $method->instance_id] )
&& isset( $ap_options[$method->id . ':' . $method->instance_id ][$payment->id] )
&& $ap_options[$method->id . ':' . $method->instance_id][$payment->id] == '1') || $is_without_any_settings) {
$checked = 'checked="checked"';
}
?>
<td>
<label for="payment_method_<?php echo $method->id?>_<?php echo $payment->id?>">
<input type="checkbox" <?php echo $checked; ?> id="payment_method_<?php echo $zone['zone_id']; ?>_<?php echo $method->id . '_' . $method->instance_id; ?>_<?php echo $payment->id?>" name="payment_method[<?php echo $method->id . ':' . $method->instance_id; ?>][<?php echo $payment->id?>]" value="1" />
</label>
</td>
<?php endforeach; ?>
</tr>
<?php endif; ?>
<?php if ($method->id == 'flat_rate_'): ?>
<?php $options = ActivePayments::get_options_from_gateway($method); ?>
<?php foreach ($options as $methodOption): ?>
<?php //$x = new WC_Shipping_Flat_Rate();
$fname = @trim(reset(explode('|', $methodOption)));
$fname_id = ActivePayments::generate_flat_id_from_title($fname);
?>
<tr>
<th><?php if (!empty($title)): ?><?php echo $title; ?> - <?php endif; ?><?php echo $fname ?></th>
<?php foreach ($args['paymentGateways'] as $payment): ?>
<td>
<label for="payment_method_<?php echo $method->id?>_<?php echo $fname_id; ?>_<?php echo $payment->id?>">
<input type="checkbox" <?php if ($this->plugin->get_setting_value('pm_' . md5($method->id . '_' . $payment->id . '_' . $fname_id), $is_without_any_settings) != ''): ?>checked="checked"<?php endif; ?> id="payment_method_<?php echo $method->id?>_<?php echo $fname_id; ?>_<?php echo $payment->id?>" name="payment_method[<?php echo $method->id?>:<?php echo $fname_id; ?>][<?php echo $payment->id?>]" value="1" />
</label>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
<?php elseif($method->id == 'table_rate_shipping'): // table rate shipping intergration ?>
<?php foreach ($args['shippingTableMethods'] as $stMethod): ?>
<tr>
<th><?php echo $stMethod['title'] ?></th>
<?php foreach ($args['paymentGateways'] as $payment): ?>
<td>
<label for="payment_method_<?php echo $method->id?>_<?php echo $stMethod['identifier']; ?>_<?php echo $payment->id?>">
<input type="checkbox" <?php if ($this->plugin->get_setting_value('pm_' . md5($method->id . '_' . $payment->id . '_' . $stMethod['identifier']), $is_without_any_settings) != ''): ?>checked="checked"<?php endif; ?> id="payment_method_<?php echo $method->id?>_<?php echo $stMethod['identifier']; ?>_<?php echo $payment->id?>" name="payment_method[<?php echo $method->id?>:<?php echo $stMethod['identifier']; ?>][<?php echo $payment->id?>]" value="1" />
</label>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
<?php elseif($method->id == 'flexible_shipping'): /* flexible shipping intergration */ ?>
<?php if ( isset( $args['shippingFSMethods'][$method->shipping_methods_option] ) ) : ?>
<?php foreach ($args['shippingFSMethods'][$method->shipping_methods_option] as $stMethod): ?>
<tr>
<th><?php echo $stMethod['method_title'] ?></th>
<?php foreach ($args['paymentGateways'] as $payment): ?>
<?php
$id = $method->id . '_' . $method->instance_id . '_' . sanitize_title( $stMethod['method_title'] );
$id = apply_filters( 'flexible_shipping_method_rate_id', $id, $stMethod );
$checked = '';
if ( ( isset( $ap_options[$id] )
&& isset( $ap_options[$id] )
&& isset( $ap_options[$id][$payment->id] )
&& $ap_options[$id][$payment->id] == '1' ) || $is_without_any_settings
) {
$checked = 'checked="checked"';
}
?>
<td>
<label for="payment_method_<?php echo $zone['zone_id']; ?>_<?php echo $method->id?>_<?php echo $stMethod['id']; ?>_<?php echo $payment->id?>">
<input type="checkbox" <?php echo $checked; ?> id="payment_method<?php echo $zone['zone_id']; ?>_<?php echo $method->id?>_<?php echo $method->instance_id; ?>_<?php echo $stMethod['id']; ?>_<?php echo $payment->id?>" name="payment_method[<?php echo $id; ?>][<?php echo $payment->id?>]" value="1" />
</label>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
<?php endif; ?>
<?php elseif($method->id == 'kurjerzy_shipping_method'): // kurJerzy intergration ?>
<?php //foreach ($args['shippingTableMethods'] as $stMethod): ?>
<?php if ( isset( $method->couriers ) && is_array( $method->couriers ) ) : ?>
<?php foreach( $method->couriers as $courier): ?>
<tr>
<th>kurJerzy - <?php echo $courier; ?></th>
<?php foreach ($args['paymentGateways'] as $payment): ?>
<?php $checked = ''; ?>
<?php
if ( (isset( $ap_options[$method->id . '_' . $courier] )
&& isset( $ap_options[$method->id . '_' . $courier][$payment->id] )
&& $ap_options[$method->id . '_' . $courier][$payment->id] == '1') || $is_without_any_settings ) {
$checked = 'checked="checked"';
}
?>
<td>
<label for="payment_method_<?php echo $method->id?>_<?php echo $courier?>_<?php echo $payment->id?>">
<input type="checkbox" <?php echo $checked ?> id="payment_method_<?php echo $method->id?>_<?php echo $courier?>_<?php echo $payment->id?>" name="payment_method[<?php echo $method->id?>_<?php echo $courier?>][<?php echo $payment->id?>]" value="1" />
</label>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach ?>
<?php endif; ?>
<?php //endforeach; ?>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</tbody>
<tfoot>
<tr>
<th><?php _e( 'Disable Payment Method', 'woocommerce_activepayments' ); ?> <?php echo wc_help_tip( __( 'Disable payment method above entered cart total (shipping costs excluded)', 'woocommerce_activepayments' ) ); ?></th>
<?php foreach ($args['paymentGateways'] as $payment): ?>
<td><input class="amount" type="number" step="any" min="0" name="payment_method[<?php echo $payment->id?>][amount]" value="<?php echo $this->plugin->get_setting_value('pm_' . md5($payment->id . '_amount')) ?>" /></td>
<?php endforeach; ?>
</tr>
</tfoot>
</table>
<p class="submit"><input type="submit" value="<?php _e( 'Save Changes', 'woocommerce_activepayments' ); ?>" class="button button-primary" id="submit" name=""></p>
</form>

View File

@@ -0,0 +1,69 @@
<?php
if ( ! function_exists( 'wc_help_tip' ) ) {
function wc_help_tip( $tip, $allow_html = false ) {
if ( $allow_html ) {
$tip = wc_sanitize_tooltip( $tip );
} else {
$tip = esc_attr( $tip );
}
return '<span class="woocommerce-help-tip" data-tip="' . $tip . '"></span>';
}
}
if ( ! function_exists( 'woocommerce_form_field' ) ) {
$wc_template_functions = trailingslashit( dirname( __FILE__) ) . '../../../woocommerce/includes/wc-template-functions.php';
if ( file_exists( $wc_template_functions ) ) {
include_once( $wc_template_functions );
}
}
?>
<p><?php _e( 'Fees configuration for payment methods.', 'woocommerce_activepayments' ); ?></p>
<form action="" method="post">
<?php wp_nonce_field( 'save_settings', $this->plugin->get_namespace() ); ?>
<?php settings_fields( 'woocommerce_activepayments_settings_fees' ); ?>
<?php if (!empty($_POST['option_page']) && $_POST['option_page'] === 'woocommerce_activepayments_settings_fees') : ?>
<div id="message" class="updated fade"><p><strong><?php _e( 'Settings saved.', 'woocommerce_activepayments' ); ?></strong></p></div>
<?php endif; ?>
<table class="active-payments-fees wc_input_table widefat">
<thead>
<tr>
<th><?php _e( 'Payment Method', 'woocommerce_activepayments' ); ?></th>
<th class="sort"><?php _e( 'Enable', 'woocommerce_activepayments' ); ?></th>
<th><?php _e( 'Fee Title', 'woocommerce_activepayments' ); ?> <?php echo wc_help_tip( __( 'Enter fee title, used in the checkout and order summary.', 'woocommerce_activepayments' ) ); ?></th>
<?php $calc_taxes = get_option('woocommerce_calc_taxes') == 'yes' ? true : false; ?>
<?php if ( $calc_taxes ) : ?>
<th><?php _e( 'Tax Class', 'woocommerce_activepayments' ); ?> <?php echo wc_help_tip( __( 'Select tax class for calculating fee amount.', 'woocommerce_activepayments' ) ); ?></th>
<?php endif; ?>
<th><?php _e( 'Min Order Total', 'woocommerce_activepayments' ); ?> <?php echo wc_help_tip( __( 'Enter Minimum Order Total (including shipping).', 'woocommerce_activepayments' ) ); ?></th>
<th><?php _e( 'Max Order Total', 'woocommerce_activepayments' ); ?> <?php echo wc_help_tip( __( 'Enter Maximum Order Total (including shipping)', 'woocommerce_activepayments' ) ); ?></th>
<th><?php _e( 'Type', 'woocommerce_activepayments' ); ?> <?php echo wc_help_tip( __( 'Select fixed value or percentage of order total.', 'woocommerce_activepayments' ) ); ?></th>
<th><?php _e( 'Amount', 'woocommerce_activepayments' ); ?> <?php echo wc_help_tip( __( 'Enter fixed value or percent. Based value for calculation is depended on shop tax settings (with or without tax). Calculated value is always without tax.', 'woocommerce_activepayments' ) ); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ( $paymentGateways as $paymentGateway ): ?>
<?php $title = $paymentGateway->get_title(); ?>
<?php if ( $paymentGateway->enabled == 'yes'): ?>
<tr>
<td class="title"><?php echo $title; ?></td>
<?php $this->ap_settings_fees_row( $ap_options_fees, $paymentGateway->id ); ?>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
<p class="submit"><input type="submit" value="<?php _e( 'Save Changes', 'woocommerce_activepayments' ); ?>" class="button button-primary" id="submit" name=""></p>
</form>
<script type="text/javascript">
var tiptip_args = {
'attribute': 'data-tip',
'fadeIn': 50,
'fadeOut': 50,
'delay': 200
};
jQuery( '.tips, .help_tip, .woocommerce-help-tip' ).tipTip( tiptip_args );
</script>

View File

@@ -0,0 +1,153 @@
<td class="checkbox">
<?php
$params = array(
'id' => 'payment_fees[' . $method_id . '][enabled]',
'type' => 'checkbox',
'label' => false,
);
if ( !isset( $ap_options_fees[$method_id]['enabled'] ) ) {
$ap_options_fees[$method_id]['enabled'] = '0';
}
woocommerce_form_field(
$params['id'],
$params,
$ap_options_fees[$method_id]['enabled']
);
?>
</td>
<td>
<?php
$params = array(
'id' => 'payment_fees[' . $method_id . '][title]',
'type' => 'text',
'label' => false,
);
if ( !isset( $ap_options_fees[$method_id]['title'] ) ) {
$ap_options_fees[$method_id]['title'] = '';
}
woocommerce_form_field(
$params['id'],
$params,
$ap_options_fees[$method_id]['title']
);
?>
</td>
<?php $calc_taxes = get_option('woocommerce_calc_taxes') == 'yes' ? true : false; ?>
<?php if ( $calc_taxes ) : ?>
<td>
<?php
$tax_options = array(
'' => __( 'Standard', 'woocommerce' )
);
$tax_classes = WC_Tax::get_tax_classes();
if ( ! empty( $tax_classes ) )
foreach ( $tax_classes as $class ) {
$tax_options[ sanitize_title( $class ) ] = esc_html( $class );
}
$tax_options['-none-'] = __( 'None', 'woocommerce_activepayments' );
$params = array(
'id' => 'payment_fees[' . $method_id . '][tax_class]',
'type' => 'select',
'label' => false,
'options' => $tax_options
);
if ( !isset( $ap_options_fees[$method_id]['tax_class'] ) ) {
$ap_options_fees[$method_id]['tax_class'] = '';
}
woocommerce_form_field(
$params['id'],
$params,
$ap_options_fees[$method_id]['tax_class']
);
?>
</td>
<?php endif; ?>
<td>
<?php
$params = array(
'id' => 'payment_fees[' . $method_id . '][min_order_total]',
'type' => 'text',
'label' => false,
'custom_attributes' => array(
'to_number' => 1,
'step' => 'any'
)
);
if ( !isset( $ap_options_fees[$method_id]['min_order_total'] ) ) {
$ap_options_fees[$method_id]['min_order_total'] = '';
}
woocommerce_form_field(
$params['id'],
$params,
$ap_options_fees[$method_id]['min_order_total']
);
?>
</td>
<td>
<?php
$params = array(
'id' => 'payment_fees[' . $method_id . '][max_order_total]',
'type' => 'text',
'label' => false,
'custom_attributes' => array(
'to_number' => 1,
'step' => 'any'
)
);
if ( !isset( $ap_options_fees[$method_id]['max_order_total'] ) ) {
$ap_options_fees[$method_id]['max_order_total'] = '';
}
woocommerce_form_field(
$params['id'],
$params,
$ap_options_fees[$method_id]['max_order_total']
);
?>
</td>
<td>
<?php
$params = array(
'id' => 'payment_fees[' . $method_id . '][type]',
'type' => 'select',
'label' => false,
'options' => array(
'fixed' => __( 'Fixed', 'woocommerce_activepayments' ),
'percent' => __( 'Percent', 'woocommerce_activepayments' ),
)
);
if ( !isset( $ap_options_fees[$method_id]['type'] ) ) {
$ap_options_fees[$method_id]['type'] = '';
}
woocommerce_form_field(
$params['id'],
$params,
$ap_options_fees[$method_id]['type']
);
?>
</td>
<td>
<?php
$params = array(
'id' => 'payment_fees[' . $method_id . '][amount]',
'type' => 'text',
'label' => false,
'custom_attributes' => array(
'to_number' => 1,
'step' => 'any'
)
);
if ( !isset( $ap_options_fees[$method_id]['amount'] ) ) {
$ap_options_fees[$method_id]['amount'] = '';
}
woocommerce_form_field(
$params['id'],
$params,
$ap_options_fees[$method_id]['amount']
);
?>
</td>

View File

@@ -0,0 +1,3 @@
<?php
// Silence is golden.
?>

View File

@@ -0,0 +1,8 @@
<div class="active-payments wrap">
<h2 class="nav-tab-wrapper">
<?php foreach ( $tabs as $key => $tab ): ?>
<a class="nav-tab <?php if ( $current_tab === $key): ?>nav-tab-active<?php endif; ?>" href="<?php echo admin_url( $tab['page'] ); ?>"><?php echo $tab['title']; ?></a>
<?php endforeach; ?>
</h2>
<h2><?php _e( 'Active Payments', 'woocommerce_activepayments' ); ?></h2>

View File

@@ -0,0 +1,22 @@
<div class="metabox-holder">
<div class="stuffbox">
<h3 class="hndle"><?php _e( 'Get more WP Desk Plugins!', 'woocommerce_activepayments' ); ?></h3>
<?php
$fs_link = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/flexible-shipping-pro-woocommerce/' : 'https://www.wpdesk.net/products/flexible-shipping-pro-woocommerce/';
$fcf_link = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/woocommerce-checkout-fields/' : 'https://www.wpdesk.net/products/woocommerce-checkout-fields/';
$fi_link = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/faktury-woocommerce/' : 'https://www.wpdesk.net/products/flexible-invoices-woocommerce/';
?>
<div class="inside">
<div class="main">
<p><a href="<?php echo $fs_link; ?>?utm_source=active-payments-settings&utm_medium=link&utm_campaign=flexible-shipping-pro-plugin" target="_blank"><?php _e( 'Flexible Shipping', 'woocommerce_activepayments' ); ?></a> - <?php _e( 'Create shipping methods based on weight, totals and more.', 'woocommerce_activepayments' ); ?></p>
<p><a href="<?php echo $fi_link; ?>?utm_source=active-payments-settings&utm_medium=link&utm_campaign=flexible-invoices-plugin" target="_blank"><?php _e( 'Flexible Invoices', 'woocommerce_activepayments' ); ?></a> - <?php _e( 'Issue invoices for your WooCommerce orders.', 'woocommerce_activepayments' ); ?></p>
<p><a href="<?php echo $fcf_link ?>?utm_source=active-payments-settings&utm_medium=link&utm_campaign=flexible-checkout-fields-plugin" target="_blank"><?php _e( 'Flexible Checkout Fields', 'woocommerce_activepayments' ); ?></a> - <?php _e( 'Manage WooCommerce checkout fields and add your own.', 'woocommerce_activepayments' ); ?></p>
</div>
</div>
</div>
</div>
</div>