Home › Forums › WoodMart support forum › child theme is not working
child theme is not working
- This topic has 5 replies, 2 voices, and was last updated 4 years, 2 months ago by
Aizaz Imtiaz Awan.
-
AuthorPosts
-
February 18, 2021 at 2:54 am #267492
sohaibParticipantHi, 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.
February 18, 2021 at 9:01 am #267545
Aizaz Imtiaz AwanKeymasterHello,
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.February 19, 2021 at 4:53 am #267753
sohaibParticipantI 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’
);}
}
}February 19, 2021 at 6:54 am #267764
Aizaz Imtiaz AwanKeymasterHello,
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.
February 20, 2021 at 2:59 pm #268056
sohaibParticipantI did it as you said, but still not working.
February 22, 2021 at 7:13 am #268285
Aizaz Imtiaz AwanKeymasterHello,
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. -
AuthorPosts
- You must be logged in to create new topics. Login / Register