conflict resolve
This commit is contained in:
commit
58ad8184eb
|
|
@ -154,8 +154,6 @@ class Cart {
|
|||
'base_total_weight' => $product->weight * $data['quantity'],
|
||||
];
|
||||
|
||||
// dd(['parent' => $parentData, 'child' => null]);
|
||||
|
||||
return ['parent' => $parentData, 'child' => null];
|
||||
}
|
||||
}
|
||||
|
|
@ -447,6 +445,7 @@ class Cart {
|
|||
*/
|
||||
public function removeItem($itemId)
|
||||
{
|
||||
dd($itemId);
|
||||
if(session()->has('cart')) {
|
||||
$cart = session()->get('cart');
|
||||
|
||||
|
|
@ -486,11 +485,13 @@ class Cart {
|
|||
}
|
||||
|
||||
if ($result) {
|
||||
session()->flash('sucess', 'Item Successfully Removed From Cart');
|
||||
session()->flash('sucess', trans('shop::app.checkout.cart.remove.success'));
|
||||
} else {
|
||||
session()->flash('error', 'Item Cannot Be Removed From Cart');
|
||||
session()->flash('error', trans('shop::app.checkout.cart.remove.error'));
|
||||
}
|
||||
}
|
||||
session()->flash('warning', trans('shop::app.checkout.cart.remove.cannot'));
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,16 +76,11 @@ class CartController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Method to populate
|
||||
* the cart page which
|
||||
* will be populated
|
||||
* before the checkout
|
||||
* process.
|
||||
* Method to populate the cart page which will be populated before the checkout process.
|
||||
*
|
||||
* @return Mixed
|
||||
*/
|
||||
public function index() {
|
||||
// dd(Cart::getCart());
|
||||
return view($this->_config['view'])->with('cart', Cart::getCart());
|
||||
}
|
||||
|
||||
|
|
@ -126,6 +121,14 @@ class CartController extends Controller
|
|||
public function updateBeforeCheckout() {
|
||||
$data = request()->except('_token');
|
||||
|
||||
foreach($data['qty'] as $id => $quantity) {
|
||||
// dd($id, $quantity);
|
||||
if($quantity <= 0) {
|
||||
session()->flash('warning', trans('shop::app.checkout.cart.quantity.illegal'));
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
Cart::update($data);
|
||||
|
||||
return redirect()->back();
|
||||
|
|
|
|||
|
|
@ -41,11 +41,6 @@ Route::group(['middleware' => ['web']], function () {
|
|||
'view' => 'shop::products.view'
|
||||
])->name('shop.products.index');
|
||||
|
||||
// //Routes for product cart
|
||||
// Route::get('/checkout/cart', 'Webkul\Shop\Http\Controllers\CartController@index')->defaults('_config', [
|
||||
// 'view' => 'shop::checkout.cart.index'
|
||||
// ])->name('shop.checkout.cart.index');
|
||||
|
||||
Route::post('product/cart/add/{id}', 'Webkul\Shop\Http\Controllers\CartController@add')->name('cart.add');
|
||||
|
||||
Route::get('product/cart/remove/{id}', 'Webkul\Shop\Http\Controllers\CartController@remove')->name('cart.remove');
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
|
@ -974,7 +974,7 @@ section.product-detail {
|
|||
width: 100%;
|
||||
|
||||
div.product-image-group {
|
||||
margin-right: 36px;
|
||||
margin-right: 30px;
|
||||
|
||||
div {
|
||||
display: flex;
|
||||
|
|
@ -985,7 +985,7 @@ section.product-detail {
|
|||
flex-direction: column;
|
||||
margin-right: 4px;
|
||||
height: 480px;
|
||||
width: 120px;
|
||||
min-width: 120px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
justify-content: flex-start;
|
||||
|
|
@ -993,8 +993,7 @@ section.product-detail {
|
|||
.thumb-frame {
|
||||
border: 2px solid transparent;
|
||||
background: #F2F2F2;
|
||||
max-width: 120px;
|
||||
width: auto;
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
|
||||
&.active {
|
||||
|
|
@ -1002,8 +1001,8 @@ section.product-detail {
|
|||
}
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1077,8 +1076,9 @@ section.product-detail {
|
|||
}
|
||||
}
|
||||
|
||||
.cart-fav-seg {
|
||||
display: block;
|
||||
.add-to-buttons {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-top: 10px;
|
||||
|
||||
.addtocart {
|
||||
|
|
|
|||
|
|
@ -83,16 +83,25 @@
|
|||
|
||||
.cart-fav-seg {
|
||||
display: inline-flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
|
||||
.addtocart {
|
||||
margin-right: 10px;
|
||||
text-transform: uppercase;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.product-card.wishlist-icon {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//wishlist-icon-hover
|
||||
.product-card.wishlist-icon:hover {
|
||||
background-image: url('../images/wishadd.svg');
|
||||
}
|
||||
|
||||
//product page price styles
|
||||
.product-price {
|
||||
margin-bottom: 14px;
|
||||
|
|
|
|||
|
|
@ -71,4 +71,16 @@
|
|||
background-image: url('../images/payment.svg');
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.cart-icon {
|
||||
background-image: url("../images/icon-cart.svg");
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.wishlist-icon {
|
||||
background-image: url('../images/wishlist.svg');
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
|
@ -70,7 +70,16 @@ return [
|
|||
'proceed-to-checkout' => 'Proceed To Checkout',
|
||||
'quantity' => 'Quantity',
|
||||
'remove' => 'Remove',
|
||||
'move-to-wishlist' => 'Move to Wishlist'
|
||||
'move-to-wishlist' => 'Move to Wishlist',
|
||||
'quantity' => [
|
||||
'quantity' => 'Quantity',
|
||||
'illegal' => 'Quantity cannot be lesser than one.'
|
||||
],
|
||||
'remove' => [
|
||||
'cannot' => 'No items to remove from the cart',
|
||||
'success' => 'Item successfully removed from the cart',
|
||||
'error' => 'Cannot remove item from cart'
|
||||
]
|
||||
],
|
||||
|
||||
'onepage' => [
|
||||
|
|
|
|||
|
|
@ -48,21 +48,28 @@
|
|||
@if ($product->type == 'configurable')
|
||||
|
||||
<div class="summary">
|
||||
{{-- @foreach (cart::getItemAttributeOptionDetails($item) as $key => $option)
|
||||
|
||||
{{ Cart::getItemAttributeOptionDetails($item)['html'] }}
|
||||
|
||||
@endforeach --}}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="misc" :class="[errors.has('quantity') ? 'has-error' : '']">
|
||||
<div class="qty-text">{{ __('shop::app.checkout.cart.quantity') }}</div>
|
||||
<div class="misc">
|
||||
<div class="qty-text" :class="[errors.has('qty') ? 'has-error' : '']">{{ __('shop::app.checkout.cart.quantity.quantity') }}</div>
|
||||
|
||||
{{-- <div class="box">{{ $item->quantity }}</div> --}}
|
||||
<input class="box" type="text" v-validate="'required|numeric|min_value:1'" name="qty[{{$item->id}}]" value="{{ $item->quantity }}">
|
||||
<span class="control-error" v-if="errors.has('qty[{{$item->qty}}]')">@{{ errors.first('quantity') }}</span>
|
||||
|
||||
<span class="control-error" v-if="errors.has('qty[{{$item->id}}]')">@{{ errors.first('qty') }}</span>
|
||||
|
||||
{{-- @if($product->type == 'configurable')
|
||||
<span class="remove"><a href="{{ route('shop.checkout.cart.remove', $item->child->id) }}">{{ __('shop::app.checkout.cart.remove') }}</a></span>
|
||||
<span class="remove"><a href="{{ route('shop.checkout.cart.remove', $item->child->id) }}">{{ __('shop::app.checkout.cart.remove') }}</a></span>
|
||||
@else --}}
|
||||
<span class="remove"><a href="{{ route('shop.checkout.cart.remove', $item->id) }}">{{ __('shop::app.checkout.cart.remove') }}</a></span>
|
||||
|
||||
<span class="remove"><a href="{{ route('shop.checkout.cart.remove', $item->id) }}">{{ __('shop::app.checkout.cart.remove') }}</a></span>
|
||||
|
||||
{{-- @endif --}}
|
||||
<span class="towishlist">{{ __('shop::app.checkout.cart.move-to-wishlist') }}</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
@include ('shop::products.add-to-cart', ['product' => $product])
|
||||
|
||||
<span class="wishlist"><img src="{{ bagisto_asset('images/wishlist.svg') }}" /></span>
|
||||
<span class="product-card wishlist-icon"></span>
|
||||
|
||||
</div>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<div class="cart-fav-seg">
|
||||
<div class="add-to-buttons">
|
||||
|
||||
@include ('shop::products.add-to-cart', ['product' => $product])
|
||||
|
||||
|
|
|
|||
|
|
@ -78,35 +78,3 @@
|
|||
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script>
|
||||
|
||||
window.onscroll = function() {scrollFunction()};
|
||||
|
||||
|
||||
|
||||
function scrollFunction() {
|
||||
|
||||
var scrollTop = window.pageYOffset
|
||||
|
||||
var elems = document.getElementById("header-bottom");
|
||||
|
||||
if(scrollTop > 200){
|
||||
|
||||
elems.style.display = "none";
|
||||
|
||||
}else {
|
||||
elems.style.display = "block";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ mix.setPublicPath(publicPath).mergeManifest();
|
|||
mix.disableNotifications();
|
||||
|
||||
mix.js([__dirname + "/src/Resources/assets/js/app.js"], "js/shop.js")
|
||||
// .copy(__dirname + "/src/Resources/assets/images", publicPath + "/images")
|
||||
.copyDirectory(__dirname + "/src/Resources/assets/images", publicPath + "/images")
|
||||
.sass(__dirname + "/src/Resources/assets/sass/app.scss", "css/shop.css")
|
||||
.options({
|
||||
processCssUrls: false
|
||||
|
|
|
|||
|
|
@ -132,12 +132,6 @@
|
|||
height: 24px;
|
||||
}
|
||||
|
||||
.cart-icon {
|
||||
background-image: url("../images/icon-cart.svg");
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.expand-icon {
|
||||
background-image: url("../images/Expand-Light.svg");
|
||||
width: 18px;
|
||||
|
|
|
|||
|
|
@ -73,6 +73,18 @@
|
|||
height: 32px;
|
||||
}
|
||||
|
||||
.cart-icon {
|
||||
background-image: url("../images/icon-cart.svg");
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.wishlist-icon {
|
||||
background-image: url("../images/wishlist.svg");
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.product-grid-4 {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
||||
|
|
@ -155,7 +167,9 @@
|
|||
display: -webkit-inline-box;
|
||||
display: -ms-inline-flexbox;
|
||||
display: inline-flex;
|
||||
width: 100%;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.product-card .cart-fav-seg .addtocart {
|
||||
|
|
@ -164,6 +178,14 @@
|
|||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.product-card .cart-fav-seg .product-card.wishlist-icon {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.product-card.wishlist-icon:hover {
|
||||
background-image: url("../images/wishadd.svg");
|
||||
}
|
||||
|
||||
.product-price {
|
||||
margin-bottom: 14px;
|
||||
width: 100%;
|
||||
|
|
@ -1509,7 +1531,7 @@ section.product-detail div.layouter form {
|
|||
}
|
||||
|
||||
section.product-detail div.layouter form div.product-image-group {
|
||||
margin-right: 36px;
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
section.product-detail div.layouter form div.product-image-group div {
|
||||
|
|
@ -1532,7 +1554,7 @@ section.product-detail div.layouter form div.product-image-group div .thumb-list
|
|||
flex-direction: column;
|
||||
margin-right: 4px;
|
||||
height: 480px;
|
||||
width: 120px;
|
||||
min-width: 120px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
-webkit-box-pack: start;
|
||||
|
|
@ -1543,8 +1565,7 @@ section.product-detail div.layouter form div.product-image-group div .thumb-list
|
|||
section.product-detail div.layouter form div.product-image-group div .thumb-list .thumb-frame {
|
||||
border: 2px solid transparent;
|
||||
background: #F2F2F2;
|
||||
max-width: 120px;
|
||||
width: auto;
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
}
|
||||
|
||||
|
|
@ -1553,8 +1574,8 @@ section.product-detail div.layouter form div.product-image-group div .thumb-list
|
|||
}
|
||||
|
||||
section.product-detail div.layouter form div.product-image-group div .thumb-list .thumb-frame img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
section.product-detail div.layouter form div.product-image-group div .thumb-list .gallery-control {
|
||||
|
|
@ -1625,18 +1646,24 @@ section.product-detail div.layouter form div.product-image-group div .product-he
|
|||
right: 45px;
|
||||
}
|
||||
|
||||
section.product-detail div.layouter form div.product-image-group .cart-fav-seg {
|
||||
display: block;
|
||||
section.product-detail div.layouter form div.product-image-group .add-to-buttons {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-orient: horizontal;
|
||||
-webkit-box-direction: normal;
|
||||
-ms-flex-direction: row;
|
||||
flex-direction: row;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
section.product-detail div.layouter form div.product-image-group .cart-fav-seg .addtocart {
|
||||
section.product-detail div.layouter form div.product-image-group .add-to-buttons .addtocart {
|
||||
border-radius: 0px;
|
||||
width: 49%;
|
||||
background: black;
|
||||
}
|
||||
|
||||
section.product-detail div.layouter form div.product-image-group .cart-fav-seg .buynow {
|
||||
section.product-detail div.layouter form div.product-image-group .add-to-buttons .buynow {
|
||||
border-radius: 0px;
|
||||
width: 49%;
|
||||
float: right;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>icon-cart</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="icon-cart" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Group" transform="translate(2.000000, 2.000000)">
|
||||
<path d="M3.5,1.5 L8.5,13.5" id="Line-2" stroke="#242424" stroke-width="3" stroke-linecap="round"></path>
|
||||
<path d="M15.5,5.5 L19.5,13.5" id="Line-2" stroke="#242424" stroke-width="3" stroke-linecap="round" transform="translate(17.500000, 9.500000) scale(-1, 1) translate(-17.500000, -9.500000) "></path>
|
||||
<path d="M5.5,5.5 L19.5,5.5" id="Line-2" stroke="#242424" stroke-width="3" stroke-linecap="round"></path>
|
||||
<path d="M0.5,1.5 L3.5,1.5" id="Line-2" stroke="#242424" stroke-width="3" stroke-linecap="round"></path>
|
||||
<path d="M8.5,13.5 L15.5,13.5" id="Line-2" stroke="#242424" stroke-width="3" stroke-linecap="round"></path>
|
||||
<circle id="Oval" fill="#242424" cx="9" cy="18" r="2"></circle>
|
||||
<circle id="Oval" fill="#242424" cx="15" cy="18" r="2"></circle>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
Loading…
Reference in New Issue