How to hide the _alg_wc_cog_item_cost after deactivating the plugin?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #89783
    Paul
    Guest

    Hello, when deactivating the plugin, the costs of the products appear in the orders under the SKU, with the code: _alg_wc_cog_item_cost: 0.50.
    I do not want the costs to be seen in the order.

    #89784
    Zohaib
    Participant

    Hi,

    Thanks for letting us know about this issue. I have been able to replicate it on a test site. I have passed your request to our plugin’s developers and they will work on a solution and get back to you.

    #89785
    Zohaib
    Participant

    Hi,

    The  _alg_wc_cog_item_cost,_alg_wc_cog_item_handling_fee is meta data that is stored in the WooCommerce database table. If we unset these metadata on plugin deactivation, then you will loose all the data when the plugin is activated again. It is therefore not possible to hide this on plugin deactivation.

    #89786
    WPFactory Plugins
    Participant
    Plugin Author

    Hi Paul,

    If you’re comfortable with a little bit of coding you could add this to your functions.php file:

    add_filter( 'woocommerce_hidden_order_itemmeta', 'my_alg_wc_cog_hide_order_cost_meta', PHP_INT_MAX );
    if ( ! function_exists( 'my_alg_wc_cog_hide_order_cost_meta' ) ) {
        function my_alg_wc_cog_hide_order_cost_meta( $meta_keys ) {
            $meta_keys[] = '_alg_wc_cog_item_cost';
            return $meta_keys;
        }
    }

    That will hide it

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.