• Resolved stewarthowell

    (@stewarthowell)


    I updated Booster for WooCommerce from 4.4.1 to 4.5.0.
    Now this error appears whenever I try to view an order.

    Fatal error: Class 'WC_Shipping_WCJ_Custom_Template' not found in /home/jail/gefc/www/wp-content/plugins/booster-plus-for-woocommerce/includes/class-wcj-shipping.php on line 66
    
    The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.

    How can I solve this issue please?

    Regards,
    -Stew

Viewing 7 replies - 1 through 7 (of 7 total)
  • Same, its preventing checkout, this is a urgent issue!

    Thread Starter stewarthowell

    (@stewarthowell)

    This issue still exists in 4.5.1

    Thread Starter stewarthowell

    (@stewarthowell)

    Problem still exists in 4.6.0

    I fixed it by adding the following line into a file in the plugin.
    require_once( 'shipping/class-wc-shipping-wcj-custom.php' );

    The file to edit is…
    wp-content/plugins/booster-plus-for-woocommerce/includes/class-wcj-shipping.php

    And the place to add it in is just after line 63. In other words, just above the line starting with…
    $total_number =

    Hello @stewarthowell ,

    What is your WooCommerce version?
    It should be working.

    The file ‘shipping/class-wc-shipping-wcj-custom.php‘ should be being loaded with the init_template_class() function from the ‘woocommerce_shipping_init‘ hook, inside this file
    wp-content/plugins/booster-plus-for-woocommerce/includes/class-wcj-shipping.php.

    Anyway, I’ve took your suggestion to modify the add_wc_shipping_wcj_custom_class function. Now the next version will be like this:

    function add_wc_shipping_wcj_custom_class( $methods ) {
    	$total_number = get_option( 'wcj_shipping_custom_shipping_total_number', 1 );
    	if ( ! class_exists( 'WC_Shipping_WCJ_Custom_Template' ) ) {
    		$this->init_template_class();
    	}
    	for ( $i = 1; $i <= $total_number; $i ++ ) {
    		$the_method = new WC_Shipping_WCJ_Custom_Template();
    		$the_method->init( $i );
    		$methods[ $the_method->id ] = $the_method;
    	}
    	return $methods;
    }
    Thread Starter stewarthowell

    (@stewarthowell)

    Thanks for looking into this Pablo. My WooCommerce version is Version 3.8.0

    I updated to Booster Plus for WooCommerce to 4.6.1 and the error came back. Then I manually added your 3 new lines as described (under the line starting with $total=) and the error stops happening.

    -Stew

    PS Sorry I don’t know why the init_template_class() function isn’t being invoked earlier

    drew

    (@drewdrewchristophercom)

    Just wanted to give a “shout out” for this fix! I really appreciate this during the holiday season as it fixed the issue with one of the sites I manage!

    Hi Drew,
    The next version will have this fix. I just can’t confirm we will release it before Christmas

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Class ‘WC_Shipping_WCJ_Custom_Template’ not found’ is closed to new replies.