Home Forums WoodMart support forum HTTP ERROR 500

HTTP ERROR 500

Viewing 30 posts - 1 through 30 (of 35 total)
  • Author
    Posts
  • #103701

    charigin69
    Participant

    Hello, after updating the theme, when I try to save the product after changing it, I get an error 500, but only in a grouped product.
    tried to find at what point it happens, and after adding products, (screenshot)

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

    Artem Temos
    Keymaster

    Hi,

    500 Internal Error says about some issue on the server and can be caused by different things. Anyway, to understand its nature you need to see your server error logs or enable PHP error display on the website. If you can’t do this, you need to contact your hosting provider for help in this question. Here is an article that may help you understand the error better http://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/

    Regards

    #103792

    charigin69
    Participant

    Here is what they said in hosting support
    Included error logging in the PHP_errors.log file, it is located in the public_html directory of your site. Judging by the log, the site does not work due to the following error:
    [24-Jan-2019 04:28:47 UTC] PHP Fatal error: Uncaught Error: Call to undefined method WC_Product_Grouped::get_available_variation() in /home/c/charighl/mebel/public_html/wp-content/themes/woodmart/inc/integrations/woocommerce/modules/variation-gallery.php:90
    tell me what it is and how to deal with it?

    #103798

    charigin69
    Participant

    here is the file:
    [24-Jan-2019 04:28:47 UTC] PHP Fatal error: Uncaught Error: Call to undefined method WC_Product_Grouped::get_available_variation() in /home/c/charighl/mebel/public_html/wp-content/themes/woodmart/inc/integrations/woocommerce/modules/variation-gallery.php:90
    Stack trace:
    #0 /home/c/charighl/mebel/public_html/wp-includes/class-wp-hook.php(288): woodmart_remove_unnecessary_vg_data(49773)
    #1 /home/c/charighl/mebel/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
    #2 /home/c/charighl/mebel/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
    #3 /home/c/charighl/mebel/public_html/wp-includes/post.php(3747): do_action(‘save_post’, 49773, Object(WP_Post), true)
    #4 /home/c/charighl/mebel/public_html/wp-includes/post.php(3820): wp_insert_post(Array, false)
    #5 /home/c/charighl/mebel/public_html/wp-admin/includes/post.php(399): wp_update_post(Array)
    #6 /home/c/charighl/mebel/public_html/wp-admin/post.php(206): edit_post()
    #7 {main}
    thrown in /home/c/charighl/mebel/public_html/wp-content/themes/woodmart/inc/integrations/woocommerce/modules/variation-gallery.php on line 90

    #103811

    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?

    Thank you in advance

    #103814

    charigin69
    Participant

    My main site https://mmslon.ru was still not new, I decided to try it on a test site, now I try it on a second test site.
    plugins deactivated to no avail
    I go to the admin panel – goods, select any test item, put the grouped save, the error occurs after loading the product – see the screenshot, further changes after clicking the save button give an error

    #103816

    charigin69
    Participant

    password

    #103821

    Artem Temos
    Keymaster

    We can’t access with this data.

    #103830

    charigin69
    Participant

    админ

    #103831

    Artem Temos
    Keymaster

    You didn’t disable additional plugins yet

    #103833

    charigin69
    Participant

    disconnected

    #103851

    Artem Temos
    Keymaster

    It seems to work correctly now. Please, check how it works now.

    #103855

    charigin69
    Participant

    Strange but I also have everything, cache deleted.
    all 500

    #103862

    Artem Temos
    Keymaster

    Where exactly do you see it?

    #103864

    charigin69
    Participant

    I take any goods I make it grouped I add products to the group I save and voila 500

    #103868

    charigin69
    Participant

    Now I put on the second test site the old version of the theme, everything works.

    #103877

    Artem Temos
    Keymaster

    Hello,

    Could you please check how it works with some default WordPress theme like twentysixteen to understand is it our theme issue or not?

    Regards

    #103878

    charigin69
    Participant

    Yes, I spent half a day, I installed 3.0 at the beginning, then I updated it to 3.4, the error repeated after the update!!!
    после & ставит amp; уберите

    #103881

    Artem Temos
    Keymaster

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

    function woodmart_remove_unnecessary_vg_data( $post_id ) {
    		if ( ! woodmart_woocommerce_installed() ) {
    			return;
    		}
    
    		$product = wc_get_product( $post_id );
    
    		if ( ! $product || $product->get_type() != 'variable' ) {
    			return;
    		}
    
    		$available_variations = array();
    
    		foreach ( $product->get_children() as $child_id ) {
    			$available_variations[] = $product->get_available_variation( wc_get_product( $child_id ) );
    		}
    
    		$available_variations = array_values( array_filter( $available_variations ) );
    		
    		$variations             = $product->get_type() == 'variable' ? $available_variations : '';
    		$variations_ids         = array();
    		$variation_gallery_data = get_post_meta( $post_id, 'woodmart_variation_gallery_data', true );
    
    		if ( ! $variations || ! $variation_gallery_data ) {
    			return;
    		}
    
    		foreach ( $variations as $variation ) {
    			$variations_ids[] = $variation['variation_id'];
    		}
    
    		foreach ( $variation_gallery_data as $key => $data ) {
    			if ( ! in_array( $key, $variations_ids ) && isset( $variation_gallery_data[ $key ] ) ) {
    				unset( $variation_gallery_data[ $key ] );
    			}
    		}
    
    		update_post_meta( $post_id, 'woodmart_variation_gallery_data', $variation_gallery_data );
    	}
    
    	add_action( 'save_post', 'woodmart_remove_unnecessary_vg_data' );
    #103882

    charigin69
    Participant

    Today will be a holiday, everything seems to work, I will look further, thank you!

    #103884

    Artem Temos
    Keymaster

    You are welcome.

    #105336

    LeoY
    Participant

    Did this solution actually work ?

    Same problem here and tried the php function in child template. But still the same error occurs when saving a grouped product that contains single products.

    #105348

    Artem Temos
    Keymaster

    Yes, it should work. If it doesn’t work for you, please, disable all external plugins and send us your FTP as well as admin access via the Private content field.

    #105382

    LeoY
    Participant

    See privat content.

    #105416

    Artem Temos
    Keymaster

    Sorry, we can’t access your server with this FTP. We suggest you to wait for the next update where we will include this fix. It will be released in 1-2 weeks.

    #105466

    LeoY
    Participant

    Please retry with same ftp credentials.

    #105477

    Artem Temos
    Keymaster

    Still the same. Just wait for the next update where the problem will be fixed.

    #105486

    LeoY
    Participant

    We’re on a strict deadline for bringing shop up next week.
    Ftp details are working. Additional info in private content.
    Please check.

    #105488

    Artem Temos
    Keymaster

    Try to add the code and send us a screenshot where you placed it.

    #105710

    LeoY
    Participant

    functions.php in child theme and image of locations attached.

    Attachments:
    You must be logged in to view attached files.
Viewing 30 posts - 1 through 30 (of 35 total)

The topic ‘HTTP ERROR 500’ is closed to new replies.