skip to Main Content

I want to add customize text on header of cart popup but I can’t find where should I put my custom code.
I see a lot of plugin that have custom content in cart popup but I can’t customize with these plugin so please help to add my custom code to cart popup.
enter image description here

I have try cart.php but it make change to cart page not cart popup

2

Answers


  1. You need to use minicart.php to modify the cart popup content. if you are using default woo-commerce then below is the file path :

    woocommerce/templates/cart/mini-cart.php
    

    here you can add customize text on header of cart popup.

    Login or Signup to reply.
  2. Add the below code snippet in your active theme’s functions.php file –

    function add_custom_header_in_cart() {
        echo 'YOUR_HEADER_GOES_HERE';
    }
    add_action( 'woocommerce_before_mini_cart', 'add_custom_header_in_cart' );
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search