change cart to plain post from ajax
This commit is contained in:
@@ -25,13 +25,15 @@ function ProductSell(o){
|
||||
form_invalid: 'Az ürlap hibákat tartalmaz',
|
||||
message_paid: 'Tételek fizetve',
|
||||
/**list of sold items by current user*/
|
||||
user_cart: [],
|
||||
user_cart: [],// the user cart items
|
||||
discounts: [],
|
||||
customer_cart: [],
|
||||
customer_cart: [], //the customer cart items
|
||||
id_account: null,
|
||||
products : [],
|
||||
url_delete_transaction : '',
|
||||
url_pay_transaction : '',
|
||||
value_number: '',
|
||||
name_number: '',
|
||||
|
||||
};
|
||||
|
||||
@@ -70,8 +72,8 @@ function ProductSell(o){
|
||||
* payout out user or customer cart
|
||||
* */
|
||||
function addPayoutButtons(){
|
||||
addBehaviourPayoutUserCart();
|
||||
addBehaviourPayoutCustomerCart();
|
||||
// addBehaviourPayoutUserCart();
|
||||
// addBehaviourPayoutCustomerCart();
|
||||
}
|
||||
/**
|
||||
* display user and customer cart on page load
|
||||
@@ -464,7 +466,6 @@ function ProductSell(o){
|
||||
}
|
||||
function addBehaviourPayoutCustomerCart( ){
|
||||
$( app.defaults.selector_btn_pay_customer_cart ).on('click',function(){
|
||||
alert('ok');
|
||||
$.ajax({
|
||||
url: app.defaults.url_pay_customer_card,
|
||||
type: 'post',
|
||||
@@ -489,6 +490,11 @@ function ProductSell(o){
|
||||
'transfers' : app.defaults.user_cart,
|
||||
'url_delete' : app.defaults.url_delete_transaction,
|
||||
'url_pay' : app.defaults.url_pay_transaction,
|
||||
'url_pay_all_visible' : app.defaults.url_pay_user_cart,
|
||||
'name_transfers' : 'UserCartPayoutForm[transfers][]',
|
||||
'id_form' : 'frm_user_cart',
|
||||
// 'value_number': app.defaults.value_number,
|
||||
// 'name_number':app.defaults.name_number,
|
||||
});
|
||||
}
|
||||
function createCustomerCartTable(){
|
||||
@@ -496,6 +502,11 @@ function ProductSell(o){
|
||||
'transfers' : app.defaults.customer_cart,
|
||||
'url_delete' : app.defaults.url_delete_transaction,
|
||||
'url_pay' : app.defaults.url_pay_transaction,
|
||||
'url_pay_all_visible' : app.defaults.url_pay_customer_card,
|
||||
'name_transfers' : 'CustomerCartPayoutForm[transfers][]',
|
||||
'id_form' : 'frm_customer_cart',
|
||||
// 'value_number': app.defaults.value_number,
|
||||
// 'name_number':app.defaults.name_number,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -79,8 +79,8 @@ function TicketSell(o){
|
||||
* payout out user or customer cart
|
||||
* */
|
||||
function addPayoutButtons(){
|
||||
addBehaviourPayoutUserCart();
|
||||
addBehaviourPayoutCustomerCart();
|
||||
// addBehaviourPayoutUserCart();
|
||||
// addBehaviourPayoutCustomerCart();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,6 +96,9 @@ function TicketSell(o){
|
||||
'transfers' : app.defaults.user_cart,
|
||||
'url_delete' : app.defaults.url_delete_transaction,
|
||||
'url_pay' : app.defaults.url_pay_transaction,
|
||||
'url_pay_all_visible' : app.defaults.url_pay_user_cart,
|
||||
'name_transfers' : 'UserCartPayoutForm[transfers][]',
|
||||
'id_form' : 'frm_user_cart',
|
||||
});
|
||||
}
|
||||
function createCustomerCartTable(){
|
||||
@@ -103,6 +106,9 @@ function TicketSell(o){
|
||||
'transfers' : app.defaults.customer_cart,
|
||||
'url_delete' : app.defaults.url_delete_transaction,
|
||||
'url_pay' : app.defaults.url_pay_transaction,
|
||||
'url_pay_all_visible' : app.defaults.url_pay_customer_card,
|
||||
'name_transfers' : 'CustomerCartPayoutForm[transfers][]',
|
||||
'id_form' : 'frm_customer_cart',
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ $.widget( "fitness.transferList", {
|
||||
transfers: [],
|
||||
url_delete : '',
|
||||
url_pay : '',
|
||||
url_pay_all_visible: '',
|
||||
name_transfers: '',//name to use for transfer id in form
|
||||
id_form: '',
|
||||
columns: [
|
||||
|
||||
{ 'label' : 'Idő' },
|
||||
@@ -42,6 +45,7 @@ $.widget( "fitness.transferList", {
|
||||
_refresh: function(){
|
||||
var s;
|
||||
s = this._render('table',{ 'columns' : this.options.columns, 'transfers' : this.options.transfers,'footer': this.options.footers });
|
||||
s += this.makeForm();
|
||||
this.element.html(s);
|
||||
},
|
||||
|
||||
@@ -159,7 +163,19 @@ $.widget( "fitness.transferList", {
|
||||
// Fire event
|
||||
// this._triggerOptionChanged(key, prev, value);
|
||||
}
|
||||
}, makeForm: function(){
|
||||
var s;
|
||||
s = "";
|
||||
s += "<form method='post' action='"+ this.options.url_pay_all_visible + "' id='"+this.options.id_form+"'>";
|
||||
// s += "<input type='hidden' name='"+this.options.name_number+"' value='"+this.options.value_number+"'>";
|
||||
for( var i = 0; i < this.options.transfers.length; i++){
|
||||
s += "<input type='hidden' name='"+this.options.name_transfers+"' value='"+this.options.transfers[i].id_transfer+"'>";
|
||||
}
|
||||
s += "</form>";
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user