예제 #1
0
파일: helper.php 프로젝트: dvlpp/merx
/**
 * @return Cart|null
 */
function merx_current_cart()
{
    if (!config("merx.uses_session", true)) {
        // If Merx can't use the session, there is no way
        // he could find the current Cart from nowhere
        return null;
    }
    $cartId = session("merx_cart_id");
    if (!$cartId) {
        return null;
    }
    return Cart::find($cartId);
}
예제 #2
0
파일: Merx.php 프로젝트: dvlpp/merx
 /**
  * @param integer|null $cartId
  * @return Cart|null
  */
 private function existingCart($cartId = null)
 {
     return $cartId ? Cart::find($cartId) : merx_current_cart();
 }