Created
October 2, 2018 15:55
-
-
Save actual-saurabh/96b782f1fb35c27e40b019d16c21237c to your computer and use it in GitHub Desktop.
Display custom messages and links for empty cart on checkout pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php// Do not copy this line | |
// Copy from under this line and paste into your child theme's functions.php | |
add_filter( 'lifterlms_pre_checkout_error', 'llms_custom_empty_cart_message' ); | |
function llms_custom_empty_cart_message(){ | |
if ( isset( $_GET['plan'] ) && is_numeric( $_GET['plan'] ) ) { | |
return false; | |
} | |
if ( isset( $wp->query_vars['confirm-payment'] ) ) { | |
return false; | |
} | |
$custom_message = 'Your cart is currently empty. Click <a href="https://custom/link/here">here</a> to get started.'; | |
return $custom_message; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment