• I found this snippet for adding text to the shop page and tried to change it to add text to the cart page but my php skills are poor and it didn’t work. Can anyone else help me with the proper function to accomplish what I need?

    function get_shop_page_text(){
    	$shop_page_object = get_post(1234); // 1234 is ID of the 'Editable text' page or post that you are going to create
    	echo '<p>'.$shop_page_object->post_content.'</p>';
    }
    
    add_action( 'woocommerce_before_shop_loop', 'get_shop_page_text', 10 );
Viewing 1 replies (of 1 total)
  • Thread Starter nootkan

    (@nootkan)

    Guess I jumped the gun posting for help. I figured out how to do what I want with this:

    function get_cart_page_text(){
    	$cart_page_object = get_post(2425); // This is the ID of the 'Editable text' page or post that you are going to create
    	echo '<p>'.$cart_page_object->post_content.'</p>';
    }
    
    add_action( 'woocommerce_before_cart_table', 'get_cart_page_text', 10 );
Viewing 1 replies (of 1 total)
  • The topic ‘Add Text to Top of Cart Page’ is closed to new replies.