Support » Plugin: WooCommerce » SKU being put in inventory

  • Resolved sugilite

    (@sugilite)


    Not a fault, more of a comment as I do not know who else to tell at Woocommerce.
    Moving the SKU field to the Inventory tab is very inconvenient for those that clone a lot of products. Very easy to miss changing the SKU now. Really not sure what benefit has come from that field being moved away from the “General” area.

    https://wordpress.org/plugins/woocommerce/

Viewing 2 replies - 16 through 17 (of 17 total)
  • OK, I just sorted this out myself – I have simply reordered the options and turned the “General” tab label into “price” which quite frankly makes a lot more sense. So now I have the SKU field at the top of the tabs, and “price” in the tab lower down – yes!

    Name of the file and path to it is…
    wp-content/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-product-data.php
    And the code to paste in place of what is currently there is the following.
    /**
    * Return array of tabs to show.
    * @return array
    */
    private static function get_product_data_tabs() {
    return apply_filters( ‘woocommerce_product_data_tabs’, array(
    ‘inventory’ => array(
    ‘label’ => __( ‘Inventory’, ‘woocommerce’ ),
    ‘target’ => ‘inventory_product_data’,
    ‘class’ => array( ‘show_if_simple’, ‘show_if_variable’, ‘show_if_grouped’, ‘show_if_external’ ),
    ),
    ‘general’ => array(
    ‘label’ => __( ‘Price’, ‘woocommerce’ ),
    ‘target’ => ‘general_product_data’,
    ‘class’ => array( ‘hide_if_grouped’ ),

    ),
    ‘shipping’ => array(
    ‘label’ => __( ‘Shipping’, ‘woocommerce’ ),
    ‘target’ => ‘shipping_product_data’,
    ‘class’ => array( ‘hide_if_virtual’, ‘hide_if_grouped’, ‘hide_if_external’ ),
    ),
    ‘linked_product’ => array(
    ‘label’ => __( ‘Linked Products’, ‘woocommerce’ ),
    ‘target’ => ‘linked_product_data’,
    ‘class’ => array(),
    ),
    ‘attribute’ => array(
    ‘label’ => __( ‘Attributes’, ‘woocommerce’ ),
    ‘target’ => ‘product_attributes’,
    ‘class’ => array(),
    ),
    ‘variations’ => array(
    ‘label’ => __( ‘Variations’, ‘woocommerce’ ),
    ‘target’ => ‘variable_product_options’,
    ‘class’ => array( ‘variations_tab’, ‘show_if_variable’ ),
    ),
    ‘advanced’ => array(
    ‘label’ => __( ‘Advanced’, ‘woocommerce’ ),
    ‘target’ => ‘advanced_product_data’,
    ‘class’ => array(),
    ),
    ) );
    }

    Enjoy folks 🙂

    We just updated to 3.0 on the dev site. Here is what we did.
    We edited 2 files:
    wp-content/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-data-general.php
    and
    wp-content/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-data-inventory.php

    In html-product-data-inventory.php
    we copied then deleted line 5 to 15
    if ( wc_product_sku_enabled() ) {
    woocommerce_wp_text_input( array(
    ‘id’ => ‘_sku’,
    ‘value’ => $product_object->get_sku( ‘edit’ ),
    ‘label’ => ‘<abbr title=”‘ . __( ‘Stock Keeping Unit’, ‘woocommerce’ ) . ‘”>’ . __( ‘SKU’, ‘woocommerce’ ) . ‘</abbr>’,
    ‘desc_tip’ => true,
    ‘description’ => __( ‘SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased.’, ‘woocommerce’ ),
    ) );
    }

    do_action( ‘woocommerce_product_options_sku’ );

    In html-product-data-general.php
    we added the code line 25
    <div class=”options_group pricing show_if_simple show_if_external hidden”>
    <?php
    PAST CODE HERE
    woocommerce_wp_text_input( array(
    ‘id’ => ‘_regular_price’,
    ‘value’ => $product_object->get_regular_price( ‘edit’ ),
    ‘label’ => __( ‘Regular price’, ‘woocommerce’ ) . ‘ (‘ . get_woocommerce_currency_symbol() . ‘)’,
    ‘data_type’ => ‘price’,
    ) );

    I’ll look at your solution – Thanks for sharing.

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘SKU being put in inventory’ is closed to new replies.