Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BadgeOS Conflicts with WooCommerce Admin: general product data isn't visible for products in admin #718

Open
dmfcoops opened this issue Feb 26, 2020 · 1 comment

Comments

@dmfcoops
Copy link

dmfcoops commented Feb 26, 2020

Description

With BadgeOS activated on WordPress 5.3.2 the WooCommerce plugin breaks.
Various editable fields in WooCommerce Admin are no longer visible when adding or editing products eg Regular Price field and Sales Price field

Steps to Reproduce

  1. Login to Wordpress Dashboard
  2. Install BadgeOS
  3. Install WooCommerce
  4. Install WooCommerce Memberships
  5. Open WooCommerce list of Products
  6. Select a product or create a new product
  7. Scroll down to Product Data

Actual result:

In the General tab of the Product Data section in WooCommerce Admin, no price fields are visible, and the product type dropdown menu isn't visible. Other input fields are missing (see screenshots for comparison)

Expected result:

I expect to see regular price field, sales price field, product type dropdown menu and other missing fields

Product Versions

  • BadgeOS: 3.4
  • BadgeOS Learn-Dash Add On: 1.0.4
  • WordPress: 5.3.2

Additional Information

Deactivated all plugins and add-ons to test for conflicts and only the BadgeOS plugin caused this conflict with WooCommerce. Deactivating the BadgeOS Learn-Dash Add On did not fix the issue. deactivating BadgeOS fixes the issue with WooCommerce.

No changes have been made to core Wordpress and plugin PHP files

Using DIVI theme

Actual Result

Expected Result

@graemebenzie
Copy link

graemebenzie commented Mar 10, 2020

My workaround is to dequeued badgeOS plugin styles by adding this to my theme's functions.php.

/* Deregister stylesheets that break WooCommerce's drop downs when on a WooCommerce admin page */
add_action('admin_print_styles', 'remove_badgeos_admin_styles_scripts', 5);
function  remove_badgeos_admin_styles_scripts() {
    
    if( isWooCommerceAdminPage() ) {

        // 'BadgeOS' plugin
        wp_dequeue_style('badgeos-select2-css');
        wp_dequeue_style('badgeos-juqery-autocomplete-css');
        wp_dequeue_script('badgeos-select2');

        // 'BadgeOS Interactive Progress Map Add-On' plugin
        wp_dequeue_script('progress_map_admin-select2');
        wp_dequeue_style('progress_map_admin-select2-css');

        // 'BadgeOS Social Sharing' plugin
        wp_dequeue_style('bos-ss-admin-select2-css');
        wp_dequeue_script('bos-ss-admin-select2-js');
    }

}

function isWooCommerceAdminPage() {
    /*  
        WooCommerce admin pages get params  
        page = wc-reports
        page = wc-settings
        page = wc-status
        page = wc-addons

        post_type = shop_order
        post_type = shop_coupon
        post_type = product
        post_type = product
        post_type = product
        post_type = product
        post_type = product
    */
    global $post;
    return (    $post->post_type == 'product' ||
                in_array( $_GET['page'], array('wc-reports', 'wc-settings', 'wc-status', 'wc-addons') ) ||
                in_array( $_GET['post_type'], array('shop_order', 'shop_coupon', 'product' ) ) );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants