Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [CSS][HTML][PHP]SendForm Wysyłanie zawartości koszyka na maila
david8213
post 18.11.2018, 13:01:06
Post #1





Grupa: Zarejestrowani
Postów: 308
Pomógł: 0
Dołączył: 9.12.2009

Ostrzeżenie: (10%)
X----


Prosty sklep internetowy
Jak wysłać zawartość koszyka na maila. Proszę o pomoc. Aktualnie jest zrobiona płatność


  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title>Mały sklep internetowy</title>
  8.  
  9. <!-- Bootstrap -->
  10. <link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
  11.  
  12. <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  13. <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  14. <!--[if lt IE 9]>
  15. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  16. <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  17. <![endif]-->
  18. ..............................
  19.  
  20. <!-- Collect the nav links, forms, and other content for toggling -->
  21. <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
  22. <ul class="nav navbar-nav navbar-right">
  23. <li class="koszyk"><a href="#" data-toggle="modal" data-target="#myModal">Koszyk (<span class="simpleCart_quantity"></span>)
  24.  
  25. </a></li>
  26. </ul>
  27. </div><!-- /.navbar-collapse -->
  28. </div><!-- /.container-fluid -->
  29. </nav>
  30.  
  31.  
  32. .
  33.  
  34. <p>&nbsp;</p>
  35. </div><!-- /col-sm-12 -->
  36. </div><!-- /row -->
  37. </div><!-- /container -->
  38.  
  39. <!-- Modal -->
  40. <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  41. <div class="modal-dialog">
  42. <div class="modal-content">
  43.  
  44. <div class="modal-header">
  45. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  46. <h4 class="modal-title" id="myModalLabel">Koszyk <span class="showIfEmpty">jest pusty</span></h4>
  47. </div>
  48.  
  49. <div class="hideIfEmpty">
  50.  
  51. <div class="modal-body">
  52. <div class="simpleCart_items"></div>
  53. <table class="table table-striped">
  54. <thead>
  55. <tr>
  56. <th>Łącznie</th>
  57. <th>Koszty przesyłki</th>
  58. <th>Do zapłaty</th>
  59. </tr>
  60. </thead>
  61. <tbody>
  62. <tr>
  63. <td><div class="simpleCart_total"></div></td>
  64. <td><div class="simpleCart_shipping"></div></td>
  65. <td><div class="simpleCart_grandTotal"></div></td>
  66. </tr>
  67. </tbody>
  68. </table>
  69. </div><!-- /modal-body -->
  70.  
  71. <div class="modal-footer">
  72. <!-- button to empty the cart -->
  73. <a href="java script:;" class="simpleCart_empty btn btn-default">Opróżnij koszyk</a>
  74. <!-- create a checkout button -->
  75. <a href="java script:;" class="simpleCart_checkout btn btn-primary">Złóż zamówienie</a>
  76. </div><!-- /modal-footer -->
  77.  
  78. </div><!-- /hideIfEmpty -->
  79. </div><!-- /modal-content -->
  80. </div><!-- /modal-dialog -->
  81. </div><!-- /modal -->
  82.  
  83. <div id="Container" class="container">
  84. <div class="row">
  85.  
  86.  
  87.  
  88. <div class="col-md-4 text-center mix HP" data-price="150">
  89. <div class="simpleCart_shelfItem">
  90. <div class="row">
  91. <div class="col-xs-12">
  92. <h2 class="item_name">HP Ipaq 211</h2>
  93. <img class="item_thumb" src="img/HP_Ipaq_211.png" alt="">
  94. </div>
  95. </div><!-- /row -->
  96. <div class="row">
  97. <div class="col-xs-12">
  98. <h2 class="item_price">150 zł</h2>
  99. </div>
  100. </div><!-- /row -->
  101. <div class="row">
  102. <div class="col-xs-4">
  103.  
  104. </div>
  105. <div class="col-xs-3">
  106. <input type="text" value="1" class="item_Quantity form-control" placeholder="ilość">
  107. </div>
  108. <div class="col-xs-5">
  109. <input type="button" class="item_add btn btn-primary" value="Do koszyka">
  110. </div>
  111. </div><!-- /row -->
  112. </div><!-- /simpleCart_shelfItem -->
  113. </div><!-- /col-md-4 -->
  114.  
  115. <div class="col-md-4 text-center mix HTC" data-price="335.99">
  116. <div class="simpleCart_shelfItem">
  117. <div class="row">
  118. <div class="col-xs-12">
  119. <h2 class="item_name">HTC Apache</h2>
  120. <img class="item_thumb" src="img/HTC_Apache.png" alt="">
  121. </div>
  122. </div><!-- /row -->
  123. <div class="row">
  124. <div class="col-xs-12">
  125. <h2 class="item_price">335.99 zł</h2>
  126. </div>
  127. </div><!-- /row -->
  128. <div class="row">
  129. <div class="col-xs-4">
  130.  
  131. </div>
  132. <div class="col-xs-3">
  133. <input type="text" value="1" class="item_Quantity form-control" placeholder="ilość">
  134. </div>
  135. <div class="col-xs-5">
  136. <input type="button" class="item_add btn btn-primary" value="Do koszyka">
  137. </div>
  138. </div><!-- /row -->
  139. </div><!-- /simpleCart_shelfItem -->
  140. </div><!-- /col-md-4 -->
  141.  
  142. <div class="col-md-4 text-center mix HTC" data-price="399">
  143. <div class="simpleCart_shelfItem">
  144. <div class="row">
  145. <div class="col-xs-12">
  146. <h2 class="item_name">HTC Trinity</h2>
  147. <img class="item_thumb" src="img/HTC_Trinity.png" alt="">
  148. </div>
  149. </div><!-- /row -->
  150. <div class="row">
  151. <div class="col-xs-12">
  152. <h2 class="item_price">399 zł</h2>
  153. </div>
  154. </div><!-- /row -->
  155.  
  156. <div class="row">
  157. <div class="col-xs-4">
  158.  
  159. </div>
  160. <div class="col-xs-3">
  161. <input type="text" value="1" class="item_Quantity form-control" placeholder="ilość">
  162. </div>
  163. <div class="col-xs-5">
  164. <input type="button" class="item_add btn btn-primary" value="Do koszyka">
  165. </div>
  166. </div><!-- /row -->
  167. </div><!-- /simpleCart_shelfItem -->
  168. </div><!-- /col-md-4 -->
  169.  
  170. </div><!-- /row -->
  171. </div><!-- /container -->
  172.  
  173. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  174. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  175. <!-- Include all compiled plugins (below), or include individual files as needed -->
  176. <script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
  177.  
  178. <script src="js/simpleCart.js"></script>
  179. <script src="http://cdn.jsdelivr.net/jquery.mixitup/latest/jquery.mixitup.min.js?v=2.1.2"></script>
  180. <script>
  181. simpleCart({
  182. // array representing the format and columns of the cart,
  183. // see the cart columns documentation
  184. cartColumns: [
  185. { attr: "name", label: "Produkt"},
  186. { view:'image' , attr:'thumb', label: false},
  187. { view: "currency", attr: "price", label: "Cena"},
  188. { view: "decrement", label: false, text: '<span class="glyphicon glyphicon-minus"></span>'},
  189. { attr: "quantity", label: "Ilość"},
  190. { view: "increment", label: false, text: '<span class="glyphicon glyphicon-plus"></span>'},
  191. { view: "currency", attr: "total", label: "Razem" },
  192. { view: "remove", text: '<span class="glyphicon glyphicon-remove"></span>', label: false}
  193. ],
  194.  
  195. // "div" or "table" - builds the cart as a
  196. // table or collection of divs
  197. cartStyle: "table",
  198.  
  199. // how simpleCart should checkout, see the
  200. // checkout reference for more info
  201. checkout: {
  202. type: "PayPal" ,
  203. email: "mail@mail.com"
  204. },
  205.  
  206. // set the currency, see the currency
  207. // reference for more info
  208. currency: "PLN",
  209.  
  210. // collection of arbitrary data you may want to store
  211. // with the cart, such as customer info
  212. data: {},
  213.  
  214. // set the cart langauge
  215. // (may be used for checkout)
  216. language: "english-us",
  217.  
  218. // array of item fields that will not be
  219. // sent to checkout
  220. excludeFromCheckout: [],
  221.  
  222. // custom function to add shipping cost
  223. shippingCustom: null,
  224.  
  225. // flat rate shipping option
  226. shippingFlatRate: 100,
  227.  
  228. // added shipping based on this value
  229. // multiplied by the cart quantity
  230. shippingQuantityRate: 0,
  231.  
  232. // added shipping based on this value
  233. // multiplied by the cart subtotal
  234. shippingTotalRate: 0,
  235.  
  236. // tax rate applied to cart subtotal
  237. taxRate: 0,
  238.  
  239. // true if tax should be applied to shipping
  240. taxShipping: false,
  241.  
  242. // event callbacks
  243. beforeAdd : null,
  244. afterAdd : null,
  245. load : null,
  246. beforeSave : null,
  247. afterSave : null,
  248. update : null,
  249. ready : null,
  250. checkoutSuccess : null,
  251. checkoutFail : null,
  252. beforeCheckout : null,
  253. beforeRemove : null
  254. });
  255.  
  256. // basic callback example
  257. simpleCart.bind( "afterAdd" , function(){
  258. $( ".koszyk" ).fadeOut(500).fadeIn(500);
  259. });
  260.  
  261. simpleCart.bind( 'update' , function(){
  262. if (simpleCart.quantity() == 0)
  263. {
  264. $( ".hideIfEmpty" ).hide();
  265. $( ".showIfEmpty" ).show();
  266. }
  267. else
  268. {
  269. $( ".hideIfEmpty" ).show();
  270. $( ".showIfEmpty" ).hide();
  271. }
  272. });
  273.  
  274. $(function(){
  275. $('#Container').mixItUp();
  276. });
  277. </script>
  278.  
  279. </body>
  280. </html>


