Message Added In Velocity And Velocity Guest
This commit is contained in:
parent
f95490eed7
commit
92dcbe3763
|
|
@ -17,7 +17,7 @@ class ComparisonController extends Controller
|
|||
{
|
||||
if (request()->get('data')) {
|
||||
$productSlugs = null;
|
||||
|
||||
|
||||
$productCollection = [];
|
||||
|
||||
if (auth()->guard('customer')->user()) {
|
||||
|
|
@ -88,7 +88,7 @@ class ComparisonController extends Controller
|
|||
|
||||
if ($productFlat) {
|
||||
$productId = $productFlat->id;
|
||||
|
||||
|
||||
$this->compareProductsRepository->create([
|
||||
'customer_id' => $customerId,
|
||||
'product_flat_id' => $productId,
|
||||
|
|
@ -123,17 +123,19 @@ class ComparisonController extends Controller
|
|||
$this->compareProductsRepository->deleteWhere([
|
||||
'customer_id' => auth()->guard('customer')->user()->id,
|
||||
]);
|
||||
$message = trans('velocity::app.customer.compare.removed-all');
|
||||
} else {
|
||||
// delete individual
|
||||
$this->compareProductsRepository->deleteWhere([
|
||||
'product_flat_id' => request()->get('productId'),
|
||||
'customer_id' => auth()->guard('customer')->user()->id,
|
||||
]);
|
||||
$message = trans('velocity::app.customer.compare.removed');
|
||||
}
|
||||
|
||||
return [
|
||||
'status' => 'success',
|
||||
'message' => trans('velocity::app.customer.compare.removed'),
|
||||
'message' => $message,
|
||||
'label' => trans('velocity::app.shop.general.alert.success'),
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,18 +218,22 @@
|
|||
if (productId == "all") {
|
||||
updatedItems = [];
|
||||
this.$set(this, 'products', []);
|
||||
window.showAlert(
|
||||
`alert-success`,
|
||||
this.__('shop.general.alert.success'),
|
||||
`${this.__('customer.compare.removed-all')}`
|
||||
);
|
||||
} else {
|
||||
updatedItems = existingItems.filter(item => item != productId);
|
||||
this.$set(this, 'products', this.products.filter(product => product.id != productId));
|
||||
window.showAlert(
|
||||
`alert-success`,
|
||||
this.__('shop.general.alert.success'),
|
||||
`${this.__('customer.compare.removed')}`
|
||||
);
|
||||
}
|
||||
|
||||
this.setStorageValue('compared_product', updatedItems);
|
||||
|
||||
window.showAlert(
|
||||
`alert-success`,
|
||||
this.__('shop.general.alert.success'),
|
||||
`${this.__('customer.compare.removed')}`
|
||||
);
|
||||
}
|
||||
|
||||
this.$root.headerItemsCount++;
|
||||
|
|
|
|||
Loading…
Reference in New Issue