• I noticed that regardless of localization, the search bar label comes up as “All” which comes from .js because the option is an empty string in line 185 of shopper-wc-template-function.php, version 1.3.6

    Applying this slight change of substituting the localized value did the trick, i.e. if the string is not empty then the hardwired default from .js does not kick in:

    $select .= apply_filters('shopper_cat_all_option', '<option value="'. esc_html__( 'All', 'shopper' ) .'">'. esc_html__( 'All', 'shopper' ) .'</option>' );
    

    Not sure if I should use esc_attr__ instead of esc_html__ though.
    Maybe it would be even better to register and localize shopper.min.js itself.
    As a side note, I don’t get the idea of displaying human friendly cat name in dropdown but then using the slug(?) in the label. If it’s intentional then fine. Otherwise, please fix.

    • This topic was modified 6 years, 4 months ago by surrano.
    • This topic was modified 6 years, 4 months ago by surrano.

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

  • The topic ‘shopper_cat_all_option is not localized properly’ is closed to new replies.