Home Forums WoodMart support forum Cyrillic symbols in Product Archive and Single Product pages

Cyrillic symbols in Product Archive and Single Product pages

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #516959

    eyordanovvv
    Participant

    Hello, I am trying to customize the price shown on product archive page. I use the following snippet, which works great:

    function custom_price_string_on_archive_pages($price, $product) {
    // Check if it’s an archive page (shop or product category/tag)
    if (is_archive() || is_shop()) {
    // Add “от ” in front of the price
    $price = ‘от ‘ . $price;
    }
    return $price;
    }

    add_filter(‘woocommerce_get_price_html’, ‘custom_price_string_on_archive_pages’, 10, 2);

    It adds “от ” in front of my lower price for variable products. Unfortunately the cyrillic symbols show as “??”. Not sure what might be causing this. Please let me know how I can resolve.

    Attachments:
    You must be logged in to view attached files.
    #517081

    Artem Temos
    Keymaster

    Hello,

    Could you please check how it works with some default WordPress themes like TwentyTwenty or WooCommerce Storefront to understand is it our theme issue or not?

    Regards

    #517087

    eyordanovvv
    Participant

    It is the same with twentytwentythree theme. Again shows “??”. I had Astra before and it was working well.. How can I fix this?

    Attachments:
    You must be logged in to view attached files.
    #517153

    Artem Temos
    Keymaster

    If it doesn’t work with other themes as well then it is not caused by WoodMart. Looks like something is wrong with your code or file encoding. But fixing such customizations is out of our theme support scope.

    Kind Regards

    #517224

    eyordanovvv
    Participant

    The way I fixed this is downloading functions.php of the child theme. Opened with Notepad++, selected all text and from Encoding -> Convert to UTF-8. Then re-uploaded and worked like a charm.

    #517259

    Artem Temos
    Keymaster

    Great, we are glad that you sorted it out! Feel free to contact us if you have any further questions.

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