Coś takiego trzeba zrobić: ?

  1. <form method="post" action="zapisz.php"><br />
  2. Pole1:<br />
  3. <input type="text" maxlength="20" name="simpleCart_total" /><br />
  4. Pole2:<br />
  5. <input type="text" maxlength="20" name="simpleCart_shipping" /><br />
  6. Pole3:<br />
  7. <input type="text" maxlength="20" name="simpleCart_grandTotal" /><br />
  8.  
  9. <input type="submit" value="Wyslij" />&nbsp;<input type="reset" value="Wyczysc" /></form>
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16. <?php
  17. $simpleCart_total=$_POST['simpleCart_total'];
  18. $simpleCart_shipping=$_POST['simpleCart_shipping'];
  19. $simpleCart_grandTotal=$_POST['simpleCart_grandTotal'];
  20.  
  21. .................
  22. ?>


Ten post edytował david8213 18.11.2018, 13:20:05
Go to the top of the page
+Quote Post
viking
post 18.11.2018, 15:17:44
Post #2





Grupa: Zarejestrowani
Postów: 6 365
Pomógł: 1114
Dołączył: 30.08.2006

Ostrzeżenie: (0%)
-----


https://github.com/PHPMailer/PHPMailer


--------------------
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 23.04.2024 - 23:22