Home Forums WoodMart support forum Woocommerce- stock status label change

Woocommerce- stock status label change

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #103606

    meenap
    Participant

    Hi,

    We have to change the default woocommerce product stock status label (from: ‘On backorder’ to ‘Reserved’) on admin end. We can able to change on core file but cannot override on a child theme,
    Could pls help us to override this function?

    The code is located on the following files:
    1.plugins\woocommerce\includes\admin\list-tables\class-wc-admin-list-table-products.php
    code:
    ======
    /**
    * Render columm: is_in_stock.
    */
    protected function render_is_in_stock_column() {
    if ( $this->object->is_on_backorder() ) {
    $stock_html = ‘<mark class=”onbackorder”>’ . __( ‘On backorder’, ‘woocommerce’ ) . ‘</mark>’;
    } elseif ( $this->object->is_in_stock() ) {
    $stock_html = ‘<mark class=”instock”>’ . __( ‘In stock’, ‘woocommerce’ ) . ‘</mark>’;
    } else {
    $stock_html = ‘<mark class=”outofstock”>’ . __( ‘Out of stock’, ‘woocommerce’ ) . ‘</mark>’;
    }

    if ( $this->object->managing_stock() ) {
    $stock_html .= ‘ (‘ . wc_stock_amount( $this->object->get_stock_quantity() ) . ‘)’;
    }

    echo wp_kses_post( apply_filters( ‘woocommerce_admin_stock_html’, $stock_html, $this->object ) );
    }

    2. plugins\woocommerce\includes\wc-product-functions.php
    code:
    =====
    /**
    * Get stock status options.
    *
    * @since 3.0.0
    * @return array
    */
    function wc_get_product_stock_status_options() {
    return array(
    ‘instock’ => __( ‘In stock’, ‘woocommerce’ ),
    ‘outofstock’ => __( ‘Out of stock’, ‘woocommerce’ ),
    ‘onbackorder’ => __( ‘On backorder’, ‘woocommerce’ ),
    );
    }

    Attachments:
    You must be logged in to view attached files.
    #103618

    Artem Temos
    Keymaster

    Hi,

    You are customizing the WooCommerce plugin and not our theme files. So we don’t have an instruction on how to apply child theme in this situation.

    Regards

Viewing 2 posts - 1 through 2 (of 2 total)