• Hello, I updated WooCommerce and WCBoost to the newest version. If I go now on a product site, all sizes even unavailable sizes are going to look like that in code:

    <ul class="wcboost-variation-swatches__wrapper" data-attribute_name="attribute_pa_groesse"><li class="wcboost-variation-swatches__item wcboost-variation-swatches__item-36" style="" aria-label="36" data-value="36" tabindex="0" role="button">
    						<span class="wcboost-variation-swatches__name">36</span>
    					</li><li class="wcboost-variation-swatches__item wcboost-variation-swatches__item-38" style="" aria-label="38" data-value="38" tabindex="0" role="button">
    						<span class="wcboost-variation-swatches__name">38</span>
    					</li><li class="wcboost-variation-swatches__item wcboost-variation-swatches__item-40" style="" aria-label="40" data-value="40" tabindex="0" role="button">
    						<span class="wcboost-variation-swatches__name">40</span>
    					</li><li class="wcboost-variation-swatches__item wcboost-variation-swatches__item-42" style="" aria-label="42" data-value="42" tabindex="0" role="button">
    						<span class="wcboost-variation-swatches__name">42</span>
    					</li><li class="wcboost-variation-swatches__item wcboost-variation-swatches__item-44" style="" aria-label="44" data-value="44" tabindex="0" role="button">
    						<span class="wcboost-variation-swatches__name">44</span>
    					</li><li class="wcboost-variation-swatches__item wcboost-variation-swatches__item-46" style="" aria-label="46" data-value="46" tabindex="0" role="button">
    						<span class="wcboost-variation-swatches__name">46</span>
    					</li><li class="wcboost-variation-swatches__item wcboost-variation-swatches__item-48" style="" aria-label="48" data-value="48" tabindex="0" role="button">
    						<span class="wcboost-variation-swatches__name">48</span>
    					</li></ul>

    First when I click on one available size the classes for the unavailable sizes receive a class called disabled, but first after I clicked on one available size, how can I fix that?

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WCBoost

    (@wcboost)

    Hello,

    Thanks for your feedback. We’ve made a test on our website, the plugin load available options. It means the options “44, 46, 48” should be being loaded on your product page.

    Please check the version of the plugin and update it if it isn’t the latest version (v1.0.15).

    Thank you

    We face the same problem as @timnicklas. We are running Variation Swatches version 1.0.15 with WooCommerce 8.6.1. According to your documentation it is our understanding that the free version of Variation Swatches should not show swatches for out of stock products if hide out of stock products from catalog is enabled in WooCommerce settings and that only the premium version would allow having all swatches shown with those which are out of stock being shown in disabled state (How to disable out of stock swatches – WCBoost Documentation).

    The current behavior of the free version does not match the documentation. As @timnicklas already outlined swatches for all variations irrespective of the respective variation being in stock are shown. We would be fine with this behavior as long as variations not in stock would be shown in a disabled state, but this is apparently a feature of the premium edition only. Currently, on page load all variations are shown as if they were in stock and only after onUpdateAttributes (see frontend-min.js) is triggered for the first time out of stock variations will receive the disabled css class and thus be shown in a disabled state.

    The current behavior of showing all swatches is due to the fact that swatches for all variations are created in the backend see swatches.php function swatches_html. This function is invoked from function wc_dropdown_variation_attribute_options (woocommerce) via the filter hook woocommerce_dropdown_variation_attribute_options_html. Here woocommerce passes all options to the filter and in consequences the Variation Swatches plugin creates swatches for all options. This behavior closely mirrors the behavior of the woocommerce default functions for creating the dropdown menu for product variations. Here also options for all variation attributes, whether in stock or not, are generated and included in the html served to the client. However, any option elements for variation attributes out of stock are subsequently removed with javascript on the client side (see https://github.com/woocommerce/woocommerce/blob/e38ffc8427ec4cc401d90482939bae4cddb69d7c/plugins/woocommerce/client/legacy/js/frontend/add-to-cart-variation.js#L475).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Stock available Bug’ is closed to new replies.