This commit is contained in:
parent
b298a3973a
commit
e3e80dde1e
|
|
@ -68,7 +68,7 @@ Route::group(['middleware' => ['web']], function () {
|
|||
'view' => 'admin::customers.review.index'
|
||||
])->name('admin.customer.review.index');
|
||||
|
||||
|
||||
// Configuration routes
|
||||
Route::get('configuration/{slug?}/{slug2?}', 'Webkul\Admin\Http\Controllers\ConfigurationController@index')->defaults('_config', [
|
||||
'view' => 'admin::configuration.index'
|
||||
])->name('admin.configuration.index');
|
||||
|
|
@ -77,17 +77,6 @@ Route::group(['middleware' => ['web']], function () {
|
|||
'redirect' => 'admin.configuration.index'
|
||||
])->name('admin.configuration.index.store');
|
||||
|
||||
//Shipping Methods Routes
|
||||
// Route::get('configuration/sales/shipping-methods', 'Webkul\Admin\Http\Controllers\ConfigurationController@index')->defaults('_config', [
|
||||
// 'view' => 'admin::configuration.sales.shipping-method'
|
||||
// ])->name('admin.configuration.sales.shipping_methods');
|
||||
|
||||
|
||||
// Route::post('configuration/sales/shipping-methods', 'Webkul\Admin\Http\Controllers\ConfigurationController@store')->defaults('_config', [
|
||||
// 'redirect' => 'admin.configuration.sales.shipping_methods'
|
||||
// ])->name('admin.configuration.sales.shipping_methods.store');
|
||||
|
||||
|
||||
// Reviews Routes
|
||||
Route::get('reviews/edit/{id}', 'Webkul\Product\Http\Controllers\ReviewController@edit')->defaults('_config',[
|
||||
'view' => 'admin::customers.review.edit'
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
</span>
|
||||
|
||||
<span class="role">
|
||||
Administrator
|
||||
{{ auth()->guard('admin')->user()->role['name'] }}
|
||||
</span>
|
||||
</div>
|
||||
<i class="icon arrow-down-icon active"></i>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ use Webkul\Customer\Models\CustomerGroup;
|
|||
use Webkul\Checkout\Models\Cart;
|
||||
use Webkul\Sales\Models\Order;
|
||||
use Webkul\Customer\Models\Wishlist;
|
||||
use Webkul\Product\Models\ProductReview;
|
||||
use Webkul\Customer\Notifications\CustomerResetPassword;
|
||||
|
||||
class Customer extends Authenticatable
|
||||
|
|
@ -89,4 +90,11 @@ class Customer extends Authenticatable
|
|||
public function active_carts() {
|
||||
return $this->hasMany(Cart::class, 'customer_id')->where('is_active', 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* get all reviews of a customer
|
||||
*/
|
||||
public function all_reviews() {
|
||||
return $this->hasMany(ProductReview::class, 'customer_id');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,4 +123,23 @@ class ReviewController extends Controller
|
|||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to delete all reviews
|
||||
*
|
||||
* @return Mixed Response & Boolean
|
||||
*/
|
||||
public function deleteAll() {
|
||||
$reviews = auth()->guard('customer')->user()->all_reviews;
|
||||
|
||||
if($reviews->count() > 0) {
|
||||
foreach($reviews as $review) {
|
||||
$this->productReview->delete($review->id);
|
||||
}
|
||||
}
|
||||
|
||||
session()->flash('success', trans('shop::app.reviews.delete-all'));
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ Route::group(['middleware' => ['web', 'theme', 'locale', 'currency']], function
|
|||
])->name('customer.orders.print');
|
||||
|
||||
/* Reviews route */
|
||||
//Customer reviews(listing) only approved
|
||||
//Customer reviews
|
||||
Route::get('reviews', 'Webkul\Customer\Http\Controllers\CustomerController@reviews')->defaults('_config', [
|
||||
'view' => 'shop::customers.account.reviews.index'
|
||||
])->name('customer.reviews.index');
|
||||
|
|
@ -264,6 +264,11 @@ Route::group(['middleware' => ['web', 'theme', 'locale', 'currency']], function
|
|||
Route::get('reviews/delete/{id}', 'Webkul\Shop\Http\Controllers\ReviewController@destroy')->defaults('_config', [
|
||||
'redirect' => 'customer.reviews.index'
|
||||
])->name('customer.review.delete');
|
||||
|
||||
//Customer all review delete
|
||||
Route::get('reviews/all-delete', 'Webkul\Shop\Http\Controllers\ReviewController@deleteAll')->defaults('_config', [
|
||||
'redirect' => 'customer.reviews.index'
|
||||
])->name('customer.review.deleteall');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ return [
|
|||
'product-review-page-title' => 'Product Review',
|
||||
'rating-reviews' => 'Rating & Reviews',
|
||||
'submit' => 'SUBMIT',
|
||||
'delete-all' => 'All Reviews has deleted Succesfully'
|
||||
],
|
||||
|
||||
'customer' => [
|
||||
|
|
|
|||
|
|
@ -16,6 +16,13 @@
|
|||
<span class="back-icon"><a href="{{ route('customer.account.index') }}"><i class="icon icon-menu-back"></i></a></span>
|
||||
|
||||
<span class="account-heading">{{ __('shop::app.customer.account.review.index.title') }}</span>
|
||||
|
||||
@if(count($reviews) > 1)
|
||||
<div class="account-action">
|
||||
<a href="{{ route('customer.review.deleteall') }}">{{ __('shop::app.wishlist.deleteall') }}</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<span></span>
|
||||
<div class="horizontal-rule"></div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
@if(count($items))
|
||||
<div class="account-action">
|
||||
<a href="{{ route('customer.wishlist.removeall') }}" style="margin-right: 15px;">{{ __('shop::app.wishlist.deleteall') }}</a>
|
||||
<a href="{{ route('customer.wishlist.removeall') }}">{{ __('shop::app.wishlist.deleteall') }}</a>
|
||||
</div>
|
||||
@endif
|
||||
<div class="horizontal-rule"></div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue