Remove an action by extending class and replacing it

Problem lies in this line:

remove_action('woocommerce_before_my_account', array( $this, 'my_packages'));

This won’t remove action registered by parent class, because $this is a different object in this case, so you won’t remove any action at all.

So how to remove such action? Since you can’t access the same $this value in your class, you’ll have to iterate through all filters and remove the given one manually.

Here’s a good example how to do that:

https://wordpress.stackexchange.com/a/239431/34172

error code: 523