From e647124f0f43fb4c1b59c538ea540a572e4e4180 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Tue, 24 Dec 2019 18:17:02 +0300 Subject: [PATCH 1/2] #557 Installment calculation widget --- .../resources/views/ad-detail/detail.twig | 2 ++ .../advs-module/src/AdvsModuleServiceProvider.php | 5 +++++ .../src/Http/Controller/AjaxController.php | 12 +++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/addons/default/visiosoft/advs-module/resources/views/ad-detail/detail.twig b/addons/default/visiosoft/advs-module/resources/views/ad-detail/detail.twig index b0ec93e9a..b3e8195a8 100644 --- a/addons/default/visiosoft/advs-module/resources/views/ad-detail/detail.twig +++ b/addons/default/visiosoft/advs-module/resources/views/ad-detail/detail.twig @@ -47,6 +47,8 @@ {{ blocks('ad-item-content-block-area') }} {% endif %} + {{ addBlock('ad-detail/widget', {'price': adv.price, 'id': adv.id})|raw }} + diff --git a/addons/default/visiosoft/advs-module/src/AdvsModuleServiceProvider.php b/addons/default/visiosoft/advs-module/src/AdvsModuleServiceProvider.php index 997e73ee5..439b3ceb5 100644 --- a/addons/default/visiosoft/advs-module/src/AdvsModuleServiceProvider.php +++ b/addons/default/visiosoft/advs-module/src/AdvsModuleServiceProvider.php @@ -207,6 +207,11 @@ class AdvsModuleServiceProvider extends AddonServiceProvider 'as' => 'ajax::getAds', 'uses' => 'Visiosoft\AdvsModule\Http\Controller\AjaxController@getMyAds' ], + + 'ajax/loanApplication' => [ + 'as' => 'ajax::loanApplication', + 'uses' => 'Visiosoft\AdvsModule\Http\Controller\AjaxController@sendLoanApplication' + ], ]; /** diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/AjaxController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/AjaxController.php index 9ddb7ad32..960f45490 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/AjaxController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/AjaxController.php @@ -1,6 +1,7 @@ adv_model = $advModel; + $this->userModel = $userModel; parent::__construct(); } @@ -88,4 +92,10 @@ class AjaxController extends PublicController return response()->json(['success' => true, 'content' => $my_advs, 'title' => $page_title]); } + public function sendLoanApplication(Request $request) + { + $this->userModel->find(1)->notify(new SendLoanApplicationMail($request)); + return response()->json(['success' => true, 'content' => $request['firstName']]); + } + } \ No newline at end of file From 7827806f71ba694c5effd8d66a1988ed3c14901b Mon Sep 17 00:00:00 2001 From: Diatrex Date: Wed, 25 Dec 2019 14:19:12 +0300 Subject: [PATCH 2/2] #587 [sahibinden-module] Getting custom fields dynamically --- .../visiosoft/advs-module/src/AdvsModuleServiceProvider.php | 4 ---- .../advs-module/src/Http/Controller/AjaxController.php | 6 ------ 2 files changed, 10 deletions(-) diff --git a/addons/default/visiosoft/advs-module/src/AdvsModuleServiceProvider.php b/addons/default/visiosoft/advs-module/src/AdvsModuleServiceProvider.php index 439b3ceb5..b90a22ade 100644 --- a/addons/default/visiosoft/advs-module/src/AdvsModuleServiceProvider.php +++ b/addons/default/visiosoft/advs-module/src/AdvsModuleServiceProvider.php @@ -208,10 +208,6 @@ class AdvsModuleServiceProvider extends AddonServiceProvider 'uses' => 'Visiosoft\AdvsModule\Http\Controller\AjaxController@getMyAds' ], - 'ajax/loanApplication' => [ - 'as' => 'ajax::loanApplication', - 'uses' => 'Visiosoft\AdvsModule\Http\Controller\AjaxController@sendLoanApplication' - ], ]; /** diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/AjaxController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/AjaxController.php index 960f45490..ea82429bd 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/AjaxController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/AjaxController.php @@ -92,10 +92,4 @@ class AjaxController extends PublicController return response()->json(['success' => true, 'content' => $my_advs, 'title' => $page_title]); } - public function sendLoanApplication(Request $request) - { - $this->userModel->find(1)->notify(new SendLoanApplicationMail($request)); - return response()->json(['success' => true, 'content' => $request['firstName']]); - } - } \ No newline at end of file