Show notice when pages don't exist, and set gateway defaults
This commit is contained in:
parent
b8dc089040
commit
54fa1e34d3
|
@ -107,6 +107,10 @@ class WC_Install {
|
||||||
WC_Admin_Notices::add_notice( 'install' );
|
WC_Admin_Notices::add_notice( 'install' );
|
||||||
set_transient( '_wc_activation_redirect', 1, 30 );
|
set_transient( '_wc_activation_redirect', 1, 30 );
|
||||||
|
|
||||||
|
// No page? Let user run wizard again..
|
||||||
|
} elseif ( empty( get_option( 'woocommerce_cart_page_id' ) ) ) {
|
||||||
|
WC_Admin_Notices::add_notice( 'install' );
|
||||||
|
|
||||||
// Show welcome screen for major updates only
|
// Show welcome screen for major updates only
|
||||||
} elseif ( version_compare( $current_wc_version, $major_wc_version, '<' ) ) {
|
} elseif ( version_compare( $current_wc_version, $major_wc_version, '<' ) ) {
|
||||||
set_transient( '_wc_activation_redirect', 1, 30 );
|
set_transient( '_wc_activation_redirect', 1, 30 );
|
||||||
|
|
|
@ -24,7 +24,7 @@ class WC_Gateway_BACS extends WC_Payment_Gateway {
|
||||||
* Constructor for the gateway.
|
* Constructor for the gateway.
|
||||||
*/
|
*/
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
|
|
||||||
$this->id = 'bacs';
|
$this->id = 'bacs';
|
||||||
$this->icon = apply_filters('woocommerce_bacs_icon', '');
|
$this->icon = apply_filters('woocommerce_bacs_icon', '');
|
||||||
$this->has_fields = false;
|
$this->has_fields = false;
|
||||||
|
@ -74,7 +74,7 @@ class WC_Gateway_BACS extends WC_Payment_Gateway {
|
||||||
'title' => __( 'Enable/Disable', 'woocommerce' ),
|
'title' => __( 'Enable/Disable', 'woocommerce' ),
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'label' => __( 'Enable Bank Transfer', 'woocommerce' ),
|
'label' => __( 'Enable Bank Transfer', 'woocommerce' ),
|
||||||
'default' => 'yes'
|
'default' => 'no'
|
||||||
),
|
),
|
||||||
'title' => array(
|
'title' => array(
|
||||||
'title' => __( 'Title', 'woocommerce' ),
|
'title' => __( 'Title', 'woocommerce' ),
|
||||||
|
@ -269,7 +269,7 @@ class WC_Gateway_BACS extends WC_Payment_Gateway {
|
||||||
// Get the order country and country $locale
|
// Get the order country and country $locale
|
||||||
$country = $order->billing_country;
|
$country = $order->billing_country;
|
||||||
$locale = $this->get_country_locale();
|
$locale = $this->get_country_locale();
|
||||||
|
|
||||||
// Get sortcode label in the $locale array and use appropriate one
|
// Get sortcode label in the $locale array and use appropriate one
|
||||||
$sortcode = isset( $locale[ $country ]['sortcode']['label'] ) ? $locale[ $country ]['sortcode']['label'] : __( 'Sort Code', 'woocommerce' );
|
$sortcode = isset( $locale[ $country ]['sortcode']['label'] ) ? $locale[ $country ]['sortcode']['label'] : __( 'Sort Code', 'woocommerce' );
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ return array(
|
||||||
'title' => __( 'PayPal Email', 'woocommerce' ),
|
'title' => __( 'PayPal Email', 'woocommerce' ),
|
||||||
'type' => 'email',
|
'type' => 'email',
|
||||||
'description' => __( 'Please enter your PayPal email address; this is needed in order to take payment.', 'woocommerce' ),
|
'description' => __( 'Please enter your PayPal email address; this is needed in order to take payment.', 'woocommerce' ),
|
||||||
'default' => '',
|
'default' => get_option( 'admin_email' ),
|
||||||
'desc_tip' => true,
|
'desc_tip' => true,
|
||||||
'placeholder' => 'you@youremail.com'
|
'placeholder' => 'you@youremail.com'
|
||||||
),
|
),
|
||||||
|
|
|
@ -42,7 +42,7 @@ if ( ! empty( $status_options['uninstall_data'] ) ) {
|
||||||
$wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->prefix . "woocommerce_tax_rate_locations" );
|
$wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->prefix . "woocommerce_tax_rate_locations" );
|
||||||
|
|
||||||
// Delete options
|
// Delete options
|
||||||
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'woocommerce_%';");
|
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'woocommerce\_%';");
|
||||||
|
|
||||||
// Delete posts + data
|
// Delete posts + data
|
||||||
$wpdb->query( "DELETE FROM {$wpdb->posts} WHERE post_type IN ( 'product', 'product_variation', 'shop_coupon', 'shop_order', 'shop_order_refund' );" );
|
$wpdb->query( "DELETE FROM {$wpdb->posts} WHERE post_type IN ( 'product', 'product_variation', 'shop_coupon', 'shop_order', 'shop_order_refund' );" );
|
||||||
|
|
Loading…
Reference in New Issue