Show notice when pages don't exist, and set gateway defaults

This commit is contained in:
Mike Jolley 2015-04-29 13:21:01 +01:00
parent b8dc089040
commit 54fa1e34d3
4 changed files with 9 additions and 5 deletions

View File

@ -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 );

View File

@ -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' );

View File

@ -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'
),

View File

@ -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' );" );