From 54fa1e34d347e386b9e1dd09bffcb770e9c29294 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 29 Apr 2015 13:21:01 +0100 Subject: [PATCH] Show notice when pages don't exist, and set gateway defaults --- includes/class-wc-install.php | 4 ++++ includes/gateways/bacs/class-wc-gateway-bacs.php | 6 +++--- includes/gateways/paypal/includes/settings-paypal.php | 2 +- uninstall.php | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/includes/class-wc-install.php b/includes/class-wc-install.php index 5e7b08ea733..09a5df962af 100644 --- a/includes/class-wc-install.php +++ b/includes/class-wc-install.php @@ -107,6 +107,10 @@ class WC_Install { WC_Admin_Notices::add_notice( 'install' ); 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 } elseif ( version_compare( $current_wc_version, $major_wc_version, '<' ) ) { set_transient( '_wc_activation_redirect', 1, 30 ); diff --git a/includes/gateways/bacs/class-wc-gateway-bacs.php b/includes/gateways/bacs/class-wc-gateway-bacs.php index cabe19e40d9..4800c5a45bb 100644 --- a/includes/gateways/bacs/class-wc-gateway-bacs.php +++ b/includes/gateways/bacs/class-wc-gateway-bacs.php @@ -24,7 +24,7 @@ class WC_Gateway_BACS extends WC_Payment_Gateway { * Constructor for the gateway. */ public function __construct() { - + $this->id = 'bacs'; $this->icon = apply_filters('woocommerce_bacs_icon', ''); $this->has_fields = false; @@ -74,7 +74,7 @@ class WC_Gateway_BACS extends WC_Payment_Gateway { 'title' => __( 'Enable/Disable', 'woocommerce' ), 'type' => 'checkbox', 'label' => __( 'Enable Bank Transfer', 'woocommerce' ), - 'default' => 'yes' + 'default' => 'no' ), 'title' => array( 'title' => __( 'Title', 'woocommerce' ), @@ -269,7 +269,7 @@ class WC_Gateway_BACS extends WC_Payment_Gateway { // Get the order country and country $locale $country = $order->billing_country; $locale = $this->get_country_locale(); - + // Get sortcode label in the $locale array and use appropriate one $sortcode = isset( $locale[ $country ]['sortcode']['label'] ) ? $locale[ $country ]['sortcode']['label'] : __( 'Sort Code', 'woocommerce' ); diff --git a/includes/gateways/paypal/includes/settings-paypal.php b/includes/gateways/paypal/includes/settings-paypal.php index 3e832b80ecb..477dbcbb27b 100644 --- a/includes/gateways/paypal/includes/settings-paypal.php +++ b/includes/gateways/paypal/includes/settings-paypal.php @@ -32,7 +32,7 @@ return array( 'title' => __( 'PayPal Email', 'woocommerce' ), 'type' => 'email', '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, 'placeholder' => 'you@youremail.com' ), diff --git a/uninstall.php b/uninstall.php index bdfb0e5efbb..c2c6e9cbd7c 100644 --- a/uninstall.php +++ b/uninstall.php @@ -42,7 +42,7 @@ if ( ! empty( $status_options['uninstall_data'] ) ) { $wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->prefix . "woocommerce_tax_rate_locations" ); // 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 $wpdb->query( "DELETE FROM {$wpdb->posts} WHERE post_type IN ( 'product', 'product_variation', 'shop_coupon', 'shop_order', 'shop_order_refund' );" );