• Dear Dev team,

    I ‘ve just to install your plugin and have some tests

    Could you please help us how to add some filter based on : { subscription_status } & { end_date } ?

    Thanks and Regards,

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support sebastianrybacki

    (@sebastianrybacki)

    Hello,

    Thank you for reaching out to us.

    As for the list of filters available in the Flexible Subscriptions plugin, please find them below along with some usage examples:

    Filter hooks allow you to modify data used by the plugin.

    fsub/product_add_to_cart_text

    Customizes the “Add to Cart” button text for subscription products on single product pages.

    • Type:Filter
      • Parameters:@param string $button_text The default button text (e.g., “Sign up now”).
      • @param \WC_Product $product The subscription product object.
      • Return:@return string The modified button text.
    • Usage Example:
    add_filter( 'fsub/product_add_to_cart_text', function( $button_text, $product ) {
    return 'Subscribe Today!';
    }, 10, 2 );

    fsub/subscription_renewal/should_interrupt_renewal

    Allows you to interrupt the renewal process for a subscription. Return false to prevent the renewal order from being created.

    • Type:Filter
      • Parameters:@param bool $can_renew Default is true.
      • @param \WPDesk\FlexibleSubscriptions\Subscription\Subscription $subscription The subscription being renewed.
      • Return:@return bool Return false to stop the renewal.
    • Usage Example:
    add_filter( 'fsub/subscription_renewal/should_interrupt_renewal', function( $can_renew, $subscription ) {
    // Don't renew if a specific meta key is present.
    if ( 'yes' === $subscription->get_meta( '_do_not_renew' ) ) {
    return false;
    }
    return $can_renew;
    }, 10, 2 );

    fsub/subscription/status_awaiting

    Modifies the status a subscription is set to while it awaits payment for a renewal order.

    • Type:Filter
      • Parameters:@param string $status The default status, which is on-hold.
      • @param \WPDesk\FlexibleSubscriptions\Subscription\Subscription $subscription The subscription object.
      • Return:@return string The new status (e.g., pending).
    • Usage Example:
    add_filter( 'fsub/subscription/status_awaiting', function( $status, $subscription ) {
    // Change the default awaiting status to 'pending'.
    return 'pending';
    }, 10, 2 );

    fsub/settings/tabs

    Allows adding or modifying tabs on the Flexible Subscriptions settings page, located at WooCommerce → Flexible Subscriptions → Settings.

    • Type:Filter
      • Parameters:@param \WPDesk\FlexibleSubscriptions\Form\Fields\Tab[] $tabs An array of tab objects.
      • Return:@return array The modified array of tab objects.
    • Usage Example:
    /**
    * This is an advanced example requiring knowledge of the plugin's form structure.
    * You would need to create a custom class that extends
    * \WPDesk\FlexibleSubscriptions\Form\Fields\Tab.
    */
    add_filter( 'fsub/settings/tabs', function( $tabs ) {
    // $tabs[] = new My_Custom_Settings_Tab();
    return $tabs;
    } );

    fsub/subscription/payment_meta

    Allows you to add custom payment metadata fields to the subscription details metabox in the admin panel.

    • Type:Filter
      • Parameters:@param array $payment_meta_fields An empty array by default.
      • @param \WPDesk\FlexibleSubscriptions\Subscription\Subscription $subscription The subscription object.
      • Return:@return array A structured array of fields to be displayed.
    • Usage Example:
    add_filter( 'fsub/subscription/payment_meta', function( $payment_meta_fields, $subscription ) {
    $payment_meta_fields['my_gateway'] = [
    'post_meta' => [
    '_my_gateway_token' => [
    'label' => __( 'My Gateway Token', 'my-text-domain' ),
    'value' => $subscription->get_meta( '_my_gateway_token' ),
    ],
    ],
    ];
    return $payment_meta_fields;
    }, 10, 2 );

    fsub/admin/order/order_types

    Allows you to add custom options to the order type filter dropdown on the admin orders list page.

    • Type:Filter
      • Parameters:@param array $order_types An associative array of order types in the format 'key' => 'Label'.
      • Return:@return array The modified array of order types.
    • Usage Example:
    add_filter( 'fsub/admin/order/order_types', function( $order_types ) {
    $order_types['my_custom_type'] = __( 'My Custom Order Type', 'my-text-domain' );
    return $order_types;
    } );

    fsub/admin/order/relationship

    Customizes the display name for an order’s relationship (e.g., “Renewal”) in the “Subscription History” metabox.

    • Type:Filter
      • Parameters:@param string $subtype The default relationship name.
      • @param \WC_Order $payment_request The related order object.
      • Return:@return string The new relationship display name.
    • Usage Example:
    add_filter( 'fsub/admin/order/relationship', function( $subtype, $payment_request ) {
    if ( $payment_request->get_meta( '_is_special_renewal' ) ) {
    return 'Special Renewal';
    }
    return $subtype;
    }, 10, 2 );

    fsub/admin/order/subtype_query_args

    Modifies the query arguments when filtering orders by a custom subtype added via the fsub/admin/order/order_types filter.

    • Type:Filter
      • Parameters:@param array $query_args The current query arguments.
      • @param string $subtype The key of the custom subtype being filtered.
      • Return:@return array The modified query arguments. This should typically add a meta_query.
    • Usage Example:
    // This example works in tandem with the 'fsub/admin/order/order_types' example.
    add_filter( 'fsub/admin/order/subtype_query_args', function( $query_args, $subtype ) {
    if ( 'my_custom_type' === $subtype ) {
    $query_args['meta_query'][] = [
    'key' => '_my_custom_order_meta',
    'value' => 'yes',
    ];
    }
    return $query_args;
    }, 10, 2 );

    fsub/cart/require_payment_on_trial

    Forces the display and use of payment gateways even when the cart total is zero (e.g., for a free trial). This is useful for capturing payment tokens for future renewals.

    • Type:Filter
      • Parameters:@param bool $force_payment Default is false.
      • Return:@return bool Set to true to force payment gateway selection.
    • Usage Example:
    // Always require a payment method, even for free trials.
    add_filter( 'fsub/cart/require_payment_on_trial', '__return_true' );

    fsub/payment/manual_renewal/enabled

    Enables or disables the manual renewal process. If disabled, only payment gateways that support automatic renewals will be available at checkout for subscription products.

    • Type:Filter
      • Parameters:@param bool $is_enabled Default is true.
      • Return:@return bool Set to false to disable manual renewals.
    • Usage Example:
    // Force all subscriptions to use automatic payment gateways.
    add_filter( 'fsub/payment/manual_renewal/enabled', '__return_false' );

    Please let me know if you have any further questions.

    Kind regards,

    Dear Dev team,

    Thanks for your reply !

    Currently, I ‘d like to add filter to subcriptions-list based on subscription-status : { active / on-hold / pending cancelation } with dropdown-type

    Could you help us solve it ?

    Thanks and Regards

    Plugin Support sebastianrybacki

    (@sebastianrybacki)

    Hello,

    Thank you for your message!

    To better assist you, could you please clarify whether you’re looking to add the filter for subscription status in the customer view of subscriptions or in the admin panel? This will help us understand your needs more clearly.

    Currently, the plugin does not have an option for filtering subscriptions by status directly, but if you’re referring to the admin panel and would like to filter subscriptions by status (active, on-hold, pending cancellation), we can consider adding this feature if it aligns with your requirements.

    Looking forward to your response.

    Kind regards,

    Dear Dev team,

    Correctly,

    Sorry that if I said not clearly. I ‘d like to mention about filter in admin panel

    Thanks and Regards,

    Tuan

    Plugin Support sebastianrybacki

    (@sebastianrybacki)

    Hello Tuan,

    Thank you for the clarification.

    As mentioned earlier, the plugin currently doesn’t have the functionality to filter subscriptions by status in the admin panel. However, this sounds like a useful feature, and I’ve added it to our list of potential updates for future versions.

    If we are able to implement this functionality in the future, I will be sure to notify you.

    Thanks again for your input, and please don’t hesitate to reach out if you have any other questions.

    Kind regards,

    Dear Dev team,

    Thanks for your reply,

    It’s great to hear that from you. I will wait this feature of your team

    Thanks and Regards,

    Tuan

    Plugin Support sebastianrybacki

    (@sebastianrybacki)

    Hello,

    You’re most welcome.

    I’m marking this thread as resolved. Our developers are aware of this request, and if it gets implemented in a future update, I will make sure to inform you.

    Have a fantastic day,

    Dear Dev team,

    Could you help me how to add filter product_category or product in Subscription list ?

    Thanks and Regards

    Tuan

    Plugin Support sebastianrybacki

    (@sebastianrybacki)

    Hi Tuan,

    Thank you for your message!

    Currently, the Flexible Subscriptions plugin does not include a built-in filter hook that would allow filtering the subscription list by product or product category.

    However, we’re open to adding such a filter in the future.
    To better understand your needs and determine the best place to implement it, could you please provide a bit more context?

    For example:

    • Where exactly do you want this filter to be applied? (e.g., admin panel, customer account page, custom query?)
    • Should it be used for displaying data or modifying behavior?
    • Are you building a custom integration or extending an existing view?

    With this information, we’ll be able to consider adding the appropriate filter in the future.

    Best regards,

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Add Filters for Subscriptions admin panel’ is closed to new replies.