• Hi! I’m using WP 4.1.1 and WC 2.3.5 and your plugin is great! However i just noticed that my product URL always have a double “/” after the store name. Ex.:
    https://www.domain.com/store//shoes/dolce-gabanna-black-shoe

    This only happens with main categories. If i add the product to a subcategory, the URL does not show the double “/”. Ex.:
    https://www.domain.com/store/shoes/men-shoes/dolce-gabanna-black-shoe

    Of course the browser fixes the URL removing the double “/” but as i hover my mouse on the products i can see the URL has the double “/”.

    I already checked the class-wcbp.php file and if i remove the “/” on $wcbp_base the URL gets fixed.
    Ex.:
    Your code: return home_url( $wcbp_base . '/' . $the_ancestor_slug . '/' . $main_term->slug . '/' . $post->post_name );

    My code: return home_url( $wcbp_base . '' . $the_ancestor_slug . '/' . $main_term->slug . '/' . $post->post_name );

    Is this “fix” OK? Maybe you need to update the plugin? I started using the plugin several weeks ago and didn’t noticed this issue. Since then i had maybe one or two WP and WC updates.

    I also tested this on other domains and themes and its the same. It doesn’t really matter the permalink settings i have, because if i just choose post name on common, store with category on product permalink and add “store” to shop permalinks the issue is there.

    Please help! Thanks in advance

    https://www.ads-software.com/plugins/woocommerce-breadcrumb-permalinks/

Viewing 1 replies (of 1 total)
  • Try that:

    foreach ( $ancestors as $ancestor ) {
    $ancestor = get_term( $ancestor, ‘product_cat’ );

    if ( ! is_wp_error( $ancestor ) && $ancestor )
    $the_ancestor_slug = ‘/’ . $ancestor->slug;
    }

    return home_url( $wcbp_base . $the_ancestor_slug . ‘/’ . $main_term->slug . ‘/’ . $post->post_name );

Viewing 1 replies (of 1 total)
  • The topic ‘Duplicated "/" after store name on URL’ is closed to new replies.