woocommerce - Wordpress Plugin to apply discount on total cart -


woocommerce pulgin - hi, looking wordpress plugin website http://fashions.aad-on.com , apply discount on total cart "if total cart amount exceeds particular amount". example: 10% discount on total cart if total cart equals or exceeds $ 500/-

you don't need plugin that. included in woocommerce core.

create coupon -> give code -> select discount type cart % discount -> set coupon amount 10 -> set minimum amount 500 -> save coupon. you're done!

to apply coupon code automatically, try following code:

add_action( 'woocommerce_before_cart', 'apply_matched_coupons' );  function apply_matched_coupons() {     global $woocommerce;      $coupon_code = '10percent'; // coupon code here      if ( $woocommerce->cart->has_discount( $coupon_code ) ) return;      if ( $woocommerce->cart->cart_contents_total >= 500 ) {         $woocommerce->cart->add_discount( $coupon_code );         $woocommerce->show_messages();     }  } 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -