Example #1
0
function learn_press_get_cart_course_url()
{
    $products = learn_press_get_cart('products');
    $return = '';
    if ($products) {
        foreach ($products as $prop) {
            $return = get_permalink($prop['id']);
            break;
        }
    }
    return apply_filters('learn_press_cart_course_url', $return);
}
/**
 * Get the author ID of course in the cart
 *
 * Currently, it only get the first item in cart
 *
 * @return int
 */
function learn_press_cart_order_instructor()
{
    $cart = learn_press_get_cart();
    if ($products = $cart->get_products()) {
        foreach ($products as $key => $product) {
            $post = get_post($product['id']);
            if ($post && !empty($post->ID)) {
                return $post->post_author;
            }
        }
    }
    return 0;
}
Example #3
0
function learn_press_get_cart_total()
{
    return learn_press_get_cart('total');
}