[Support request] Empty cart page template

Home Forums Support Empty cart page template

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1247818
    Krzysztof

    Hello, is there some sort of template I can use on empty cart? Default one when it is emptied is just as it is, I wanted to add something without too much coding.

    #1247860
    David
    Staff
    Customer Support

    Hi there,

    you could do this:

    1. Add this PHP Snippet to remove the Cart is Empty message:

    remove_action( 'woocommerce_cart_is_empty', 'wc_empty_cart_message', 10 );

    2. Then you can add your own content by using a Hook Element:

    https://docs.generatepress.com/article/hooks-element-overview/

    2.1 Add you content to the text area.
    2.2 From the Hook List select Custom Hook and add this to field provided woocommerce_cart_is_empty
    2.3 If you added PHP or Shortcodes to your hook content then check those boxes.
    2.4 Set your Display Rules to Page > Cart

    #1248141
    Krzysztof

    Hey David, thanks for reply. It almost works.
    I put my code into Elements area, and here is a fun part. When I remove last product from the cart – when I am at cart page, it just leaves it blank, but if I do reload (F5), it loads what I wanted to put there just fine…
    Okay, I figured that this snippet is not required, but, if I don’t reload, it actually ignores CSS from Elementor (I made a template in it, and put shortcode to it in this element)

    #1248192
    David
    Staff
    Customer Support

    If you’re using Elementor to create the Cart page you will need to ask their support for help. Sorry but its out of our scope and i don’t know what the solution would be.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.