Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.66 KB | None | 0 0
  1. for(var i=1; i <= rowCount-1; i++)
  2. {
  3. product[i-1] = [{
  4. 'product_id' : $('#product_id' + i).val(),
  5. 'name' : $('#item' + i).val(),
  6. 'model' : $('#model' + i).val(),
  7. 'reward' : $('#reward' +i).val(),
  8. 'subtract' : $('#subtract' + i).val(),
  9. 'minimum' : $('#minimum' + i).val(),
  10. 'shipping' : $('#shipping' + i).val(),
  11. 'tax_class_id' : $('#tax_class_id' + i).val(),
  12. 'weight' : $('#weight' + i).val(),
  13. 'quantity' : $('table.order-table tbody tr td.quantity input[name='quantity'+ i +'']').val(),
  14. 'price' : $('table.order-table tbody tr[id=''+ i +'']').find('td.price').html(),
  15. 'total' : $('table.order-table tbody tr td.quantity input[name='quantity'+ i +'']').parent().parent().find('td.total').html()
  16. }];
  17. }
  18.  
  19. product[0][0][minimum]
  20. product[0][0][model] 326
  21. product[0][0][name] apple mac power
  22. product[0][0][price] 100.0000
  23. product[0][0][product_id] 50
  24. product[0][0][quantity] 5
  25. product[0][0][reward] 0
  26. product[0][0][shipping] 1
  27. product[0][0][subtract] 1
  28. product[0][0][tax_class_i... 0
  29. product[0][0][total] 500
  30. product[0][0][weight] 0.00000000
  31. product[1][0][minimum]
  32. product[1][0][model] 326
  33. product[1][0][name] apple mac power
  34. product[1][0][price] 100.0000
  35. product[1][0][product_id] 50
  36. product[1][0][quantity] 7
  37. product[1][0][reward] 0
  38. product[1][0][shipping] 1
  39. product[1][0][subtract] 1
  40. product[1][0][tax_class_i... 0
  41. product[1][0][total] 700
  42.  
  43. product[0][name] = "apple mac power"
  44.  
  45. for(var i=1; i <= rowCount-1; i++)
  46. {
  47. product = [{
  48. 'product_id' : $('#product_id' + i).val(),
  49. 'name' : $('#item' + i).val(),
  50. 'model' : $('#model' + i).val(),
  51. 'reward' : $('#reward' +i).val(),
  52. 'subtract' : $('#subtract' + i).val(),
  53. 'minimum' : $('#minimum' + i).val(),
  54. 'shipping' : $('#shipping' + i).val(),
  55. 'tax_class_id' : $('#tax_class_id' + i).val(),
  56. 'weight' : $('#weight' + i).val(),
  57. 'quantity' : $('table.order-table tbody tr td.quantity input[name='quantity'+ i +'']').val(),
  58. 'price' : $('table.order-table tbody tr[id=''+ i +'']').find('td.price').html(),
  59. 'total' : $('table.order-table tbody tr td.quantity input[name='quantity'+ i +'']').parent().parent().find('td.total').html()
  60. }];
  61. }
  62.  
  63. product[0][minimum]
  64. product[0][model] 326
  65. product[0][name] apple mac power
  66. product[0][price] 100.0000
  67. product[0][product_id] 50
  68. product[0][quantity] 7
  69. product[0][reward] 0
  70. product[0][shipping] 1
  71. product[0][subtract] 1
  72. product[0][tax_class_i... 0
  73. product[0][total] 700
  74.  
  75. for(var i=1; i <= rowCount-1; i++)
  76. {
  77. product[i-1] = {
  78. 'product_id' : $('#product_id' + i).val(),
  79. 'name' : $('#item' + i).val(),
  80. 'model' : $('#model' + i).val(),
  81. 'reward' : $('#reward' +i).val(),
  82. 'subtract' : $('#subtract' + i).val(),
  83. 'minimum' : $('#minimum' + i).val(),
  84. 'shipping' : $('#shipping' + i).val(),
  85. 'tax_class_id' : $('#tax_class_id' + i).val(),
  86. 'weight' : $('#weight' + i).val(),
  87. 'quantity' : $('table.order-table tbody tr td.quantity input[name='quantity'+ i +'']').val(),
  88. 'price' : $('table.order-table tbody tr[id=''+ i +'']').find('td.price').html(),
  89. 'total' : $('table.order-table tbody tr td.quantity input[name='quantity'+ i +'']').parent().parent().find('td.total').html()
  90. };
  91. }
  92.  
  93. for(var i=1; i <= rowCount-1; i++)
  94. {
  95. product.push({
  96. 'product_id' : $('#product_id' + i).val(),
  97. 'name' : $('#item' + i).val(),
  98. 'model' : $('#model' + i).val(),
  99. 'reward' : $('#reward' +i).val(),
  100. 'subtract' : $('#subtract' + i).val(),
  101. 'minimum' : $('#minimum' + i).val(),
  102. 'shipping' : $('#shipping' + i).val(),
  103. 'tax_class_id' : $('#tax_class_id' + i).val(),
  104. 'weight' : $('#weight' + i).val(),
  105. 'quantity' : $('table.order-table tbody tr td.quantity input[name='quantity'+ i +'']').val(),
  106. 'price' : $('table.order-table tbody tr[id=''+ i +'']').find('td.price').html(),
  107. 'total' : $('table.order-table tbody tr td.quantity input[name='quantity'+ i +'']').parent().parent().find('td.total').html()
  108. });
  109. }
  110.  
  111. for(var i=1; i <= rowCount-1; i++)
  112. {
  113. product[i-1] = { // Removed array open
  114. 'product_id' : $('#product_id' + i).val(),
  115. 'name' : $('#item' + i).val(),
  116. 'model' : $('#model' + i).val(),
  117. 'reward' : $('#reward' +i).val(),
  118. 'subtract' : $('#subtract' + i).val(),
  119. 'minimum' : $('#minimum' + i).val(),
  120. 'shipping' : $('#shipping' + i).val(),
  121. 'tax_class_id' : $('#tax_class_id' + i).val(),
  122. 'weight' : $('#weight' + i).val(),
  123. 'quantity' : $('table.order-table tbody tr td.quantity input[name='quantity'+ i +'']').val(),
  124. 'price' : $('table.order-table tbody tr[id=''+ i +'']').find('td.price').html(),
  125. 'total' : $('table.order-table tbody tr td.quantity input[name='quantity'+ i +'']').parent().parent().find('td.total').html()
  126. }; // Removed array close
  127. }
  128.  
  129. product[0]['name'] = "apple mac power"
  130.  
  131. product[0].name = "apple mac power"
  132.  
  133. product[0][name] = "apple mac power"
  134.  
  135. product[i-1] = {
  136. 'product_id' : $('#product_id' + i).val(),
  137. 'name' : $('#item' + i).val(),
  138. 'model' : $('#model' + i).val(),
  139. 'reward' : $('#reward' +i).val(),
  140. 'subtract' : $('#subtract' + i).val(),
  141. 'minimum' : $('#minimum' + i).val(),
  142. 'shipping' : $('#shipping' + i).val(),
  143. 'tax_class_id' : $('#tax_class_id' + i).val(),
  144. 'weight' : $('#weight' + i).val(),
  145. 'quantity' : $('table.order-table tbody tr td.quantity input[name='quantity'+ i +'']').val(),
  146. 'price' : $('table.order-table tbody tr[id=''+ i +'']').find('td.price').html(),
  147. 'total' : $('table.order-table tbody tr td.quantity input[name='quantity'+ i +'']').parent().parent().find('td.total').html()
  148. };
  149.  
  150. product[i-1] = [{
  151. 'product_id' : $('#product_id' + i).val(),
  152. 'name' : $('#item' + i).val(),
  153. 'model' : $('#model' + i).val(),
  154. 'reward' : $('#reward' +i).val(),
  155. 'subtract' : $('#subtract' + i).val(),
  156. 'minimum' : $('#minimum' + i).val(),
  157. 'shipping' : $('#shipping' + i).val(),
  158. 'tax_class_id' : $('#tax_class_id' + i).val(),
  159. 'weight' : $('#weight' + i).val(),
  160. 'quantity' : $('table.order-table tbody tr td.quantity input[name='quantity'+ i +'']').val(),
  161. 'price' : $('table.order-table tbody tr[id=''+ i +'']').find('td.price').html(),
  162. 'total' : $('table.order-table tbody tr td.quantity input[name='quantity'+ i +'']').parent().parent().find('td.total').html()
  163. }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement