Страница оформление заказа:

<button
type=»button»
style=»margin: 20px 0;»
class=»TINKOFF_BTN_YELLOW TINKOFF_SIZE_S»
onclick=» let pay_arr = [];
let pay_summ = 0;
$(‘.cart-table tbody tr’).each(function(indx, element){
let p_price = parseInt( $(this).find(‘.price-cell’).text().replace(/\s+/g, ») );
let p_count = parseInt( $(this).find(‘.count-cell .amount_input’).val() );

pay_arr.push({name: $(this).find(‘.name-cell’).text().replace(/ +/g, ‘ ‘).trim(), price: p_price, quantity: p_count});

pay_summ = pay_summ + ( p_price*p_count );
});

console.log(pay_arr);
console.log(pay_summ);
tinkoff.create(
{
sum: pay_summ,
items: pay_arr ,
demoFlow: ‘sms’,
promoCode: ‘default’,
shopId: ‘9194d311-b69e-4de0-83fd-d0db878b4029′,
showcaseId: ’14cdcecf-4d39-4690-8cd5-45a848db714c’,
},
{view: ‘modal’}

>Купить в рассрочку или кредит</button>

 

Карточка товара:

<button
type=»button»
style=»float: right; margin: -35px 100px 0 0;»
class=»TINKOFF_BTN_YELLOW TINKOFF_SIZE_S»
onclick=» let pay_obj = $(this).parents(‘.buy-block’);
let pay_price = parseInt( pay_obj.find(‘.price’).text().replace(/\s+/g, ») );
let pay_count = parseInt( pay_obj.find(‘.amount_input’).val() );
let pay_name = pay_obj.find(‘.product-title’).text();
tinkoff.createDemo(
{
sum: pay_price * pay_count,
items: [{name: pay_name , price: pay_price, quantity: pay_count}],
demoFlow: ‘sms’,
promoCode: ‘default’,
shopId: ‘9194d311-b69e-4de0-83fd-d0db878b4029′,
showcaseId: ’14cdcecf-4d39-4690-8cd5-45a848db714c’,
},
{view: ‘modal’}

>Купить в рассрочку или кредит</button>

Прокрутить вверх