WC – product page variations code error after update

This topic has 2 replies, 2 voices, and was last updated 8 years, 8 months ago ago by Jack Richardson

  • Avatar: Peter_rambeck
    Peter_rambeck
    Participant
    August 21, 2015 at 14:54

    Dear Eva

    Trust all is well,
    After recent update, the product page display a code error,

    Warning: Invalid argument supplied for foreach() in /home/indochi0/public_html/wp-content/themes/legenda/framework/theme-functions.php on line 3147
    This product is currently out of stock and unavailable.

    as well as, CMS dashboard show this message:

    Your theme (LEGENDA – child) contains outdated copies of some WooCommerce template files. These files may need updating to ensure they are compatible with the current version of WooCommerce. You can see which files are affected from the system status page. If in doubt, check with the author of the theme.

    Product page link: http://www.indochinaexplorers.com/product/ramada-plaza-riverside

    Can you kindly advise me what to do?

    Thank you Peter

    1 Answer
    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    August 21, 2015 at 15:46

    Hello,

    I’ve added this code in child theme functions.php file:

    function custom_wc_ajax_variation_threshold( $qty, $product ) {
    	return 100;
    }
    
    add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 100, 2 );

    You can read about it here:
    https://woocommerce.wordpress.com/2015/07/13/improving-the-variations-interface-in-2-4/

    Please check your page now.

    Best regards,
    Jack Richardson.

  • Viewing 2 results - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.