Home Forums WoodMart support forum ” – ” appears on Frequently Bought Together

” – ” appears on Frequently Bought Together

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #699582

    elhousni.karim
    Participant

    Hello,
    I have created bundles and “<span>” and “</span>”is appearing in the title of the product on Frequently Bought Together section.
    See screenshot.
    Thanks in advance.
    Kind regards,

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

    Hello,

    Sorry to hear about the inconvenience. Kindly, please share your Site WP-ADMIN Login details in the Private Content field so that we can check this concern on your Site and help you out accordingly.

    Best Regards,

    #700171

    elhousni.karim
    Participant

    Here my website link, you will be able to check

    #700283

    Hello,

    Please deactivate all the 3rd party plugins and activate only theme-required plugins on the site, and then check the issue. I am sure your issue will be solved. Then activate the 3rd party plugins one by one and check which plugin is creating the issue for you.

    Otherwise, if the issue still exists, then keep the 3rd party plugins deactivated and share the WP login details, so I can check and give you a possible solution.

    Best Regards,

    #700367

    elhousni.karim
    Participant

    When using the Frequently Bought Together module in WoodMart together with TranslatePress, the product titles inside the FBT summary box (right column) become corrupted.
    Instead of displaying a clean title like:
    Clear Bobo Standard by BOBO – x12

    WoodMart outputs:

    Clear Bobo Standard by BOBO <span> – </span>x12

    and in the FBT summary list it becomes even worse:

    Clear Bobo Standard by BOBO <span> – </span>x12

    The <span> – </span> separator added by WoodMart in the product title is HTML-escaped (<span>) when reused in the FBT bundle list, so the browser displays it as text instead of HTML.

    TranslatePress is not the cause — the issue occurs because the theme/module takes the product title (which contains HTML), escapes it, and reuses it in a context where it should not be escaped.

    Result:
    – Broken product titles
    – HTML tags shown on screen
    – FBT summary becomes unreadable

    Technical Cause

    Inside FBT markup, WoodMart uses:
    <span class=”wd-entities-title title”>
    Clear Gloss… <span> – </span> x12
    </span>

    The <span> comes from escaping the original <span> – </span> separator.

    Any time the product title contains HTML, FBT outputs an escaped version of that HTML, which is rendered as visible code.

    Fix needed in WoodMart / FBT module:

    WoodMart should not escape HTML inside product titles when rendering the FBT product list.

    Or:

    Remove the separator <span> – </span> from the product title generation, and replace it with a plain text separator:

    Alternatively, WoodMart should decode the escaped HTML before output.

    Temporary Workaround (JS Patch)

    Until WoodMart provides a fix, this JavaScript code restores correct titles by replacing the escaped tags:

    document.addEventListener(‘DOMContentLoaded’, function () {
    document.querySelectorAll(‘.wd-fbt-products .wd-entities-title’).forEach(function (el) {
    el.innerHTML = el.innerHTML.replace(/<span>\s*[-–]\s*<\/span>/g, ‘ – ‘);
    });

    document.querySelectorAll(‘.wd-fbt .product-image-link[aria-label]’).forEach(function (link) {
    var val = link.getAttribute(‘aria-label’);
    if (!val) return;
    val = val.replace(/<span>\s*[-–]\s*<\/span>/g, ‘ – ‘);
    link.setAttribute(‘aria-label’, val);
    });
    });

    This script fixes the visual issue but the real fix must come from WoodMart, since the escaping happens in their FBT rendering logic.

    Expected Outcome

    After WoodMart adjusts the FBT output:

    ✔ Titles will render correctly
    ✔ No escaped HTML will appear
    ✔ TranslatePress compatibility improves
    ✔ No JS workaround will be needed

    #700497

    Hello,

    Sorry to hear about the inconvenience. Kindly, please share your Site WP-ADMIN Login details in the Private Content field so that we can check this concern on your Site and help you out accordingly.

    Best Regards,

    #700589

    elhousni.karim
    Participant

    Hello, you have all detail on my previous message.
    The product titles inside WoodMart’s Frequently Bought Together module were displaying raw HTML, such as:
    Clear Bobo Standard by BOBO <span> – </span>x12
    and in the summary box:
    Clear Bobo Standard by BOBO <span> – </span>x12

    This happened because WoodMart escaped the <span> – </span> separator inside product titles when rendering them in the FBT list, causing the browser to show the tags as text.

    To resolve it, i added a small JavaScript fix (in WoodMart’s Custom JS panel) that detects escaped HTML like <span> and replaces it with a clean text separator –. This restores proper display of all product titles in the FBT module.

    Is that clear for you?

    Thanks

    #700681

    Hello,

    Thank you, Yes its clear! That’s great to hear that the issue has been fixed with JS.

    For any new issue in the future, you can always create a new topic.

    Have a nice day!

    Best Regards

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