1
votes

I want to display message in cart page after items list. But i want to add it through a hook/function ,not with editing the cart page. Cant find exactly how to do it. but its probably looks something like:

add_action( 'print_cart', 'add_some_message' );
function add_some_message() {
     add_meta_box( 'message_title', 'message title', 'after' );
}

Its just a example, not familiar with woo functions.

Thanks.

1
Thanks, @gauravkumar found there what i was looking for. - BenB

1 Answers

2
votes

Thanks for gaurav kumar I found the hook here http://docs.woothemes.com/document/hooks/. What i was looking for was:

my_function(){
     // my code to add after cart
}
add_action('woocommerce_after_cart_contents', 'my_function');

In addition to woocommerce_after_cart_contents, their are: woocommerce_after_cart_table, woocommerce_after_cart_totals, woocommerce_after_cart. Each one acts in different part of the cart. I'm writing the answer in case someone will have the same question.