plugins – Woocommerce: hide the order details if subscription cancelled


I am trying to figure out how to hide order details customer account with woocommerce subscription. I manage to find the hook

add_action( 'woocommerce_customer_changed_subscription_to_cancelled', 'hide_details_if_cancelled' );

    function hide_details_if_cancelled( $subscription ) {
      if ( 'cancelled' === $subscription->get_status() ) {

i need to hide the following parts contain following classes on customer subscription page

.shop_table order_details



Purpose to hide is, i am using plugin called self-service dashboard, which allow to switch and change quanitity of subscription. However even subscription is cancelled, buttons are still visible and allow customer to change quantity and item kg for ordered subscription product as well allow customer to add the product to subscription.

So its better to disable those options as well if subscription is cancelled to stop letting customer perform any action for specific subscription page.

Mr.Devops 6 months 2021-05-24T06:41:27-05:00 0 Answers 0 views 0

Leave an answer