File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 4545 'error_operations_author ' => "You cannot perform operations a post that do not belong to you! " ,
4646 'error_general ' => 'An error was encountered. Contact the admin! ' ,
4747
48- 'adv_create_success ' => 'The ad has been successfully created '
48+ 'adv_create_success ' => 'The ad has been successfully created ' ,
49+ 'out_of_stock ' => 'The product is out of stock. ' ,
4950];
Original file line number Diff line number Diff line change 4646 'error_general ' => 'Bir hatayla karşılaşıldı. Yöneticiyle iletişime geçin! ' ,
4747
4848
49- 'adv_create_success ' => 'Ürün başarıyla oluşturuldu '
49+ 'adv_create_success ' => 'Ürün başarıyla oluşturuldu ' ,
50+ 'out_of_stock ' => 'Stoklarımız tükenmiştir. '
5051];
Original file line number Diff line number Diff line change @@ -1422,6 +1422,11 @@ public function addCart(Request $request)
14221422 $ thisModel = new AdvModel ();
14231423 $ adv = $ thisModel ->isAdv ($ id );
14241424 $ response = array ();
1425+ if (!$ adv ->inStock ()) {
1426+ $ response ['status ' ] = "error " ;
1427+ $ response ['msg ' ] = trans ('visiosoft.module.advs::message.out_of_stock ' );
1428+ return $ response ;
1429+ }
14251430 if ($ adv and $ adv ->getStatus () == "approved " ) {
14261431 $ cart = $ thisModel ->addCart ($ adv , $ quantity , $ name );
14271432 $ response ['status ' ] = "success " ;
You can’t perform that action at this time.
0 commit comments