Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #4508262
Hiding sub products - stock not deducting
Open

Comments

  • Janus started the conversation

    Hi I have read other posts referring to this snippet

    add_filter( 'woocommerce_order_get_items', function ( $items ) {    foreach ( $items as $key => $item ) {        if ( $item->meta_exists( '_woosb_parent_id' ) ) {            unset( $items[ $key ] );        }    }    return $items;
    }, 10, 1 );
    

    I am using this to hide sub products on our admin orders, invoicing system etc.

    But we are experiencing issues with that stock for the sub products are not changing when this code is active.

    How can we make it work so sub products are still hidden, but that the stock function still works?

  •  1,549
    Dustin replied

    Hi Janus,

    The admin orders are for accounting and statistics purposes, so you should not hide the child products.

    For the invoicing system, you can check the options in the Compatible tab. If you use another plugin, let me know.

    9530980004.png

    In that case, please renew your license, as the old one, purchased on February 16, 2024, has expired for support.

    Best regards,
    Dustin

  • Janus replied

    We are using an external warehouse system called Shipmondo.dk which fetches the order data through the rest api with this plugin: https://wordpress.org/plugins/pakkelabels-for-woocommerce/

    So is it possible to exclude the sub products in the rest api?