Merge pull request #791 from openclassify/muammertop

myAds price currency format edited
This commit is contained in:
spektra2147 2020-11-13 13:55:44 +03:00 committed by GitHub
commit 48d36f7381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -1,6 +1,7 @@
<?php namespace Visiosoft\AdvsModule\Http\Controller;
use Anomaly\Streams\Platform\Http\Controller\PublicController;
use Anomaly\Streams\Platform\Support\Currency;
use Anomaly\UsersModule\User\UserModel;
use Visiosoft\AdvsModule\Adv\AdvModel;
use Illuminate\Http\Request;
@ -81,6 +82,7 @@ class AjaxController extends PublicController
foreach ($my_advs as $index => $ad) {
$my_advs[$index]->detail_url = $this->adv_model->getAdvDetailLinkByModel($ad, 'list');
$my_advs[$index] = $this->adv_model->AddAdsDefaultCoverImage($ad);
$my_advs[$index]->formatted_price = app(Currency::class)->format($ad->price, $ad->currency);
}
return response()->json(['success' => true, 'content' => $my_advs, 'title' => $page_title]);

View File

@ -36,7 +36,7 @@
<div class="card-body">
{% if setting_value('visiosoft.theme.base::price_fields') %}
<div class="d-flex justify-content-between align-items-center">
<b>{{ latestAd.price }} {{ latestAd.currency }}</b>
<b>{{ currency_format(latestAd.price, latestAd.currency) }}</b>
</div>
{% endif %}
<div class="d-flex justify-content-between align-items-center text-truncate">

View File

@ -37,8 +37,8 @@ function changePage(page) {
}
for (var i = (page - 1) * records_per_page; i < (page * records_per_page) && i < objJson.length; i++) {
listing_table.append(addAdsRow(objJson[i].id, objJson[i].detail_url, objJson[i].cover_photo, objJson[i].name,
objJson[i].price + " " + objJson[i].currency,
objJson[i].city_name, objJson[i].country_name, objJson[i].cat1_name, objJson[i].cat2_name, objJson[i].status));
objJson[i].formatted_price, objJson[i].city_name, objJson[i].country_name, objJson[i].cat1_name,
objJson[i].cat2_name, objJson[i].status));
}
page_span.html(page + "/" + numPages());
@ -97,7 +97,7 @@ type = type ? type : 'approved';
getMyAdvs(type);
function addAdsRow(id, href, image, name, price, city, country, cat1, cat2, status) {
function addAdsRow(id, href, image, name, formatted_price, city, country, cat1, cat2, status) {
return "<div class='col-md-12 mb-2 profile-ads border-bottom border-white'>\n" +
"<div class='row bg-light'>\n" +
"<div class='col-md-2 justify-content-center align-self-center border-right border-white'>\n" +
@ -120,7 +120,7 @@ function addAdsRow(id, href, image, name, price, city, country, cat1, cat2, stat
"<div class='col-md-3 text-left justify-content-center align-self-center'>\n" +
"<div class='row'>\n" +
"<div class='col-md-12'>\n" +
"<b>" + price + "</b>\n" +
"<b>" + formatted_price + "</b>\n" +
"</div>\n" +
"<div class='col-md-12 justify-content-center align-self-center text-truncate'>\n" +
"<small>" + city + " " + country + "</small>\n" +