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.
- This topic has 21 replies, 2 voices, and was last updated 5 years, 11 months ago by Artem Temos.
-
AuthorPosts
-
January 27, 2019 at 5:26 pm #104331
brendParticipantIf the product variation of more than 24 begins to knock out the error.
Attachments:
You must be logged in to view attached files.January 27, 2019 at 5:49 pm #104342
Artem TemosKeymasterHi,
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; }
January 27, 2019 at 6:04 pm #104348
brendParticipantmakes 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.January 28, 2019 at 7:00 am #104387
Artem TemosKeymasterYou 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
January 28, 2019 at 8:54 am #104420
brendParticipantDid 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.January 28, 2019 at 9:01 am #104427
Artem TemosKeymasterHello,
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
January 28, 2019 at 10:31 am #104448
brendParticipantPlug-ins turned off. Link https://www.brend.ltd/product/elektromotocikl-elwinn-em-120/
January 28, 2019 at 10:36 am #104449
Artem TemosKeymasterWe see that you didn’t activate the child theme yet.
January 28, 2019 at 10:48 am #104452
brendParticipantAs if activated. Now he does not want to re-activate. Maybe you activate
January 28, 2019 at 10:49 am #104453
brendParticipantCan’t find WP_Importer or WOODCORE_Import class
January 28, 2019 at 12:49 pm #104472
Artem TemosKeymasterPlease, add the code to the child theme so we can test it.
January 28, 2019 at 12:58 pm #104479
brendParticipantChild theme – Retail
January 28, 2019 at 1:44 pm #104492
Artem TemosKeymasterHave you added the code?
January 28, 2019 at 1:51 pm #104498
brendParticipantI do not understand what code you need. Purchase Code?
January 28, 2019 at 1:52 pm #104499
Artem TemosKeymasterNo, 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
January 28, 2019 at 1:54 pm #104500
brendParticipantfunction 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;
}January 28, 2019 at 1:57 pm #104502
brendParticipantYes, I added the code.
January 28, 2019 at 1:57 pm #104504
Artem TemosKeymasterNo, you didn’t add the code to the functions.php file in the child theme.
January 28, 2019 at 2:00 pm #104505January 28, 2019 at 2:15 pm #104512
brendParticipantsee screenshots. Screenshot of hosting
Attachments:
You must be logged in to view attached files.January 28, 2019 at 2:42 pm #104524
brendParticipantI do not see what you wrote to me
Attachments:
You must be logged in to view attached files.January 28, 2019 at 3:43 pm #104546
Artem TemosKeymasterSorry, 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.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register