• Resolved obaviet

    (@obaviet)


    When using WooCommerce Subscriptions, its menu is always at the bottom. How to move it. I don’t see this menu available in your plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author SysBasics

    (@phppoet)

    which plugin you are refering ? share plugin url

    Plugin Author SysBasics

    (@phppoet)

    sorry i could not get it back.

    if you check there code which adds subscriptions endpoint

    /**
     * Insert the new endpoint into the My Account menu.
     *
     * @param array $items
     * @return array
     */
    public function add_menu_items( $menu_items ) {
    
        // If the Subscriptions endpoint setting is empty, don't display it in line with core WC behaviour.
        if ( empty( $this->query_vars['subscriptions'] ) ) {
            return $menu_items;
        }
    
        if ( 1 === count( wcs_get_users_subscriptions() ) && apply_filters( 'wcs_my_account_redirect_to_single_subscription', true ) ) {
            $label = __( 'My Subscription', 'woocommerce-subscriptions' );
        } else {
            $label = __( 'Subscriptions', 'woocommerce-subscriptions' );
        }
    
        // Add our menu item after the Orders tab if it exists, otherwise just add it to the end
        if ( array_key_exists( 'orders', $menu_items ) ) {
            $menu_items = wcs_array_insert_after( 'orders', $menu_items, 'subscriptions', $label );
        } else {
            $menu_items['subscriptions'] = $label;
        }
    
        return $menu_items;
    }

    Means it should either be added after orders tab or at the end. also this menu is not available without any condition for wc_get_account_menu_items function that is why our plugin could not detect it.

    Hope it clears

    • This reply was modified 11 months, 1 week ago by SysBasics.
    • This reply was modified 11 months, 1 week ago by SysBasics.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WooCommerce Subscriptions’ is closed to new replies.