CPT Category URL broken with: WPML & Location Filter & disable physical location

This topic contains 7 replies, has 3 voices, and was last updated by  Marc Mathys 7 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #349555

    Marc Mathys
    Expired Member
    Post count: 216

    Hi,

    I think I found a bug in the URL of translated CPT categories when:
    – A CPT is set with “disable physical location”
    – Location filter is on
    – Foreign language (WPML) is displayed

    The category widget works fine with all CPT and in both languages, or when no location filter is on… except for one CPT that has no location AND only in the translated French version AND only when location filter is on.

    I was checking general_functions.php at line 2910:
    post_type has a few issues:
    – it does not contain the root part of the URL
    – it is missing the language /fr/ part
    – it has weird combination of the English and the French slug
    – it contains geographical information when the location filter is set

    For now I fixed it by hardcoding a line between 2910 and 2911:

    if ($post_type == 'gd_online_shop' && ICL_LANGUAGE_CODE == 'fr' ) {$term_link = "http://my.domain.com/fr/shops-en-ligne/".$cat->slug;}

    Of course I have double checked WPML & in the SQL, my slugs are translated correctly.

    By the way, I noticed the same issue with the URL of the categories that I added to the menu of my theme. Will hardcode those as well.

    Would you have a cleaner (not hardcoding the domain) fix for me to apply somewhere until the next update?

    Best,
    Marc

    #349575

    Guust
    Moderator
    Post count: 29970

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #349669

    Kiran
    Moderator
    Post count: 7069

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #349684

    Marc Mathys
    Expired Member
    Post count: 216
    This reply has been marked as private.
    #349783

    Kiran
    Moderator
    Post count: 7069

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #350026

    Marc Mathys
    Expired Member
    Post count: 216

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #350169

    Kiran
    Moderator
    Post count: 7069

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #352463

    Marc Mathys
    Expired Member
    Post count: 216

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

Viewing 8 posts - 1 through 8 (of 8 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket