Home Forums WoodMart support forum If there are more than 24 variations of products, an error occurs.

If there are more than 24 variations of products, an error occurs.

Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #104331

    brend
    Participant

    If the product variation of more than 24 begins to knock out the error.

    Attachments:
    You must be logged in to view attached files.
    #104342

    Artem Temos
    Keymaster

    Hi,

    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;
    	}
    #104348

    brend
    Participant

    makes a mistake:
    Unable to connect to the site to check the code for errors, there was made a rollback of changes in the PHP code. You need to download the changed PHP file in a different way, for example through FTP or SFTP.
    1. What code did you send to add as in the screenshot?
    2. Add the code to the hosting?

    Attachments:
    You must be logged in to view attached files.
    #104387

    Artem Temos
    Keymaster

    You need to add that code in the child theme functions.php file. Yes, you can do this with FTP or via your hosting control panel.

    Regards

    #104420

    brend
    Participant

    Did not help Check out screenshots, maybe I did not put your code there wherever it is.

    Attachments:
    You must be logged in to view attached files.
    #104427

    Artem Temos
    Keymaster

    Hello,

    Could you please disable all plugins that are not related to our theme and provide us your admin access so we can check it? And send us a link where we can see them.

    Thank you in advance

    #104448

    brend
    Participant
    #104449

    Artem Temos
    Keymaster

    We see that you didn’t activate the child theme yet.

    #104452

    brend
    Participant

    As if activated. Now he does not want to re-activate. Maybe you activate

    #104453

    brend
    Participant

    Can’t find WP_Importer or WOODCORE_Import class

    #104472

    Artem Temos
    Keymaster

    Please, add the code to the child theme so we can test it.

    #104479

    brend
    Participant

    Child theme – Retail

    #104492

    Artem Temos
    Keymaster

    Have you added the code?

    #104498

    brend
    Participant

    I do not understand what code you need. Purchase Code?

    #104499

    Artem Temos
    Keymaster

    No, we are talking about the code that we gave you in the very first message https://xtemos.com/forums/topic/if-there-are-more-than-24-variations-of-products-an-error-occurs/#post-104342

    #104500

    brend
    Participant

    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;
    }

    #104502

    brend
    Participant

    Yes, I added the code.

    #104504

    Artem Temos
    Keymaster

    No, you didn’t add the code to the functions.php file in the child theme.

    #104505

    brend
    Participant

    see screenshots.

    Attachments:
    You must be logged in to view attached files.
    #104512

    brend
    Participant

    see screenshots. Screenshot of hosting

    Attachments:
    You must be logged in to view attached files.
    #104524

    brend
    Participant

    I do not see what you wrote to me

    Attachments:
    You must be logged in to view attached files.
    #104546

    Artem Temos
    Keymaster

    Sorry, but the code is not added. Maybe you are trying to add to a wrong location. If you have difficulties doing this, we suggest you just to wait till the next update. We will fix these notices anyway.

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