Custom Cart Message
-
Hi there I am trying to use the filter :-
add_filter( 'wc_add_to_cart_message', 'my_cart_func', 10, 2 );I want a pop up displaying the item they have currently added to cart similar to this site :-
http://www.chainreactioncycles.com/fox-racing-title-class-premium-tee/rp-prod118961
I can successfuly post a custom message after the cart add on the single product page no problem :-
function my_cart_func($message) { $message = 'New Cart Message'; return $message }I was hoping to use the global $post to get the current post id to basically show the post contents (product title, price etc) within a lightbox but this doesnt seem to work. I can use the global $woocommerce but this doesnt give me the information I need. Is there a reason why the $post global will not work. I am a newbie to PHP so any information to put me on the right tracks would be great.
Thanks in advance
Jamie
The topic ‘Custom Cart Message’ is closed to new replies.