• Resolved makc57

    (@makc57)


    Dear Team,

    We are getting the following issue with combination of 2 plugins – “Falang” and “Annasta Woocommerce Product Filters”.

    When “Translate Options” is switched on for “Product Categories” it generates the following broken permalink after Filter is applied:

    https://energygroup.lv/en/%product_cat-slug%/gaismekli/?archive-filter=1&pa_producer-filter=gtv

    It have to be “/product_cat/” instead of “/%product_cat-slug%/

    When I switch off “Translate Options” for “Product Categories” it doesn’t translate Product Categories, however generates correct permalink:

    https://energygroup.lv/en/product-cat/gaismekli/?archive-filter=1&pa_producer-filter=gtv

    Please kindly assist with generating correct permalink once product filter is applied.

    P.S.
    I was getting similar issue here which wasn’t resolved actually. I simply turned off “Translate options” for “Products” and permalink got back to normal

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

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author sbouey

    (@sbouey)

    Hi,

    i will see to install this “Annasta Woocommerce Product Filters” plugin on a test site and see if i can find a solution

    perhaps a bug or a fix to do in
    public function registered_post_type($post_type, $post_type_obj)
    from
    src/Falang/Core/Falang_Rewrite.php

    i have already something on this
    // Fix the rewrite rules when the product permalink have %product_cat% flag.

    Stéphane

    Thread Starter makc57

    (@makc57)

    Dear Stéphane,

    Thank you for getting back to me on this matter.

    // Fix the rewrite rules when the product permalink have %product_cat% flag.

    Kindly advise on steps how to fix it I am not that good at php

    Best regards,

    Thread Starter makc57

    (@makc57)

    Dear Stéphane,

    Any updates on this case?

    Kinds regards,
    Max

    Thread Starter makc57

    (@makc57)

    Dear Stephane,

    Can we tweak .htacsess file may using this?

    RewriteEngine On

    RewriteRule …….

    Please advise on rewrite tule for this case if possible

    Kind regards,

    • This reply was modified 2 years, 6 months ago by makc57.
    Plugin Author sbouey

    (@sbouey)

    yes probably,
    i haven’t yet make the test site for your problem , i was on update for subscriber of Falang for Elementor

    I keep you informed.

    Stéphane

    Plugin Author sbouey

    (@sbouey)

    Hi,

    i start to look at your problem and install locally
    1 – woocommerce with the sample data
    2 – the free Annasta Woocommerce Product Filters
    3- i try with storefront and angel theme but i can’t have the filter displayed

    i use the default configuration

    Stéphane

    Thread Starter makc57

    (@makc57)

    Dear Stephane,

    As far as I understood you need help with displaying Annasta Filters. Please refer to my setting to display it
    screenshot

    Let me know if it doesn’t work for you

    Kind regards,
    Max

    Plugin Author sbouey

    (@sbouey)

    Thanks for the screenshot i manage to make it working on my local site
    i can look why it’s not working now.

    it’s seem the filter work fine but only the url is changed in the browser with
    %product_cat-slug%

    Stéphane

    Plugin Author sbouey

    (@sbouey)

    Hi,

    it’s take some time to find but finally nothing to do exept to set a settings

    Ansasta Filters > plugin Settings > Hierarchical archive links (enable checkbox)

    see capture here

    https://paste.pics/ffa71b1a1f6610ee34e3a82648b7a72d

    Best regards,
    Stéphane

    • This reply was modified 2 years, 6 months ago by sbouey.
    Thread Starter makc57

    (@makc57)

    Dear Stephane,

    Thanks for getting back to me.

    Tried this option and it gives correct url for the current page, however when we look at pagination it generates wrong urls fro pages. Please refer to image below

    https://ibb.co/ck7hYSr

    Any any idea how to fix urls in Pagination also?

    Kinds regards,
    Max

    • This reply was modified 2 years, 6 months ago by makc57.
    • This reply was modified 2 years, 6 months ago by makc57.
    Plugin Author sbouey

    (@sbouey)

    Hi,

    yes the pagination is done by the ajax query , it’s why it’s not translated.
    i have too look the good way to fix this
    but you can add in your function.php of your template this at the end

    function falang_term_link($termlink, $term, $taxonomy) {
        if (wp_doing_ajax() && isset($GET['action']) && 'awf' == $GET['action']  ){
            if (preg_match( '/(%product_cat-slug%)/', $termlink, $matches)){
                $termlink = str_replace('%product_cat-slug%','product_cat',$termlink);
                return $termlink;
            }
        }
        return $termlink;
    }
    
    add_filter('term_link', 'falang_term_link',3,10);
    

    in my case the link become
    https://…../en/product_cat/clothing/page/2/?archive-filter=1

    Stéphane

    Thread Starter makc57

    (@makc57)

    Dear Stéphane,

    Thanks for some coding for me!

    Added this code via Code Snippets& For some reasons it still shows wrong link for pagination as before (https://ibb.co/ck7hYSr)

    Kind regards,
    Max

    Plugin Author sbouey

    (@sbouey)

    can you give me a screenshot of the code you put in the function.php

    Stéphane

    Thread Starter makc57

    (@makc57)

    Dear Stephane,

    Here is a screenshot
    https://ibb.co/Jtmns5n

    Kind regards,
    Max

    Plugin Author sbouey

    (@sbouey)

    I try locally with Code Snippet and work without problem
    you can perhaps try without the first test like this

    function falang_term_link($termlink, $term, $taxonomy) {
        //if (wp_doing_ajax() && isset($GET['action']) && 'awf' == $GET['action']  ){
            if (preg_match( '/(%product_cat-slug%)/', $termlink, $matches)){
                $termlink = str_replace('%product_cat-slug%','product_cat',$termlink);
                return $termlink;
            }
        //}
        return $termlink;
    }
Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Permalinks issue’ is closed to new replies.