本文整理汇总了PHP中WC_Payment_Gateway::admin_options方法的典型用法代码示例。如果您正苦于以下问题:PHP WC_Payment_Gateway::admin_options方法的具体用法?PHP WC_Payment_Gateway::admin_options怎么用?PHP WC_Payment_Gateway::admin_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WC_Payment_Gateway
的用法示例。
在下文中一共展示了WC_Payment_Gateway::admin_options方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin_options
/**
* Admin Panel Options
* - Options for bits like 'title' and availability on a country-by-country basis
*
* @access public
* @return void
*/
public function admin_options()
{
parent::admin_options();
?>
<script type="text/javascript">
jQuery( '#woocommerce_paypal_pro_enable_3dsecure' ).change( function () {
var threedsec = jQuery( '#woocommerce_paypal_pro_centinel_pid, #woocommerce_paypal_pro_centinel_mid, #woocommerce_paypal_pro_centinel_pwd, #woocommerce_paypal_pro_liability_shift' ).closest( 'tr' );
if ( jQuery( this ).is( ':checked' ) ) {
threedsec.show();
} else {
threedsec.hide();
}
}).change();
</script>
<?php
}
示例2: admin_options
/**
* Admin Panel Options
* - Options for bits like 'title' and availability on a country-by-country basis
*
* @since 1.0.0
*/
public function admin_options()
{
if ($this->is_valid_for_use()) {
parent::admin_options();
} else {
?>
<div class="inline error"><p><strong><?php
_e('Gateway Disabled', 'woocommerce');
?>
</strong>: <?php
_e('PayPal does not support your store currency.', 'woocommerce');
?>
</p></div>
<?php
}
}
示例3: admin_options
/**
* Display settings page with some additional javascript for hiding conditional fields
*
* @since 1.0.0
* @see WC_Settings_API::admin_options()
*/
public function admin_options()
{
parent::admin_options();
?>
<style type="text/css">.nowrap { white-space: nowrap; }</style>
<?php
// if there's more than one environment include the environment settings switcher code
if (count($this->get_environments()) > 1) {
// add inline javascript
ob_start();
?>
$( '#woocommerce_<?php
echo $this->get_id();
?>
_environment' ).change( function() {
// inherit settings from other gateway?
var inheritSettings = $( '#woocommerce_<?php
echo $this->get_id();
?>
_inherit_settings' ).is( ':checked' );
var environment = $( this ).val();
// hide all environment-dependant fields
$( '.environment-field' ).closest( 'tr' ).hide();
// show the currently configured environment fields that are not also being hidden as any shared settings
var $environmentFields = $( '.' + environment + '-field' );
if ( inheritSettings ) {
$environmentFields = $environmentFields.not( '.shared-settings-field' );
}
$environmentFields.not( '.hidden' ).closest( 'tr' ).show();
} ).change();
<?php
wc_enqueue_js(ob_get_clean());
}
if (!empty($this->shared_settings)) {
// add inline javascript to show/hide any shared settings fields as needed
ob_start();
?>
$( '#woocommerce_<?php
echo $this->get_id();
?>
_inherit_settings' ).change( function() {
var enabled = $( this ).is( ':checked' );
if ( enabled ) {
$( '.shared-settings-field' ).closest( 'tr' ).hide();
} else {
// show the fields
$( '.shared-settings-field' ).closest( 'tr' ).show();
// hide any that may not be available for the currently selected environment
$( '#woocommerce_<?php
echo $this->get_id();
?>
_environment' ).change();
}
} ).change();
<?php
wc_enqueue_js(ob_get_clean());
}
}
示例4: admin_options
public function admin_options()
{
if (!$this->enabled && count($this->errors)) {
echo '<div class="inline error"><p><strong>' . __('Gateway Disabled', 'mollie-payments-for-woocommerce') . '</strong>: ' . implode('<br/>', $this->errors) . '</p></div>';
return;
}
parent::admin_options();
}
示例5: admin_options
/**
* Override the admin options method to add a little javascript to control
* how the gateway settings behave
*
* @see WC_Settings_API::admin_options()
*/
public function admin_options()
{
// allow parent to do its thing
parent::admin_options();
// 'testmode' only applies to production accounts and hide/show the demo/production field
ob_start();
?>
$( '#woocommerce_elavon_vm_account' ).change(
function() {
var testmode_row = $( '#woocommerce_elavon_vm_testmode' ).closest( 'tr' );
if ( 'production' == $( this ).val() ) {
testmode_row.show();
$( '.production-field' ).closest( 'tr' ).show();
$( '.demo-field' ).closest( 'tr' ).hide();
} else {
testmode_row.hide();
$( '.demo-field' ).closest( 'tr' ).show();
$( '.production-field' ).closest( 'tr' ).hide();
}
} ).change();
<?php
wc_enqueue_js(ob_get_clean());
}
示例6: admin_options
/**
* Admin Panel Options
* - Options for bits like 'title' and availability on a country-by-country basis
*
* @access public
* @return void
*/
public function admin_options()
{
if ($this->is_valid_for_use()) {
if ($this->sandbox != 'yes' && isset($_GET["show-pending"]) && $_GET["show-pending"] == '1') {
echo $this->admin_page_top(false);
echo $this->pending_payments();
exit;
} else {
if ($this->sandbox != 'yes') {
echo $this->admin_page_top(true);
}
parent::admin_options();
}
} else {
?>
<div class="inline error"><p><strong><?php
_e('Gateway Disabled', $this->td);
?>
</strong>: <?php
_e('Maksuturva does not support your store currency.', $this->td);
?>
</p></div>
<?php
}
}
示例7: admin_options
/**
* Admin Panel Options
* - Options for bits like 'title' and availability on a country-by-country basis
*
* @see https://github.com/woothemes/woocommerce/blob/v1.0/classes/gateways/gateway.class.php#L72-L80
* @see https://github.com/woothemes/woocommerce/blob/v1.2/classes/gateways/gateway.class.php#L96-L104
* @see https://github.com/woothemes/woocommerce/blob/v1.3/classes/woocommerce_settings_api.class.php#L18-L26
* @see https://github.com/woothemes/woocommerce/blob/v1.3.2/classes/woocommerce_settings_api.class.php#L18-L26
* @see https://github.com/woothemes/woocommerce/blob/v1.4/classes/class-wc-settings-api.php#L18-L31
* @see https://github.com/woothemes/woocommerce/blob/v1.5/classes/class-wc-settings-api.php#L18-L32
*
* @since WooCommerce version 1.4 the admin_options() function has an default implementation.
*/
public function admin_options()
{
parent::admin_options();
}
示例8: admin_options
/**
* Override the admin options method to add a little javascript to control
* how the gateway settings behave
*
* @see WC_Settings_API::admin_options()
*/
public function admin_options()
{
// allow parent to do its thing
parent::admin_options();
ob_start();
?>
$('#woocommerce_realex_vault').change(
function() {
var saveCardTextRow = $(this).closest('tr').next();
var manageMyCardsTextRow = saveCardTextRow.next();
if ($(this).is(':checked')) {
saveCardTextRow.show();
manageMyCardsTextRow.show();
} else {
manageMyCardsTextRow.hide();
saveCardTextRow.hide();
}
}).change();
<?php
$javascript = ob_get_clean();
wc_enqueue_js(apply_filters('wc_gateway_realex_admin_options_js', $javascript));
}