Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #1114835


    I want to add the coupon field in the cart widget. On the page in private content you can add a product to your cart by choosing a quantity and select ‘Bestel nu’. In the cart widget on the right you see the added products. Beneath the product row in the cart I want to show the add coupon field. Is this possible? Some hook for it or anything?


    I need to modify the ‘mini-cart.php’ file. I did it like /enfold-child/woocommerce/cart/mini-cart.php.
    If I make any changes in it there aren’t any changes on the front-end. How is this possible?



    Thank you for using Enfold.

    Have you tried using the “woocommerce_mini_cart_contents” or the “woocommerce_widget_shopping_cart_before_buttons” hook to insert the coupon field after the product column?

    An example can be found here:

    Best regards,



    I added the coupon field to my mini-cart.php in my child theme. Found out that I needed to erase my browse data to see the changes.
    You can find the page in private content of my first question. You can add a product to your cart and use the coupon I mentioned in the private content to see how the flow is right now.

    I added this to my mini-cart.php code:

    <form class="checkout_coupon woocommerce-form-coupon" method="post">
            <p style="color:white;"><?php esc_html_e( 'Kortingscode', 'woocommerce' ); ?></p>
            <p class="form-row form-row-first">
                <input type="text" name="coupon_code" class="input-text" placeholder="<?php esc_attr_e( 'Coupon code', 'woocommerce' ); ?>" id="coupon_code" value="" />
            <p class="form-row form-row-last">
                <button type="submit" class="button" name="apply_coupon" value="<?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?>"><?php esc_html_e( 'Apply coupon', 'woocommerce' ); ?></button>
            <div class="clear"></div>

    Normally if you add the coupon in the cart page and remove it. It happens with AJAX and does not reload the page. Can I achieve this here too because now it reloads the page :(



    Thank you for the update.

    The ajax feature is probably exclusive to the actual cart page or dependent on containers that don’t exist in the mini cart container. Unfortunately, we can’t help you trace that script. You may need to hire a freelance developer or get in touch with our partner Codeable if you really need the functionality.

    Best regards,

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.