Support » Plugin: Year Make Model Search for WooCommerce » & for Category’s

  • Resolved samwood7991

    (@samwood7991)


    Hey there, Love the plugin, works perfectly. Just recently stumbled upon a problem that when/if a woocommerce category has the & symbol the plugin takes that and spits out the following for example transmission & Driveline when it should read transmission & Driveline

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    Try to replace the line:

    
    $categoryTree[$id] = array('title' => $parentCat->name, 'children' => array());
    

    with:

    
    $categoryTree[$id] = array('title' => wp_specialchars_decode($parentCat->name), 'children' => array());
    

    and the line:

    
    $categoryTree[$catId]['title'] = $category->name;
    

    with:

    
    $categoryTree[$catId]['title'] = wp_specialchars_decode($category->name);
    

    in the file:
    wp-content/plugins/ymm-search/ymm_ajax.php

    Stanislav

    Thread Starter samwood7991

    (@samwood7991)

    You’re a legend! that worked perfectly, thank you very very much!

    Wasca

    (@wasca)

    @pektsekye

    Thanks for the fix for this, I also had that issue. Will this fix be released in a future update?

    Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    The wp_specialchars_decode() function can affect website performance. Especially when it is used inside a loop.
    It depends on the number of the categories on your website.

    For some reason WordPress or WooCommerce saves wrong data in the database.
    If the category name is “Transmission & Driveline” it should be saved the same in the database.

    Now it saves it like “Transmission & amp ; Driveline” and then we have to use some special functions to covert it back and affect the website performance.

    So for now it is a temporary fix that is not included into the original version of this plugin.

    Stanislav

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘& for Category’s’ is closed to new replies.