• Resolved braehler

    (@braehler)


    Hey there,

    we′ve inserted some new ednpoints to the my account section of woocommerce. For some reason, a few of them have no navigation. We used this lines of code to insert them:

    function meine_kleinanzeigen_endpoint() {

    add_rewrite_endpoint( ‘meine_kleinanzeigen’, EP_ROOT | EP_PAGES );

    }

    add_action( ‘init’, ‘meine_kleinanzeigen_endpoint’ );

    // ——————

    // 2. Add new query var

    function meine_kleinanzeigen_query_vars( $vars ) {

    $vars[] = ‘meine_kleinanzeigen’;

    return $vars;

    }

    add_filter( ‘query_vars’, ‘meine_kleinanzeigen_query_vars’, 0 );

    // ——————

    // 3. Insert the new endpoint into the My Account menu

    function meine_kleinanzeigen_link_my_account( $items ) {

    $items[‘meine_kleinanzeigen’] = ‘Meine Kleinanzeigen’;

    return $items;

    }

    add_filter( ‘woocommerce_account_menu_items’, ‘meine_kleinanzeigen_link_my_account’ );

    // ——————

    // 4. Add content to the new endpoint

    function meine_kleinanzeigen_content() {

    //echo ‘<h3>Premium WooCommerce Support</h3><p>Welcome to the WooCommerce support area. As a premium customer, you can submit a ticket should you have any WooCommerce issues with your website, snippets or customization. <i>Please contact your theme/plugin developer for theme/plugin-related support.</i></p>’;

    echo do_shortcode( ‘ [adverts_manage] ‘ );

    }

    add_action( ‘woocommerce_account_meine_kleinanzeigen_endpoint’, ‘meine_kleinanzeigen_content’ );

    and re-sort the them via this:

    function wpb_woo_my_account_order() {
    $myorder = array(
    ‘dashboard’ => __( ‘Dashboard’, ‘woocommerce’ ),
    ‘orders’ => __( ‘Bestellungen’, ‘woocommerce’ ),
    ‘mein_stellenangebot’ => __( ‘Meine Stellenangebote’, ‘woocommerce’ ),
    ‘meine_stellengesuche’ => __( ‘Meine Stellengesuche’, ‘woocommerce’ ),
    ‘meine_bewerbung’ => __( ‘Bewerbungen’, ‘woocommerce’ ),
    ‘favoriten’ => __( ‘Favoriten’, ‘woocommerce’ ),
    ‘stellenalarm’ => __( ‘Stellenalarm’, ‘woocommerce’ ),
    ‘statistik’ => __( ‘Statistik’, ‘woocommerce’ ),
    ‘meine_praxisanzeigen’ => __( ‘Meine Praxisanzeigen’, ‘woocommerce’ ),
    ‘meine_kleinanzeigen’ => __( ‘Meine Kleinanzeigen’, ‘woocommerce’ ),
    ‘edit-account’ => __( ‘Kontodetails’, ‘woocommerce’ ),
    ‘customer-logout’ => __( ‘Abmelden’, ‘woocommerce’ ),
    );
    return $myorder;
    }
    add_filter ( ‘woocommerce_account_menu_items’, ‘wpb_woo_my_account_order’ );

    The Endpoints are working, but as I mentioned above, some of them have no no navigation.
    Can anyone help`?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Did you resave permalinks after running this code? Some advise saving twice. Otherwise I don’t know what could be wrong.

    Thread Starter braehler

    (@braehler)

    Hey,

    yes we resaved the permalinks more than twice, but nothing happens

    Thread Starter braehler

    (@braehler)

    Wrote the hole function new. Now it works ??

    Do you have any other plugins, or your theme, that might be using these same hooks? If so, try assigning a priority parameter of PHP_INT_MAX so that your hooks run last.

    Thread Starter braehler

    (@braehler)

    Hey there,
    unfortunately the custom endpoints do not work. I set the function up new, and have the navigation, but now if you click on for example “order again” nothing happens

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom endpoint has no navigation’ is closed to new replies.