From 6a741864dd5eb41b2d41a08c22bbd1c2d118b3d8 Mon Sep 17 00:00:00 2001 From: muammertop Date: Fri, 23 Apr 2021 18:02:55 +0300 Subject: [PATCH 1/3] need to items in cart for new oc-theme --- .../advs-module/src/Http/Controller/AdvsController.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php index ea6af9304..e6c86fe37 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php @@ -1108,6 +1108,16 @@ class AdvsController extends PublicController $response['status'] = "success"; $count = $cart->getItems()->count; $response['count'] = $count; + $response['item'] = [ + 'id' => $cart->getItems()->last->id, + 'adv_id' => $cart->getItems()->last->entry_id, + 'photo' => url($cart->getItems()->last->entry->cover_photo), + 'url' => $thisModel->getAdvDetailLinkByAdId($adv->id), + 'name' => $adv->name, + 'quantity' => $cart->getItems()->last->quantity, + 'price' => app(Currency::class)->format($cart->getItems()->last->price, $cart->getItems()->last->currency), + 'subtotal' => app(Currency::class)->format($cart->subtotal, setting_value('streams::currency')) + ]; } else { $response['status'] = "error"; $response['msg'] = trans('visiosoft.module.advs::message.error_added_cart'); From 33a49e8ba08e76dffa6a5d03421dd563d760137d Mon Sep 17 00:00:00 2001 From: Muammer Top Date: Mon, 26 Apr 2021 11:29:51 +0300 Subject: [PATCH 2/3] Show Price To Members Only --- .../advs-module/resources/config/settings/sections.php | 1 + .../advs-module/resources/config/settings/settings.php | 6 ++++++ .../visiosoft/advs-module/resources/lang/en/setting.php | 5 ++++- .../resources/views/ad-detail/partials/detail.twig | 3 ++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php index c5c5d42a3..4c9b427ee 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php @@ -28,6 +28,7 @@ return [ 'popular_ads_limit', 'ads_image_limit', 'default_view_type', + 'show_price_to_members_only', 'price_area_hidden', 'hide_listing_standard_price', 'hide_zero_price', diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php index 3d1980ae4..17d62e30b 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -443,4 +443,10 @@ return [ 'default_value' => false, ] ], + 'show_price_to_members_only' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => false, + ] + ], ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php index 380f51476..f60609297 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php @@ -264,5 +264,8 @@ return [ ], 'show_subcats_mobile' => [ 'name' => 'Show subcategories on mobile view', - ] + ], + 'show_price_to_members_only' => [ + 'name' => 'Show Price To Members Only', + ], ]; diff --git a/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig b/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig index ab26ee08f..460dc4085 100644 --- a/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig +++ b/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig @@ -1,5 +1,6 @@
-
+
{% set standardPrice = adv.standard_price.value %} {% if standardPrice and standardPrice > 0 %}
From 907a0803b17d16bb0f07d61e72451a1025f696c5 Mon Sep 17 00:00:00 2001 From: Muammer Top Date: Mon, 26 Apr 2021 12:12:43 +0300 Subject: [PATCH 3/3] Show Price To Members Only --- .../advs-module/resources/views/ad-detail/partials/detail.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig b/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig index 460dc4085..fd4d80c35 100644 --- a/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig +++ b/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig @@ -1,6 +1,6 @@
+ {{ setting_value('visiosoft.module.advs::show_price_to_members_only') ? (not auth_check() ? 'd-none') }}"> {% set standardPrice = adv.standard_price.value %} {% if standardPrice and standardPrice > 0 %}