Before merge

This commit is contained in:
prashant-webkul 2018-10-05 11:49:30 +05:30
parent e86d78dc3f
commit c9da9491a6
3 changed files with 14 additions and 6 deletions

View File

@ -238,8 +238,13 @@ class Cart {
*/
public function getCart()
{
if(!$cart = session()->get('cart'))
return false;
if(session()->has('cart')) {
$cart = session()->get('cart');
} else if(auth()->guard('customer')->check()) {
return $cart = $this->cart->findOneByField('customer_id', auth()->guard('customer')->user()->id);
}
return $this->cart->find($cart->id);
}

View File

@ -5,9 +5,11 @@
<div class="form-header">
<h1>{{ __('shop::app.checkout.onepage.billing-address') }}</h1>
<a href="{{ route('customer.session.index') }}" class="btn btn-lg btn-primary">
{{ __('shop::app.checkout.onepage.sign-in') }}
</a>
@guest('customer')
<a href="{{ route('customer.session.index') }}" class="btn btn-lg btn-primary">
{{ __('shop::app.checkout.onepage.sign-in') }}
</a>
@endguest
</div>
<div class="control-group" :class="[errors.has('address-form.billing[first_name]') ? 'has-error' : '']">

View File

@ -85,12 +85,13 @@
<ul class="cart-dropdown-container">
<?php
$cart = cart()->getCart();
// dd($cart);
?>
@inject ('productImageHelper', 'Webkul\Product\Product\ProductImage')
<li class="cart-dropdown">
<span class="icon cart-icon"></span>
@if(isset($cart) && session()->has('cart'))
@if(isset($cart))
@php
$items = $cart->items;
@endphp