• Resolved vaibhav26

    (@vaibhav26)


    Hi everyone,

    I have been stuck in this place right now. I have woodmart theme, in which want to override Ui class a particular function using child theme. But whenever I extend that class Fatal error: Uncaught Error: Class 'Ui' not found error occurs

    I hooked my function using after_setup_theme hook in child theme.

    here is my code snippet.

    add_action( 'after_setup_theme', function() {
    
    	require_once get_theme_file_path( 'inc/integrations/woocommerce/modules/compare/class-ui.php' );
    	print_r(get_theme_file_path( 'inc/integrations/woocommerce/modules/compare/class-ui.php' ));
    	class a extends Ui{
    		
    	}});

    Please correct me if i commit any mistakes.

    • This topic was modified 1 year, 6 months ago by vaibhav26.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hi @vaibhav26

    This particular forum is for questions which are directly related to the features and functionality of the free WooCommerce plugin. It does not, however, offer support for questions related to any extensions or themes which can work with WooCommerce or the writing of custom code snippets.

    For questions related to development and custom coding, your best bet is to ask on either the WooCommerce Advanced Facebook group or the WooCommerce Developer Slack Channel.

    Thread Starter vaibhav26

    (@vaibhav26)

    My bad, thank you.

    Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hey @vaibhav26

    I’m happy we could offer some guidance for you on the best place to ask development-related questions related to WooCommerce.

    If you have any questions in the future related to the default functionality and features please open a new forum topic and we’ll be happy to offer any guidance we can.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to override parent theme class function in child theme’ is closed to new replies.