Monday 31 October 2016

How to hide Coupon form in WooCommerce, WordPress?

In case you're not utilizing coupons by any stretch of the imagination, you can conceal the structure on the truck and checkout page by unchecking "coupons checkbox" from WooCommerce > Settings > General, yet most times you'll need to leave coupons empowered on the off chance that you have to give a client a rebate for reasons unknown.

Or Can Disable it by adding following code.


Add following code in "functions.php" file.

<?php
// hide coupon form everywhere in woocommerce site
function hide_coupon_field( $enabled ) {
if ( is_cart() || is_checkout() ) {
$enabled = false;
}

return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field' );
?>



For more Interesting, Useful Article & codes visit IT New Code.

Ankit Shah PHP Expert

IT New Code suggest a solution for your problem related to coding, Specially .PHP, Wordpress, WooCommerce, Magento, HTML and CSS. Visit Our website for Information.

0 comments:

Post a Comment

 

Copyright @ 2016 IT New Code | Developing Code | Designing Code.

Designed by: Ankit Shah