From 0e756d3ca385f5c36514e91342572c2ddc020c8f Mon Sep 17 00:00:00 2001 From: vedatakd Date: Fri, 30 Apr 2021 11:45:53 +0300 Subject: [PATCH 1/3] fixed migration --- ...visiosoft.module.advs__change_product_options_value.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/default/visiosoft/advs-module/migrations/2021_04_27_143550_visiosoft.module.advs__change_product_options_value.php b/addons/default/visiosoft/advs-module/migrations/2021_04_27_143550_visiosoft.module.advs__change_product_options_value.php index 679e891aa..1351744ff 100644 --- a/addons/default/visiosoft/advs-module/migrations/2021_04_27_143550_visiosoft.module.advs__change_product_options_value.php +++ b/addons/default/visiosoft/advs-module/migrations/2021_04_27_143550_visiosoft.module.advs__change_product_options_value.php @@ -4,6 +4,13 @@ use Anomaly\Streams\Platform\Database\Migration\Migration; class VisiosoftModuleAdvsChangeProductOptionsValue extends Migration { + public function __construct() + { + //Maria DB will be removed when the version is updated. + \Illuminate\Support\Facades\DB::getDoctrineSchemaManager() + ->getDatabasePlatform()->registerDoctrineTypeMapping('point', 'string'); + } + public function up() { if (!$field = $this->fields()->findBySlugAndNamespace('product_options_value', 'advs')) { From 89b64cbc1a44e0659d975ed125ec5b90bb0259a9 Mon Sep 17 00:00:00 2001 From: muammertop Date: Fri, 30 Apr 2021 15:40:17 +0300 Subject: [PATCH 2/3] hide price for unauthorized users --- .../visiosoft/advs-module/resources/views/list/gallery.twig | 3 ++- .../advs-module/resources/views/list/partials/ads.twig | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/default/visiosoft/advs-module/resources/views/list/gallery.twig b/addons/default/visiosoft/advs-module/resources/views/list/gallery.twig index 1c1f67dce..f7834624e 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/gallery.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/gallery.twig @@ -32,7 +32,8 @@

{{ adv.cat1_name }} /{{ adv.cat2_name }}

{% endif %} {% if showPrice %} -

+

{{ adv.price != '0' ? currency_format(adv.price,adv.currency) : trans('visiosoft.module.advs::field.free') }}

{% endif %} diff --git a/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig b/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig index bda048385..f0b935a49 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig @@ -15,7 +15,9 @@ {% if setting_value('visiosoft.module.advs::market_place') %} {{ trans('visiosoft.module.advs::field.listing_date') }} {% endif %} - {{ trans('visiosoft.module.advs::field.price.name') }} + + {{ trans('visiosoft.module.advs::field.price.name') }} + @@ -56,7 +58,7 @@

{{ adv.publish_at.value|date('Y') }}

{% endif %} - + {% if not hideStandard %}

From efee230284c72651175d76975faf89cdba76cf17 Mon Sep 17 00:00:00 2001 From: muammertop Date: Fri, 30 Apr 2021 16:00:36 +0300 Subject: [PATCH 3/3] fixed hide price for unauthorized users --- .../resources/views/ad-detail/partials/detail.twig | 3 +-- .../visiosoft/advs-module/resources/views/list/gallery.twig | 3 +-- .../advs-module/resources/views/list/partials/ads.twig | 6 ++---- .../visiosoft/advs-module/src/Support/Command/Currency.php | 4 +++- 4 files changed, 7 insertions(+), 9 deletions(-) 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 fd4d80c35..ab26ee08f 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,5 @@

-
+
{% set standardPrice = adv.standard_price.value %} {% if standardPrice and standardPrice > 0 %}
diff --git a/addons/default/visiosoft/advs-module/resources/views/list/gallery.twig b/addons/default/visiosoft/advs-module/resources/views/list/gallery.twig index f7834624e..1c1f67dce 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/gallery.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/gallery.twig @@ -32,8 +32,7 @@

{{ adv.cat1_name }} /{{ adv.cat2_name }}

{% endif %} {% if showPrice %} -

+

{{ adv.price != '0' ? currency_format(adv.price,adv.currency) : trans('visiosoft.module.advs::field.free') }}

{% endif %} diff --git a/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig b/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig index f0b935a49..bda048385 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig @@ -15,9 +15,7 @@ {% if setting_value('visiosoft.module.advs::market_place') %} {{ trans('visiosoft.module.advs::field.listing_date') }} {% endif %} - - {{ trans('visiosoft.module.advs::field.price.name') }} - + {{ trans('visiosoft.module.advs::field.price.name') }} @@ -58,7 +56,7 @@

{{ adv.publish_at.value|date('Y') }}

{% endif %} - + {% if not hideStandard %}

diff --git a/addons/default/visiosoft/advs-module/src/Support/Command/Currency.php b/addons/default/visiosoft/advs-module/src/Support/Command/Currency.php index d7c2ac70f..f0d86c33c 100644 --- a/addons/default/visiosoft/advs-module/src/Support/Command/Currency.php +++ b/addons/default/visiosoft/advs-module/src/Support/Command/Currency.php @@ -48,7 +48,9 @@ class Currency $decimals = 0; } } - + if (setting_value('visiosoft.module.advs::show_price_to_members_only') && !auth()->check()){ + return null; + } return $prefix . number_format($number, $decimals, $point, str_replace(' ', ' ', $separator)) . $suffix; }