Answer the question
In order to leave comments, you need to log in
Sending data from custom cart to Telegram?
Good day to all, guys!
There is a page with a basket, I used it to create a basket - this .
It is necessary to make sure that when ordering without payment, the data flew to the bot in telegrams.
I did sending forms to telegrams through - this . Everything works great, but now the question is with the basket, how to send? Pull data from cart div, put it in inputs and submit as form? Thanks for the advice, in advance!
Answer the question
In order to leave comments, you need to log in
An interesting decision was made. Further " Caution crutch! ".
function displayCart() {
var cartArray = shoppingCart.listCart();
var output = "" + "<div ><input class='input-send' name='phone' value='' placeholder='Номер телефона' requaired>" + "<input class='input-send' name='name' value='' placeholder='Ваша почта' requaired>" + "<button class='sendspan' type='submit'>Отправить заказ</button></div>";
for (var i in cartArray) {
output += "<div class='form-group'>"
+ "<img src=" + cartArray[i].name + ">"
+ "<div class='input-group'><button class='minus-item input-group-addon' data-name=" + cartArray[i].name + ">-</button>"
+ "<input name='mutch' type='number' class='item-count form-control' data-name='" + cartArray[i].name + "' value='" + cartArray[i].count + "' requaired>"
+ "<button class='plus-item btn input-group-addon' data-name=" + cartArray[i].name + ">+</button></div>"
+ "<div name='price' requaired>" + cartArray[i].total + "</div>"
+ "<button class='delete-item btn btn-danger' data-name=" + cartArray[i].name + ">×</button>"
+ "<p class='form-message'></p>"
+ "<div id='message'></div>"
+ "</div>"
+ "<input class='offer' name='offer[]' value='Артикул: " + cartArray[i].name + " | Количество: " + cartArray[i].count + " | Сумма: " + cartArray[i].total + "' requaired>"
+ "</div>";
}
$('.show-cart').html(output);
$('.total-cart').html(shoppingCart.totalCart());
$('.total-count').html(shoppingCart.totalCount());
}
+ "<input class='offer' name='offer[]' value='Артикул: " + cartArray[i].name + " | Количество: " + cartArray[i].count + " | Сумма: " + cartArray[i].total + "' requaired>"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question