я изменил немножко логику теперь сделаю один запрос и хочу вернут результат функции но опят не получается
function idram() {
let quantity = $('td.quantity input').val();
let name = $('#customer_firstname').val();
let phone = $('#customer_telephone').val();
let email = $('#customer_email').val();
let zone_id = $('#shipping_address_zone_id').val();
let city = $('#shipping_address_city').val();
let addr = $('#shipping_address_address_1').val();
let country_id = $('#shipping_address_country_id').val();
let address_id = $('#shipping_address_current_address_id').val();
let shipping_method = $('#simplecheckout_shipping input:checked').val();
let payment = $('#simplecheckout_payment input:checked').val();
$.ajax({
url: 'http://mamapapa.am/index.php?route=checkout/simplecheckout&group=0',
type: 'POST',
dataType: 'html',
cache: false,
data: {
'customer[firstname]': name,
'customer[telephone]': phone,
'customer[email]': email,
'shipping_address[zone_id]': zone_id,
'shipping_address[city]': city,
'shipping_address[address_1]': addr,
'shipping_address[country_id]': country_id,
'shipping_address[postcode]': '',
'shipping_address[current_address_id]': address_id,
'shipping_method': shipping_method,
'shipping_method_current': shipping_method,
'shipping_method_checked': shipping_method,
'payment_method': payment,
'payment_method_current': payment,
'payment_method_checked': payment,
'comment': '',
'quantity[189]': quantity,
'remove': '',
'next_step': 1,
'simple_ajax': 1,
},
}).done( function(html) {
let amou = $(html).find('#total_total span.simplecheckout-cart-total-value').text();
let totalres = parseInt(amou) + '.00';
console.log( totalres ); //так выводит
//return totalres //так нет
})
};
$(document).ready(function () {
$(document).on('input', function () {
let total = idram();
console.log(total);
});
});