• Resolved jordytwinsense

    (@jordytwinsense)


    The linked page is an example of a product with multiple variations. The problem is that I can’t select/activate any variations so I can’t add the product to my basket. When I deactivate the variation swatches plugin I see the default Woocommerce dropdown variations and these work perfectly fine.

    Since I don’t see any error’s I have no clue what the problem could be. Am I missing something in the plugin settings?

    Any help would be greatly appreciated.

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

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support fizanzvai

    (@fizanzvai)

    Hi,

    Thanks for reaching out to us. You have console errors from another plugin- https://paste.pics/S2M7Y

    Kindly do a plugin compatibility check by doing these steps to identify the error :

    => Install & Activate a plugin called Health Check & Troubleshooting.

    => Enable the troubleshooting mode- https://paste.pics/QXIXW

    => Deactivate all of your additional plugins except WooCommerce and Variation Swatches Plugin in troubleshooting mode.

    => See if the problem persists.

    => If the problem is resolved, you can understand which plugin might be the culprit of this error by activating your additional plugins one by one.

    Looking forward to hearing from you soon.

    Thank You

    Thread Starter jordytwinsense

    (@jordytwinsense)

    Hi,

    Thanks for your reply. I didn’t get this error on my local build so I haven’t noticed it. But it was caused by woocommerce payments, which we don’t use anyway so I disabled it.

    Sadly this hasn’t resolved my issue and the health check doesn’t show any problems relative to this issue, just some caching and auto-updates issues which will be resolved by us later on when going live.

    Turning off all plugins hasn’t helped either, the problem kept persisting.

    Any other ideas?

    Plugin Support fizanzvai

    (@fizanzvai)

    Hi,

    Can you please test it with a default theme like “Storefront”?

    Please kindly do a theme conflict check by doing these steps to identify the error :

    => Enable the troubleshooting mode- https://paste.pics/QXIXW

    => Activate a default theme like StoreFront- https://paste.pics/QXIYF

    => See if the problem persists. 

    => If the problem is resolved, you can understand if the issue is arising for the theme or not.

    Thank You

    Thread Starter jordytwinsense

    (@jordytwinsense)

    Hi,

    Looks like it does work when I enable just storefront and all plugins. It has to be something in our custom theme. Any tips on how I could find the source of the issue that interferes with your plugin?
    We have some custom woocommerce templates which I each enabled/disabled but no difference.
    I also tried going through my functions.php code and disabling code bit by bit and nothing seems to cause it.

    Plugin Support fizanzvai

    (@fizanzvai)

    Hi,

    Yes, the issue is with your custom theme. Did you change the template of WooCommerce? I can see a class is missing in the form element. This should be like this- https://paste.pics/S2NSM

    So, one of your modifications is preventing to push swatches class to the form. If you enqueued any scripts, please start from there. Please comment only on hooks (add_action/add_filter) to identify the issue.

    Thank You

    Thread Starter jordytwinsense

    (@jordytwinsense)

    Yes I have my own custom variable.php template. But it uses the same HTML buildup as the default template. I see no reason why the swatches class can’t be pushed unless it only looks for the form once, and my template gets loaded after your plugin looks for the variations_form class?

    Also i renamed the variable.php template so the default is used, but the class still isn’t added to the form.

    Plugin Support fizanzvai

    (@fizanzvai)

    Hi,

    It is not only happening for the template modification. Your theme enqueued scripts and perhaps one script is causing the issue.

    .wvs-loaded class initiated by the frontend.min.js. So, you have to check all your scripts to identify the error.

    Thank You

    Thread Starter jordytwinsense

    (@jordytwinsense)

    It seems that your script was being loaded too early.

    I seem to have fixed it by adding the following script to my functions.php:

    //load variation swatches frontend script later

    function defer_woocommerce_variation_swatches_script() {

      // Check if WooCommerce is active

      if ( class_exists( 'WooCommerce' ) ) {

          // Deregister the original script of WooCommerce Variation Swatches

          wp_deregister_script( 'wcvs-frontend' );

          // Register and enqueue the script again with a lower priority

          wp_enqueue_script(

              'wcvs-frontend', // Handle for the script

              get_site_url() . '/wp-content/plugins/woo-variation-swatches/assets/js/frontend.min.js', // Path to the script

              array( 'jquery' ), // Possible dependencies (like jQuery)

              '1.0.0', // Version of the script

              true // Load in the footer (ensures it loads after other scripts)

          );

      }

    }

    // Load the script with a lower priority

    add_action( 'wp_enqueue_scripts', 'defer_woocommerce_variation_swatches_script', 20 ); // Priority 20 to load the script later

    Maybe this might be helpful to other people with a similar issue.

    Thank you for the quick replies and all your help!

    Plugin Support fizanzvai

    (@fizanzvai)

    Hi,

    Glad to know you found it with the enqueue script section.

    We get excited & honored when you use our plugin on your site.

    If you found our plugin & support helpful, could you please leave your valuable feedback here: https://www.ads-software.com/support/plugin/woo-variation-swatches/reviews/

    Your feedback keeps us inspired.

    Thank You

    God bless you

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.