/**
 * Display a message immediately with out push into queue
 *
 * @param        $message
 * @param string $type
 */
function learn_press_display_message($message, $type = 'success')
{
    // get all notices added into queue
    $notices = LP_Session::get('notices');
    LP_Session::set('notices', null);
    // add new notice and display
    learn_press_add_notice($message, $type);
    echo learn_press_get_notices(true);
    // store back notices
    LP_Session::set('notices', $notices);
}
Exemplo n.º 2
0
 /**
  * Clean all items from cart
  *
  * @return $this
  */
 function empty_cart()
 {
     do_action('learn_press_before_empty_cart');
     LP_Session::set('cart', $this->get_default_cart_content());
     $this->get_cart_from_session();
     do_action('learn_press_emptied_cart');
     return $this;
 }
/**
 * Clear all notices in queue
 *
 */
function learn_press_clear_notices()
{
    LP_Session::set('notices', null);
    do_action('learn_press_clear_notices');
}