Adding apply coupon box to single/detail page woocommerce

No comments
Hello Guys, I am back after five month. So today, i am going to tell you guys how to add coupon box to product detail page. This is so simple. What you need to do is just paste below code into your  woocommerce single page anywhere under form tag. That's it.


<?php if ( WC()->cart->coupons_enabled() ) {?>
<div class="promo_code">
<div class="txt1">COUPON CODE</div>
<input type="text" name="coupon_code" class=" intx" id="coupon_code" value="" placeholder="<?php esc_attr_e( 'Coupon code', 'woocommerce' ); ?>" />
<input type="submit" class="button sb_btm" name="apply_coupon" value="<?php //esc_attr_e( 'Apply Coupon', 'woocommerce' ); ?>Apply & Proceed to Checkout" />
<?php do_action( 'woocommerce_cart_coupon' ); ?>
<?php }?>

Please do let me know in the comment box below it works for you. You can also tell me if it does not work. I would love to assist you. Thanks.

No comments :

Post a Comment