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..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,5 +1,6 @@
-
+
{% set standardPrice = adv.standard_price.value %} {% if standardPrice and standardPrice > 0 %}
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');