• Resolved CPCI-Solutions

    (@corentinco)


    Hello, is it possible for the filter to display product category seo url when someone filter only by one category / subcategory ?

    For example, if a user filters the vehicules by category “cars”, is it possible to have page url of the woocommerce category like this : website.com/product-category/cars with associated breadcrumb : home > shop > cars

    Instead of url : website.com/?swoof=1&product_cat=cars and breadcrumb : home > shop

    Maybe this would be better for SEO ? In order to avoid duplicate content for categories archives, and also for better user experience with associated breadcrumbs. What do you think ?

    I saw “SEO URL request” feature of the plugin, but I don’t know how (and if it is possible) to achieve this category url with it.

    Thank you very much for your help, have a nice day ??

    PS : I have an additional question : it is possible to change “+” icon layout for category/sub-category toggle “plus”/”minus” button ?

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

Viewing 1 replies (of 1 total)
  • Plugin Author RealMag777

    (@realmag777)

    Hello

    1) There is no such feature, but I can suggest you next code to get such effect you need (SEO URL should be enabled):

    add_action('registered_taxonomy', function () {
        $site_url = 'https://dev.products-filter.com/';
        $current_url = $_SERVER['SCRIPT_URI'];
    
        if (str_contains($current_url, 'swoof')) {
            $data = explode('/', $current_url);
    
            if (str_contains($data[5], 'product_cat')) {
                $tmp = explode('-', $data[5]);
                $link = "{$site_url}product-category/{$tmp[1]}/";
    
                wp_redirect($link);
                exit;
            }
        }
    });

    2) Sure, you can do it in tab Design https://share.pluginus.net/image/i20230807123158.png

Viewing 1 replies (of 1 total)
  • The topic ‘Display woocommerce category url of shop (and breadcrumbs)’ is closed to new replies.