Home Forums WoodMart support forum Error After Theme Update

Error After Theme Update

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #102366

    36styles
    Participant

    After updating to the latest version of the theme, I have started seeing this error message on all product pages:

    Warning: Invalid argument supplied for foreach() in /home/styles/public_html/wp-content/themes/woodmart/inc/integrations/woocommerce/modules/swatches.php on line 277

    I deactivated all plugins, that were not part of the Woodmart theme, and the problem remained.

    My site is still under construction and is not live yet. I would apprecite any help you can provide for this issue. Thank you so much.

    #102375

    Artem Temos
    Keymaster

    Hello,

    Thank you so much for contacting our support center.

    Could you please disable all plugins that are not related to our theme and provide us your admin access so we can check it?

    Thank you in advance

    #102602

    36styles
    Participant

    Thank you. Info provided.

    #102622

    Artem Temos
    Keymaster

    Admin access is not correct and we can’t login.

    #102648

    36styles
    Participant

    Correct info provided.

    #102666

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to fix this

    function woodmart_get_active_variations( $attribute_name, $available_variations ) {
    		$results = array();
    
    		if ( ! $available_variations ) {
    			return $results;
    		}
    
    		foreach ( $available_variations as $variation ) {
    			$attr_key = 'attribute_' . $attribute_name;
    			if ( isset( $variation['attributes'][ $attr_key ] ) ) {
    				$results[] = $variation['attributes'][ $attr_key ];
    			}
    		}
    
    		return $results;
    	}
    #102750

    36styles
    Participant

    The code worked!! Thank you so much for your help with this issue. Excellent theme and excellent support. This was only the first issue that came up while using the theme, and it was resolved fairly quickly. I do appreciate the great customer support. Thanks again.

    #102790

    Artem Temos
    Keymaster

    Great, you are welcome!

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

The topic ‘Error After Theme Update’ is closed to new replies.