Before you ask please READ THIS

Issue when using variations


I have setup some custom attributes / variations for a product on our site. But when you try to load it from the front end the variations dont come up.

See the attached image as inspected by chrome


It seems to be due to a conflict caused by the script in /public_html/wp-content/themes/fatmoon/js/jquery.countdown.min.js.

That script replaces one of the standard WordPress JavaScript functions related to templating, which is used by the script that loads variations. The replacement function returns an unexpected output, and that prevents WooCommerce from loading the variations.

A workaround, has been to rename file jquery.countdown.min.js, so that it's not loaded. That triggers an error on the page (because the file is not there), but it allows us to use the page correctly.

https://www.weseggs.com.au/shop/retail-products/barongarook-ham/

Have you seen this before?
image.png
1395 x 722 - 670K

Comments

  • AirAir
    Posts: 9,797
    Hey :-)

    Please check the private message that I have just send you. Thanks!

    With kind regards.
  • AirAir
    Posts: 9,797
    Hey :-)
    Weseggs said: It seems to be due to a conflict caused by the script in /public_html/wp-content/themes/fatmoon/js/jquery.countdown.min.js.
    How did you come up with idea that it is caused by this script? I would rather suspect different thing coming in conflict.
    Weseggs said: That script replaces one of the standard WordPress JavaScript functions related to templating, which is used by the script that loads variations. The replacement function returns an unexpected output, and that prevents WooCommerce from loading the variations.
    How did you come up with this observation? This is a script for countdown shortcode, and It doesn't have such things that you describe.

    I am asking you all this, cause I don't see anything in your screen shot that would suggest this.

    1. Could you turn on "buggy behavior", so I could check what is happening?
    2. Does this issue only show up on a product with variation?

    With kind regards.
  • Posts: 23
    A fella who does some coding for me come up with the above. I renamed that file and now that issue is not there. Just getting an expect 404 error now.

    It only shows up with product variations
  • Posts: 23
    What buggy behavior?
  • AirAir
    Posts: 9,797
    I asked could you return it back to the situation when it was broken, so I could see what is happening?

    With kind regards.
  • Posts: 23
    Hi Air,

    Yes I can do that, can we book in a time that suits? I just dont want to leave it like that as its on my live site
  • AirAir
    Posts: 9,797
    Hey :-)

    If you can, fire it in about 1 hour and I will take a look at it.

    Also, please send me temporary access to your WordPress so I could check there what is going on. Send it here on the forum via private message(click on my nick, in top-right corner you will find option "Message"). In message please add LINK to topic it applies to.

    By sending access to WordPress I mean:
    -create a new ADMIN account with a fake e-mail
    -set some password to this account
    -send me created login and password

    With kind regards.
  • Posts: 23
    All done, I have reverted to the fault situation

    Just let me know once you are finished
  • Posts: 23
    Its funny, I just reverted the renamed file and the original issue is now not there. But I am unable to add the product to the card with the variables filled in.

    See what you think

    Its a bit slow when using an admin account, just bear with it (another bug)
  • AirAir
    Posts: 9,797
    Please try this code for removing conflicting script:
    /*
     * Removes countdown script that conflicts with variable product in current configuration
     */
    function weseggs_remove_conflict_script(){
        //old naming
        wp_deregister_script( 'jquery.countdown' );
        //new naming
        wp_deregister_script( 'jquery-countdown' );
    }
    add_action( 'wp_enqueue_scripts', 'weseggs_remove_conflict_script', 30 ); //fires after scripts are registered by theme
    Add it in child theme in functions.php. You can add it at end of the file but before PHP closing tag, that looks like this ?>

    With kind regards.
  • Posts: 23
    I tried the code but it stops the main page from loading

    any thoughts?
  • AirAir
    Posts: 9,797
    Can you show me the screenshot how code looked after you inserted it? I suppose there was an error on adding code the file, probably slightly wrong place.

    With kind regards.
  • Posts: 23
    Here is what I have
    txt
    txt
    functions.txt
    8K
  • AirAir
    Posts: 9,797
    Looks good to me.

    However, it may need an extra empty line at end of this file.

    Try inserting this code I gave you, before this code :
    include_once( 'automatewoo-custom.php' );

    If this will still not work send me temporary FTP access by private message and I will do it for you.

    With kind regards.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!