This commit is contained in:
Diatrex 2020-03-17 10:52:48 +03:00
commit 9edd8b0f23
4 changed files with 26 additions and 20 deletions

View File

@ -114,6 +114,11 @@ class VisiosoftModuleAdvsCreateAdvsFields extends Migration
'order' => 'anomaly.field_type.integer',
'price' => [
'type' => 'visiosoft.field_type.decimal',
'config' => [
'decimal' => 2,
'separator' => '.',
'point' => ','
],
],
'currency' => [
'type' => 'anomaly.field_type.select',

View File

@ -15,15 +15,14 @@ var filter = {};
filter.getCats = (catId, divId) => {
$.ajax({
type: 'get',
url: '/class/getcats/'+ divId,
url: '/class/getcats/' + divId,
success: function (response) {
hideLoader()
if(response == 0){
if (response == 0) {
stop();
}
else {
response.forEach(function(options){
$(catId).append("<option value="+options.id+">"+options.name+"</option>");
} else {
response.forEach(function (options) {
$(catId).append("<option value=" + options.id + ">" + options.name + "</option>");
$(catId).closest('li').show();
});
}
@ -35,40 +34,42 @@ filter.getCats = (catId, divId) => {
};
$(document).ready(function () {
$("select[name='currency']").val(default_currency);
if(default_GET == 1)
{
if ($('input[name="slug"]').val() == "") {
$("select[name='currency']").val(default_currency);
}
if (default_GET == 1) {
$('#is_get_adv').prop('checked', true);
}
});
$(document).on('change', '.sub_cats', function(){
$(document).on('change', '.sub_cats', function () {
divId = $(this).find('option:selected').val();
if (divId == 0) {
$(this).parent().nextAll().remove();
} else
filter.callCats(divId);
});
function getAdv(){
if (document.getElementById('getMethod').checked){
function getAdv() {
if (document.getElementById('getMethod').checked) {
var val = $('input[name=price]').val();
val = val*90/100;
$("#priceLi").append('<input type="number" class="form-control" disabled id="getprice" value="'+val+'">');
val = val * 90 / 100;
$("#priceLi").append('<input type="number" class="form-control" disabled id="getprice" value="' + val + '">');
} else {
$("#getprice").remove();
}
}
$('input[name=price]').bind('keyup change', function () {
var val = $('input[name=price]').val();
val = val*90/100;
val = val * 90 / 100;
$("#getprice").val(val);
});
$('input[name="price"]').on('click', function () {
if($(this).val() == "0.00")
{
if ($(this).val() == "0.00") {
$(this).val("");
}
})

View File

@ -9,7 +9,7 @@
{% include "visiosoft.module.advs::list/partials/breadcrumb" %}
<!-- breadcrumb -->
<div class="row my-3">
<div class="row my-3 adv-list-wrapper">
<div class="col-md-3 d-none d-sm-block filter-section">
{% include "visiosoft.module.advs::list/partials/list-filter" %}
</div>

View File

@ -50,7 +50,7 @@ return [
'TRY' => [
'name' => 'Türk Lirası',
'direction' => 'rtl',
'symbol' => 'TL',
'symbol' => ' TL',
'separator' => ',',
'point' => '.',
'decimals' => 2,