• Resolved joesab

    (@joesab)


    Hello!
    We recently moved our coupon button on our cart page and it isn’t working. I tried just about everything. Any suggestions?
    This is in our cart PHP file:

    <!– for coupon –>
    <?php if ( wc_coupons_enabled() ) { ?>
    <div class=”coupon”>
    <label for=”coupon_code”><?php esc_html_e( ‘Coupon:’, ‘woocommerce’ ); ?></label> <input type=”text” name=”coupon_code” class=”input-text” id=”coupon_code” value=”” placeholder=”<?php esc_attr_e( ‘Coupon code’, ‘woocommerce’ ); ?>” /> <button type=”submit” class=”button button_new” name=”apply_coupon” value=”<?php esc_attr_e( ‘Apply coupon’, ‘woocommerce’ ); ?>”><?php esc_attr_e( ‘Apply coupon’, ‘woocommerce’ ); ?></button>
    <?php do_action( ‘woocommerce_cart_coupon’ ); ?>
    </div>
    <?php } ?>
    <!– coupons end –>

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support EtienneP a11n

    (@etiennep)

    Hi there!

    I had a look and when I try your code on my site, my cart is completely broken.

    However, when I change the and to ' and " , your codes works.

    Can you copy and paste the below code and give that a try and check that the ' and " does not get converted to something else;

    <?php if ( wc_coupons_enabled() ) { ?>
    <div class="coupon">
    <label for="coupon_code"><?php esc_html_e( 'Coupon:', 'woocommerce' ); ?></label> <input type="text" name="coupon_code" class="input-text" id="coupon_code" value="" placeholder="<?php esc_attr_e( 'Coupon code', 'woocommerce' ); ?>" /> <button type="submit" class="button button_new" name="apply_coupon" value=”<?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?>”><?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?></button>
    <?php do_action( 'woocommerce_cart_coupon' ); ?>
    </div>
    <?php } ?>
    Thread Starter joesab

    (@joesab)

    EtienneP,
    Thanks for your help. Nothing changed and it still does not work correctly. I am currently running on a DIVI-CHILD theme. When I disabled it the coupons worked. What can you suggest?
    Thanks!

    Plugin Support EtienneP a11n

    (@etiennep)

    Hi @joesab

    If it works when you disable the child theme, then it would point to something in your child theme causing this.

    I would suggest you reach out to the developer of your child theme for help with this or one of the services on our Customizations page

    Plugin Support EtienneP a11n

    (@etiennep)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Coupon Code Not Working’ is closed to new replies.