Bug Fixes

This commit is contained in:
prashant-webkul 2018-10-26 12:35:19 +05:30
parent 74605cbeff
commit 462dc9fafb
12 changed files with 55 additions and 21 deletions

View File

@ -92,7 +92,6 @@ class OrderDataGrid
return '<span class="badge badge-md badge-info">Completed</span>';
else if($value == "pending")
return '<span class="badge badge-md badge-warning">Pending</span>';
},
],
],

View File

@ -13,17 +13,17 @@ use Webkul\Ui\DataGrid\Facades\DataGrid;
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CustomerReviewDataGrid
class ProductReviewDataGrid
{
/**
* The CustomerReviewDataGrid
* The ProductReviewDataGrid
* implementation.
*
* @var CustomerReviewsDataGrid
* for Reviews
*/
public function createCustomerReviewDataGrid()
public function createProductReviewDataGrid()
{
return DataGrid::make([
@ -87,6 +87,12 @@ class CustomerReviewDataGrid
'type' => 'number',
'label' => 'Status',
'sortable' => true,
'wrapper' => function ($value) {
if($value == 'approved')
return '<span class="badge badge-md badge-success">Approved</span>';
else if($value == "pending")
return '<span class="badge badge-md badge-warning">Pending</span>';
},
],
],
@ -153,6 +159,6 @@ class CustomerReviewDataGrid
public function render()
{
return $this->createCustomerReviewDataGrid()->render();
return $this->createProductReviewDataGrid()->render();
}
}

View File

@ -19,7 +19,7 @@
</div>
<div class="page-content">
@inject('review','Webkul\Admin\DataGrids\CustomerReviewDataGrid')
@inject('review','Webkul\Admin\DataGrids\ProductReviewDataGrid')
{!! $review->render() !!}
</div>
</div>

View File

@ -1164,4 +1164,21 @@ class Cart {
return ['parent' => $parentData, 'child' => $childData];
}
/**
* Handle the buy now process for simple as well as configurable products
*
* @return response mixed
*/
public function proceedForBuyNow($id) {
$product = $this->product->findOneByField('id', $id);
if($product->type == 'configurable') {
session()->flash('warning', 'Please Select Options Before Buying This Product');
return false;
} else {
$this->moveToCart($id);
}
}
}

View File

@ -143,7 +143,11 @@ class CartController extends Controller
return redirect()->route('shop.products.index', $slug);
}
public function test() {
$result = Cart::isConfigurable(9);
public function test($id) {
$result = Cart::proceedForBuyNow($id);
if(!$result) {
return redirect()->back();
}
}
}

View File

@ -46,7 +46,7 @@ class ReviewController extends Controller
*/
public function __construct(Product $product, ProductReview $productReview)
{
$this->middleware('admin');
$this->middleware('admin')->only(['update', 'destroy']);
$this->middleware('customer')->only(['create', 'store']);
@ -151,4 +151,13 @@ class ReviewController extends Controller
return redirect()->route($this->_config['redirect']);
}
/**
* Delete the review of the current product
*
* @return response
*/
public function destroy() {
}
}

View File

@ -45,8 +45,8 @@ Route::group(['middleware' => ['web', 'theme', 'locale', 'currency']], function
'view' => 'shop::checkout.success'
])->name('shop.checkout.success');
//dummy
Route::get('test', 'Webkul\Shop\Http\Controllers\CartController@test');
//buy now
Route::get('buynow/{id}', 'Webkul\Shop\Http\Controllers\CartController@test')->name('shop.product.buynow');
Route::get('/products/{slug}', 'Webkul\Shop\Http\Controllers\ProductController@index')->defaults('_config', [
'view' => 'shop::products.view'

View File

@ -829,6 +829,7 @@ section.slider-block {
}
}
}
ul.right-responsive {
display: none;
cursor: pointer;
@ -1065,6 +1066,7 @@ section.slider-block {
ul.right-responsive {
display: flex !important;
margin-left: 12px;
}
}
@ -1671,7 +1673,6 @@ section.product-detail {
.rating-reviews {
.rating-header {
font-weight: 600;
padding: 20px 0;
}

View File

@ -1,3 +1,3 @@
<a href="/buynow" 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;">
{{ __('shop::app.products.buy-now') }}
</a>

View File

@ -32,8 +32,6 @@
@include ('shop::products.price', ['product' => $product])
@include ('shop::products.review', ['product' => $product])
@if(Route::currentRouteName() == "shop.products.index")
@include ('shop::products.add-to', ['product' => $product])
@else

View File

@ -27,11 +27,11 @@
</div>
@if(!is_null($customer))
@auth('customer')
<a href="{{ route('shop.reviews.create', $product->url_key) }}" class="btn btn-lg btn-primary">
{{ __('shop::app.products.write-review-btn') }}
</a>
@endif
@endauth
</div>
@ -72,7 +72,7 @@
</div>
</div>
@else
@if(!is_null($customer))
@auth('customer')
<div class="rating-reviews">
<div class="rating-header">
<a href="{{ route('shop.reviews.create', $product->url_key) }}" class="btn btn-lg btn-primary">
@ -80,5 +80,5 @@
</a>
</div>
</div>
@endif
@endauth
@endif

View File

@ -1284,6 +1284,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
display: -webkit-box !important;
display: -ms-flexbox !important;
display: flex !important;
margin-left: 12px;
}
}
@ -1882,7 +1883,6 @@ section.product-detail div.layouter form .details .attributes {
}
.rating-reviews .rating-header {
font-weight: 600;
padding: 20px 0;
}