Home Forums WoodMart support forum child theme is not working

child theme is not working

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #267492

    sohaib
    Participant

    Hi, I am trying to put some code in my child theme but none of the code is working. however, the same code when I am putting in the main theme, it’s working perfectly. I want to know why its happening with a proper solution as this is important for me.

    #267545

    Hello,

    Could you please explain which code you are trying to add with the help of some relevant screenshot and the admin panel login details of the website to check it myself and help you out accordingly.

    Regards.
    Xtemos Studios.

    #267753

    sohaib
    Participant

    I am trying to put this minimum order condition code in the child theme of functions.php file. To let you remind, this code is working perfectly on the main theme but doesn’t work in the child theme. Here is the code –

    /**
    * Set a minimum order amount for checkout
    */
    add_action( ‘woocommerce_checkout_process’, ‘wc_minimum_order_amount’ );
    add_action( ‘woocommerce_before_cart’ , ‘wc_minimum_order_amount’ );

    function wc_minimum_order_amount() {
    // Set this variable to specify a minimum order value
    $minimum = 50;

    if ( WC()->cart->total < $minimum ) { if( is_cart() ) { wc_print_notice( sprintf( ‘Your current order total is %s — you must have an order with a minimum of %s to place your order ‘ , wc_price( WC()->cart->total ),
    wc_price( $minimum )
    ), ‘error’
    );

    } else {

    wc_add_notice(
    sprintf( ‘Your current order total is %s — you must have an order with a minimum of %s to place your order’ ,
    wc_price( WC()->cart->total ),
    wc_price( $minimum )
    ), ‘error’
    );

    }
    }
    }

    #267764

    Hello,

    I have logged into your website and checked.

    Please remove all the other code that you added above in the functions.php of the child theme and try adding only the code that is not working in the child theme.

    Then clear cache and check back.

    Best Regards.

    #268056

    sohaib
    Participant

    I did it as you said, but still not working.

    #268285

    Hello,

    The issue seems to be with the functions.php of child theme or the code you are trying to add is not to be set to work for the child theme functions.php file.

    Please ask your developer to check both the cases and try fixing it by either recreating the functions.php file of child theme or modifying the code to work for the child theme.

    Regards.
    Xtemos Studios.

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