merge with master
This commit is contained in:
commit
2517dfbf03
|
|
@ -90,6 +90,12 @@ class OrderDataGrid
|
|||
'wrapper' => function ($value) {
|
||||
return core()->currency($value);
|
||||
}
|
||||
], [
|
||||
'name' => 'or.created_at',
|
||||
'alias' => 'created_at',
|
||||
'type' => 'string',
|
||||
'label' => 'Order Date',
|
||||
'sortable' => false,
|
||||
], [
|
||||
'name' => 'or.status',
|
||||
'alias' => 'orstatus',
|
||||
|
|
|
|||
|
|
@ -184,10 +184,10 @@ class DashboardController extends Controller
|
|||
foreach (core()->getTimeInterval($this->startDate, $this->endDate) as $interval) {
|
||||
$statistics['sale_graph']['label'][] = $interval['start']->format('d M');
|
||||
|
||||
$total = number_format($this->order->scopeQuery(function($query) use($interval) {
|
||||
$total = $this->order->scopeQuery(function($query) use($interval) {
|
||||
return $query->where('orders.created_at', '>=', $interval['start'])
|
||||
->where('orders.created_at', '<=', $interval['end']);
|
||||
})->sum('base_grand_total'), 2);
|
||||
})->sum('base_grand_total');
|
||||
|
||||
$statistics['sale_graph']['total'][] = $total;
|
||||
$statistics['sale_graph']['formated_total'][] = core()->formatBasePrice($total);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ use Webkul\Customer\Repositories\CustomerRepository;
|
|||
use Webkul\Product\Repositories\ProductRepository;
|
||||
use Webkul\Tax\Repositories\TaxCategoryRepository;
|
||||
use Webkul\Checkout\Models\CartPayment;
|
||||
use Webkul\Customer\Repositories\WishlistRepository;
|
||||
|
||||
/**
|
||||
* Facade for all the methods to be implemented in Cart.
|
||||
|
|
@ -62,6 +63,13 @@ class Cart {
|
|||
*/
|
||||
protected $taxCategory;
|
||||
|
||||
/**
|
||||
* WishlistRepository model
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $wishlist;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
|
|
@ -79,7 +87,8 @@ class Cart {
|
|||
CartAddressRepository $cartAddress,
|
||||
CustomerRepository $customer,
|
||||
ProductRepository $product,
|
||||
TaxCategoryRepository $taxCategory
|
||||
TaxCategoryRepository $taxCategory,
|
||||
WishlistRepository $wishlist
|
||||
)
|
||||
{
|
||||
$this->customer = $customer;
|
||||
|
|
@ -93,6 +102,8 @@ class Cart {
|
|||
$this->product = $product;
|
||||
|
||||
$this->taxCategory = $taxCategory;
|
||||
|
||||
$this->wishlist = $wishlist;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -298,6 +309,7 @@ class Cart {
|
|||
* @return Booleans
|
||||
*/
|
||||
public function createNewCart($id, $data, $prepared = false, $preparedData = []) {
|
||||
// dd($id, $data, $prepared,$preparedData);
|
||||
if($prepared == false) {
|
||||
if(isset($data['selected_configurable_option'])) {
|
||||
$canAdd = $this->canAdd($data['selected_configurable_option'], $data['quantity']);
|
||||
|
|
@ -357,8 +369,6 @@ class Cart {
|
|||
//parent item entry
|
||||
if($prepared == false) {
|
||||
$itemData['parent']['additional'] = json_encode($data);
|
||||
} else {
|
||||
$itemData['parent']['additional'] = json_encode($preparedData);
|
||||
}
|
||||
|
||||
if($parent = $this->cartItem->create($itemData['parent'])) {
|
||||
|
|
@ -700,6 +710,7 @@ class Cart {
|
|||
|
||||
$labels = [];
|
||||
|
||||
$attribute = $product->parent->super_attributes;
|
||||
foreach($product->parent->super_attributes as $attribute) {
|
||||
$option = $attribute->options()->where('id', $product->{$attribute->code})->first();
|
||||
|
||||
|
|
@ -1128,11 +1139,12 @@ class Cart {
|
|||
$result = $this->moveConfigurableFromWishlistToCart($product->parent_id, $product->id);
|
||||
|
||||
if(is_array($result)) {
|
||||
$data['_token'] = 'null';
|
||||
$data['quantity'] = 1;
|
||||
$data['product'] = $product->parent_id;
|
||||
$data['selected_configurable_option'] = $product->id;
|
||||
|
||||
$data['selected_configurable_option'] = $product->parent_id;
|
||||
|
||||
$moved = $this->add($data['selected_configurable_option'], $data, true, $result);
|
||||
$moved = $this->add($product->parent_id, $data, true, $result);
|
||||
|
||||
if($moved) {
|
||||
return true;
|
||||
|
|
@ -1149,7 +1161,7 @@ class Cart {
|
|||
* @return mixed
|
||||
*/
|
||||
public function moveConfigurableFromWishlistToCart($configurableproductId, $productId) {
|
||||
// dd('moving configurable');
|
||||
// dd($configurableproductId, $productId);
|
||||
$product = $this->product->find($configurableproductId);
|
||||
|
||||
$canAdd = $this->product->find($productId)->haveSufficientQuantity(1);
|
||||
|
|
@ -1165,7 +1177,7 @@ class Cart {
|
|||
$child = $this->product->findOneByField('id', $productId);
|
||||
|
||||
$childData = [
|
||||
'product_id' => $configurableproductId,
|
||||
'product_id' => $productId,
|
||||
'sku' => $child->sku,
|
||||
'name' => $child->name,
|
||||
'type' => 'simple'
|
||||
|
|
@ -1181,12 +1193,12 @@ class Cart {
|
|||
$additional = [
|
||||
'request' => $childData,
|
||||
'variant_id' => $productId,
|
||||
'attributes' => $productAddtionalData
|
||||
'attributes' => $productAddtionalData['attributes']
|
||||
];
|
||||
|
||||
$parentData = [
|
||||
'sku' => $product->sku,
|
||||
'product_id' => $productId,
|
||||
'product_id' => $configurableproductId,
|
||||
'quantity' => 1,
|
||||
'type' => $product->type,
|
||||
'name' => $product->name,
|
||||
|
|
@ -1199,10 +1211,27 @@ class Cart {
|
|||
'base_total_weight' => $weight,
|
||||
'additional' => $additional
|
||||
];
|
||||
|
||||
// dd(['parent' => $parentData, 'child' => $childData]);
|
||||
return ['parent' => $parentData, 'child' => $childData];
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to move a already added product to wishlist
|
||||
* will run only on customer authentication.
|
||||
*
|
||||
* @param instance cartItem $id
|
||||
*/
|
||||
public function moveToWishlist($itemId) {
|
||||
$item = $this->cartItem->findOneByField('id', $itemId);
|
||||
dd($item->cart);
|
||||
if(!$item)
|
||||
return false;
|
||||
|
||||
// $wishlist[
|
||||
// 'channel_id' =>
|
||||
// ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the buy now process for simple as well as configurable products
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Search extends Model
|
||||
{
|
||||
}
|
||||
|
|
@ -57,7 +57,7 @@ class Product extends Model
|
|||
*/
|
||||
public function parent()
|
||||
{
|
||||
return $this->belongsTo(self::class);
|
||||
return $this->belongsTo(self::class, 'parent_id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -133,10 +133,10 @@ class Product extends Model
|
|||
{
|
||||
if(!$this->status)
|
||||
return false;
|
||||
|
||||
|
||||
if($this->haveSufficientQuantity(1))
|
||||
return true;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -247,5 +247,5 @@ class Product extends Model
|
|||
{
|
||||
return new \Webkul\Product\Database\Eloquent\Builder($query);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Repositories;
|
||||
namespace Webkul\Product\Repositories;
|
||||
|
||||
use Illuminate\Container\Container as App;
|
||||
|
||||
|
|
@ -46,6 +46,6 @@ class SearchRepository extends Repository
|
|||
|
||||
$products = $this->product->searchProductByAttribute($term);
|
||||
|
||||
dd($products);
|
||||
return $products;
|
||||
}
|
||||
}
|
||||
|
|
@ -150,4 +150,16 @@ class CartController extends Controller
|
|||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to move a already added product to wishlist
|
||||
* will run only on customer authentication.
|
||||
*
|
||||
* @param instance cartItem $id
|
||||
*/
|
||||
public function moveToWishlist($id) {
|
||||
$result = Cart::moveToWishlist($id);
|
||||
|
||||
dd($result);
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@ use Webkul\Shop\Http\Controllers\Controller;
|
|||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
use Webkul\Core\Repositories\SearchRepository as Search;
|
||||
use Webkul\Product\Repositories\SearchRepository as Search;
|
||||
|
||||
/**
|
||||
* Search controller
|
||||
|
|
@ -31,15 +31,16 @@ use Webkul\Core\Repositories\SearchRepository as Search;
|
|||
/**
|
||||
* Index to handle the view loaded with the search results
|
||||
*/
|
||||
public function index() {
|
||||
public function index()
|
||||
{
|
||||
$results = null;
|
||||
|
||||
$results = $this->search->search(request()->all());
|
||||
|
||||
if($results) {
|
||||
return view($this->_config['view'])->with('results', $results);
|
||||
return view($this->_config['view'])->with('products', $results);
|
||||
} else {
|
||||
return view($this->_config['view'])->with('results', null);
|
||||
return view($this->_config['view'])->with('products', null);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,9 @@ Route::group(['middleware' => ['web', 'theme', 'locale', 'currency']], function
|
|||
//Shop buynow button action
|
||||
Route::get('buynow/{id}', 'Webkul\Shop\Http\Controllers\CartController@test')->name('shop.product.buynow');
|
||||
|
||||
//Shop buynow button action
|
||||
Route::get('move/cart/{id}', 'Webkul\Shop\Http\Controllers\CartController@moveToWishlist')->name('shop.movetowishlist');
|
||||
|
||||
//Show Product Details Page(For individually Viewable Product)
|
||||
Route::get('/products/{slug}', 'Webkul\Shop\Http\Controllers\ProductController@index')->defaults('_config', [
|
||||
'view' => 'shop::products.view'
|
||||
|
|
|
|||
|
|
@ -316,6 +316,14 @@ input {
|
|||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
//no search results
|
||||
.search-result-status {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
//main store front layouting
|
||||
.main-container-wrapper {
|
||||
|
|
@ -346,27 +354,6 @@ input {
|
|||
grid-auto-rows: auto;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 551px) {
|
||||
.product-grid-3 {
|
||||
grid-template-columns: 48.5% 48.5%;
|
||||
grid-column-gap: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 854px) {
|
||||
.product-grid-4 {
|
||||
grid-template-columns: 29.5% 29.5% 29.5%;
|
||||
grid-column-gap: 35px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 653px) {
|
||||
.product-grid-4 {
|
||||
grid-template-columns: 48.5% 48.5%;
|
||||
grid-column-gap: 17px;
|
||||
}
|
||||
}
|
||||
|
||||
.product-card {
|
||||
position: relative;
|
||||
|
||||
|
|
@ -442,6 +429,33 @@ input {
|
|||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 580px) {
|
||||
.main-container-wrapper {
|
||||
padding: 0px;
|
||||
}
|
||||
}
|
||||
//product components
|
||||
@media only screen and (max-width: 551px) {
|
||||
.product-grid-3 {
|
||||
grid-template-columns: 48.5% 48.5%;
|
||||
grid-column-gap: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 854px) {
|
||||
.product-grid-4 {
|
||||
grid-template-columns: 29.5% 29.5% 29.5%;
|
||||
grid-column-gap: 35px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 653px) {
|
||||
.product-grid-4 {
|
||||
grid-template-columns: 48.5% 48.5%;
|
||||
grid-column-gap: 17px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 425px) {
|
||||
.product-card {
|
||||
font-size: 90%;
|
||||
|
|
@ -561,6 +575,13 @@ input {
|
|||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 530px) {
|
||||
.main-container-wrapper {
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
//slider styles
|
||||
section.slider-block {
|
||||
display: block;
|
||||
|
|
@ -600,10 +621,15 @@ section.slider-block {
|
|||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: white;
|
||||
color: $font-color;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
top: 0px;
|
||||
|
||||
// * {
|
||||
// color: blue;
|
||||
// font-size: 112px;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -907,6 +933,10 @@ section.slider-block {
|
|||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 8px;
|
||||
|
||||
.btn {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-footer .btn {
|
||||
|
|
@ -1162,7 +1192,7 @@ section.slider-block {
|
|||
}
|
||||
}
|
||||
|
||||
//footer responsive with out media query.
|
||||
//footer
|
||||
.footer {
|
||||
background-color: $background-color;
|
||||
padding-left: 10%;
|
||||
|
|
@ -1264,6 +1294,18 @@ section.slider-block {
|
|||
}
|
||||
}
|
||||
|
||||
.footer-bottom {
|
||||
margin-top: -16px;
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
font-size: 16px;
|
||||
color: #A5A5A5;
|
||||
letter-spacing: -0.26px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
//category page
|
||||
.main {
|
||||
|
|
@ -1727,6 +1769,7 @@ section.product-detail {
|
|||
margin-right: 0px;
|
||||
max-width: none;
|
||||
width: auto;
|
||||
height: auto;
|
||||
|
||||
.loader {
|
||||
margin-left: 47%;
|
||||
|
|
@ -2652,7 +2695,7 @@ section.review {
|
|||
|
||||
border: 1px solid $border-color;
|
||||
flex-direction: column;
|
||||
max-width: 530px;
|
||||
max-width: 500px;
|
||||
min-width: 380px;
|
||||
padding: 25px;
|
||||
|
||||
|
|
@ -2786,6 +2829,64 @@ section.review {
|
|||
}
|
||||
}
|
||||
|
||||
//address holder and address card
|
||||
.address-holder {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.address-card-1 {
|
||||
width: 260px;
|
||||
border: 1px solid #E8E8E8;
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
padding: 25px 1px 22px 15px;
|
||||
margin-right: 15px;
|
||||
margin-bottom: 15px;
|
||||
|
||||
.control-group {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.details {
|
||||
font-weight: lighter;
|
||||
margin-left: 15px;
|
||||
|
||||
span {
|
||||
display: block;
|
||||
margin: 8px;
|
||||
}
|
||||
|
||||
.control-links {
|
||||
width: 90%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.btn {
|
||||
height: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.default-address {
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
right: -3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.edit-form {
|
||||
display: flex;
|
||||
border: 1px solid $border-color;
|
||||
|
|
@ -2796,6 +2897,7 @@ section.review {
|
|||
|
||||
//customer account page responsive layout
|
||||
@media only screen and (max-width: 770px) {
|
||||
|
||||
.account-content {
|
||||
flex-direction: column;
|
||||
|
||||
|
|
@ -2909,6 +3011,7 @@ section.review {
|
|||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.sale-container {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@ return [
|
|||
|
||||
'search' => [
|
||||
'no-results' => 'No Results Found.',
|
||||
'page-title' => 'Bagisto - Search'
|
||||
'page-title' => 'Bagisto - Search',
|
||||
'found-results' => 'Search Results Found',
|
||||
'found-result' => 'Search Result Found'
|
||||
],
|
||||
|
||||
'reviews' => [
|
||||
|
|
@ -380,4 +382,8 @@ return [
|
|||
'thanks' => 'Thanks!'
|
||||
]
|
||||
],
|
||||
|
||||
'webkul' => [
|
||||
'copy-right' => '© Copyright 2018 Webkul Software, All rights reserved.'
|
||||
]
|
||||
];
|
||||
|
|
@ -67,9 +67,16 @@
|
|||
|
||||
<span class="control-error" v-if="errors.has('qty[{{$item->id}}]')">@{{ errors.first('qty') }}</span>
|
||||
|
||||
<span class="remove"><a href="{{ route('shop.checkout.cart.remove', $item->id) }}">{{ __('shop::app.checkout.cart.remove-link') }}</a></span>
|
||||
<span class="remove">
|
||||
<a href="{{ route('shop.checkout.cart.remove', $item->id) }}">{{ __('shop::app.checkout.cart.remove-link') }}</a></span>
|
||||
|
||||
<span class="towishlist">{{ __('shop::app.checkout.cart.move-to-wishlist') }}</span>
|
||||
<span class="towishlist">
|
||||
@if($item->parent_id != 'null' ||$item->parent_id != null)
|
||||
<a href="{{ route('shop.movetowishlist', $item->id) }}">{{ __('shop::app.checkout.cart.move-to-wishlist') }}</a>
|
||||
@else
|
||||
<a href="{{ route('shop.movetowishlist', $item->child->id) }}">{{ __('shop::app.checkout.cart.move-to-wishlist') }}</a>
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@if (!cart()->isItemHaveQuantity($item))
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
@else
|
||||
<div class="address-holder">
|
||||
@foreach($addresses as $address)
|
||||
<div class="address-card">
|
||||
<div class="address-card-1">
|
||||
{{-- <div class="control-group">
|
||||
<label class="radio-container">
|
||||
<input class="control" type="radio" name="radio">
|
||||
|
|
|
|||
|
|
@ -86,4 +86,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -46,7 +46,11 @@
|
|||
</div>
|
||||
|
||||
@include('shop::layouts.footer.footer')
|
||||
|
||||
<div class="footer-bottom">
|
||||
<p>
|
||||
{{ __('shop::app.webkul.copy-right') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
window.flashMessages = [];
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
{{-- <a href="{{ route('shop.product.buynow', $product->id)}}" class="btn btn-lg btn-primary buynow" style="text-align: center;">
|
||||
{{-- <a href="{{ route('shop.product.buynow', $product->id)}}" class="btn btn-lg btn-primary buynow" style="text-align: center;" id="buynow-changer">
|
||||
{{ __('shop::app.products.buy-now') }}
|
||||
</a> --}}
|
||||
|
|
@ -5,7 +5,33 @@
|
|||
@endsection
|
||||
|
||||
@section('content-wrapper')
|
||||
@if(!$results)
|
||||
@if(!$products)
|
||||
{{ __('shop::app.search.no-results') }}
|
||||
@endif
|
||||
<div class="main mb-30" style="min-height: 27vh;">
|
||||
@if($products->isEmpty())
|
||||
<div class="search-result-status">
|
||||
<h2>{{ __('shop::app.products.whoops') }}</h2>
|
||||
<span>{{ __('shop::app.search.no-results') }}</span>
|
||||
</div>
|
||||
@else
|
||||
@if($products->count() == 1)
|
||||
<div class="search-result-status mb-20">
|
||||
<span><b>{{ $products->count() }} </b>{{ __('shop::app.search.found-result') }}</span>
|
||||
</div>
|
||||
@else
|
||||
<div class="search-result-status mb-20">
|
||||
<span><b>{{ $products->count() }} </b>{{ __('shop::app.search.found-results') }}</span>
|
||||
</div>
|
||||
@endif
|
||||
{{-- @include ('shop::products.list.toolbar')
|
||||
|
||||
@inject ('toolbarHelper', 'Webkul\Product\Helpers\Toolbar') --}}
|
||||
<div class="product-grid-4">
|
||||
@foreach ($products as $product)
|
||||
@include ('shop::products.list.card', ['product' => $product])
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
|
|
|
|||
Loading…
Reference in New Issue