Skip to content

Instantly share code, notes, and snippets.

@actual-saurabh
Created October 2, 2018 15:55
Show Gist options
  • Save actual-saurabh/96b782f1fb35c27e40b019d16c21237c to your computer and use it in GitHub Desktop.
Save actual-saurabh/96b782f1fb35c27e40b019d16c21237c to your computer and use it in GitHub Desktop.
Display custom messages and links for empty cart on checkout pages
<?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