2017-02-21 55 views
0

我爲我的網站使用Github頁面,並且它不允許PHP。Simplecart可以與jotform集成嗎?

但因爲我在做一個電子商務網站,我需要一個購物車 - 與按鈕「項目添加到購物車」和「結賬」。

這個想法是,在結帳時,用戶將不得不填寫姓名,地址,電子郵件和聯繫電話。而他/她在購物車中的訂單將成爲默認郵件正文。

我可以將simplecart.js集成到Jotform嗎? (訂單將作爲Jotform中消息正文的參數發送)

回答

0

simplecart-js是我最喜歡的購物車腳本,在我製作的需要結賬功能的每個網站上都使用它。

它具有良好的documentation 您的需求,以獲得simplecart項目,你可以使用simplecart.each功能。

也許是這樣的:

var cart = '', total = 0; 
simpleCart.each(function(item, i){ 
    var subtotal = item.get('price') * item.get('quantity'); 
    cart += i + '. ' + item.get('fullname') + ' >> $' + item.get('price') + ' x ' + item.get('quantity') + ' = $' + subtotal + '\n'; 
    total += subtotal; 
}); 
cart += '\n\nTotal = $' + total; 
$('#messagebody').val(cart); 

的內容主體的輸出將是這樣的:

1. product 1 >> $100 x 2 = $200 
2. product 2 >> $75 x 3 = $225 

Total = $425 
+0

謝謝你,爲我工作! – sophie

相關問題