Home Forums WoodMart support forum WoodMart forcing data-threshold=”1″ breaks Variation Swatches plugin

WoodMart forcing data-threshold=”1″ breaks Variation Swatches plugin

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #693075

    marcosrjdesouza
    Participant

    Hello WoodMart Support Team,

    We are experiencing a critical conflict on our site involving your theme and the “Variation Swatches for WooCommerce” plugin (by GetWooPlugins).

    The Problem: On highly complex variable products (one product has 359 variations), the variation swatches do not work. Instead of showing the “Unavailable” or “X” styles, the page shows the default WooCommerce error message.

    Here is the BROKEN product page (359 variations): https://wheat-crow-333766.hostingersite.com/produto/innovcable-cabo-de-controle-bf-fa-nbr-7289/

    To replicate the error: Select “42” (Nº de condutores), “10,00” (Seção (mm²)), and “Sim” (Proteção verde-terra?). This will trigger the error.

    For comparison, here is a simple product that works CORRECTLY: https://wheat-crow-333766.hostingersite.com/produto/innovcable-pvc-jb-ob/

    On this “working” page, the swatches show an “X” as expected. This proves the issue is isolated to complex products.

    The Root Cause (We have debugged this): Your theme is programmatically writing data-threshold=”1″ directly into the HTML of the <form class=”variations_form”> element for the broken product.

    The woo-variation-swatches plugin script reads this “1”, sees that the product’s total variations (359) is greater than the threshold (1), and disables itself for performance.

    What We Have Tried (and failed):

    Our console is 100% clean (we fixed all jQuery/LiteSpeed/Side Cart errors).

    We tried forcing the woo-variation-swatches script to load using your Performance settings (“Scripts always load”). This works, but the script still reads data-threshold=”1″ and disables itself.

    We tried using a high-priority MutationObserver (injected via PHP into wp_head at priority 1) to change data-threshold=”1″ to data-threshold=”600″. Your theme’s script (woodmart-theme.js) wins this “race condition” and changes the value back to “1”.

    Our Question: How can we stop the WoodMart theme from writing data-threshold=”1″ on complex products? What is the correct PHP filter or theme setting to change this threshold value?

    Thank you.

    #693078

    marcosrjdesouza
    Participant

    Hello, I have created an account.

    #693100

    Artem Temos
    Keymaster

    Hello

    Thank you for your detailed explanation. Unfortunately, the “Variation Swatches for WooCommerce” plugin by GetWooPlugins is not compatible with the WoodMart theme due to the way our theme handles the data-threshold attribute for variable products. This behavior is hardcoded in the theme and cannot be modified via a PHP filter or theme setting at this time.

    We recommend using our theme’s swatches functionality in this case.

    If you need further assistance or recommendations, please let us know.

    Regards

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