Before merge
This commit is contained in:
parent
e86d78dc3f
commit
c9da9491a6
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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' : '']">
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue