price format

This commit is contained in:
vedatakd 2020-01-22 16:03:46 +03:00
parent 9110db48e5
commit 2a7034016a
7 changed files with 9 additions and 14 deletions

View File

@ -112,7 +112,9 @@ class VisiosoftModuleAdvsCreateAdvsFields extends Migration
]
],
'order' => 'anomaly.field_type.integer',
'price' => 'anomaly.field_type.decimal',
'price' => [
'type' => 'visiosoft.field_type.decimal',
],
'currency' => [
'type' => 'anomaly.field_type.select',
'config' => [

View File

@ -151,15 +151,6 @@ return [
'mode' => 'upload',
]
],
'currencies' => [
"type" => "anomaly.field_type.checkboxes",
'bind' => 'adv.currencies',
'env' => 'ADV_CURRENCIES',
'config' => [
"default_value" => 'a:1:{i:0;s:1:"0";}',
'options' => Config::get('streams::currencies.enabled')
]
],
'free_currencyconverterapi_key' => [
"type" => "anomaly.field_type.text",
'bind' => 'adv.free_currencyconverterapi_key',

View File

@ -2,8 +2,7 @@
{% if blocks('ad-item-details-block-area') is null %}
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 offered-field offered-row">
<h3 class="ad-price">
<b>{{ currency_symbol(adv.currency) }}{{ adv.price.format() }}</b>
<b>{{ adv.price.currency(null,'currency',false) }}</b>
<!-- priceField with Block -->
{{ addBlock('ad-detail/priceField',{'adv':adv})|raw }}
<!-- priceField with Block -->

View File

@ -20,7 +20,7 @@
<div class="col-md-3 text-left justify-content-center align-self-center">
<div class="row">
<div class="col-md-12">
<b>{{ adv.price.currency }}</b>
<b>{{ adv.price.currency(null,'currency',false) }}</b>
</div>
{% if setting_value('visiosoft.module.location::list_page_location') %}
<div class="col-md-12 justify-content-center align-self-center text-truncate">

View File

@ -36,7 +36,7 @@
</div>
</td>
<td class="justify-content-center align-middle">
<b>{{ adv.price.currency }}</b>
<b>{{ adv.price.currency(null,'currency',false) }}</b>
</td>
<td class="justify-content-center align-middle">
<small>{{ adv.created_at|date("d/m/Y") }}</small>

View File

@ -163,6 +163,7 @@ class AdvsController extends PublicController
foreach ($featured_advs as $index => $ad) {
$featured_advs[$index]->detail_url = $this->adv_model->getAdvDetailLinkByModel($ad, 'list');
$featured_advs[$index]->price = number_format($ad->price);
$featured_advs[$index] = $this->adv_model->AddAdsDefaultCoverImage($ad);
}

View File

@ -67,6 +67,8 @@
"anomaly/html_block-extension": "~1.0.0",
"anomaly/wysiwyg_block-extension": "~1.0.0",
"ammadeuss/laravel-html-dom-parser": "^1.1",
"visiosoft/decimal-field_type": "~2.1.0",
"visiosoft/integer-field_type": "~2.1.0",
"guzzlehttp/guzzle": "~6.3.3"
},
"require-dev": {