/*
 Theme Name:   Shoptimizer Child
 Theme URI:    https://yourwebsite.com/
 Description:  Child theme for Shoptimizer
 Author:       Discount RC Parts Dev
 Author URI:   https://yourwebsite.com/
 Template:     shoptimizer
 Version:      1.0.0
 Text Domain:  shoptimizer-child
*/

/* Optional: import parent styles */
@import url("../shoptimizer/style.css");

<?php
/**
 * Plugin Name: WooCommerce Classic Product Editor (Full Disable Block UI)
 * Description: Force WooCommerce to load the old product editor interface, not the new block-based version.
 * Version: 1.0
 * Author: Discount RC Parts Dev
 */

// 1. Disable WooCommerce Admin (which powers the new product screen)
add_filter( 'woocommerce_admin_disabled', '__return_true' );

// 2. Disable WooCommerce product block editor
add_filter( 'woocommerce_features', function( $features ) {
    return array_diff( $features, [ 'product_block_editor' ] );
}, 20 );

// 3. Remove all admin feature flags including new product UI
add_filter( 'woocommerce_admin_features', function( $features ) {
    return array_diff( $features, [
        'new_product_management_experience',
        'product_block_editor',
        'settings',
        'analytics',
        'remote_inbox_notifications',
    ] );
}, 20 );

// 4. Tell WordPress not to use block editor for products
add_filter( 'use_block_editor_for_post_type', function( $use, $type ) {
    return $type === 'product' ? false : $use;
}, 10, 2 );
