Merge pull request #1266 from openclassify/dia

#5088 Sistem durumu silinmemeli
This commit is contained in:
Ozcan Durak 2022-01-10 18:38:52 +03:00 committed by GitHub
commit 667cfbd645
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View File

@ -36,4 +36,6 @@ return [
'currency_converter_not_available' => 'The currency converter is not available.',
'option_saved' => 'Option Saved',
'do_you_want_to_save_the_option' => 'Do you want to save the option?',
'you_can_not_delete_a_system_status' => 'You can not delete a system status!',
'product_added_to_cart' => 'Product added to cart!',
];

View File

@ -1163,6 +1163,7 @@ class AdvsController extends PublicController
if ($adv and $adv->getStatus() == "approved") {
$cart = $thisModel->addCart($adv, $quantity, $name);
$response['status'] = "success";
$response['msg'] = trans('visiosoft.module.advs::message.product_added_to_cart');
$count = $cart->getItems()->count;
$response['count'] = $count;
$response['item'] = [

View File

@ -1,8 +1,16 @@
<?php namespace Visiosoft\AdvsModule\Status;
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
use Anomaly\Streams\Platform\Entry\EntryObserver;
class StatusObserver extends EntryObserver
{
public function deleting(EntryInterface $entry)
{
if ($entry->is_system) {
abort(403, trans('visiosoft.module.advs::message.you_can_not_delete_a_system_status'));
}
parent::deleting($entry);
}
}