Advertisement
Guest User

Simpla shop, adding new field

a guest
Jul 28th, 2014
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.77 KB | None | 0 0
  1. diff --git a/api/Orders.php b/api/Orders.php
  2. index 3165115..97442ea 100755
  3. --- a/api/Orders.php
  4. +++ b/api/Orders.php
  5. @@ -24,7 +24,7 @@ class Orders extends Simpla
  6.         $query = $this->db->placehold("SELECT  o.id, o.delivery_id, o.delivery_price, o.separate_delivery,
  7.                                         o.payment_method_id, o.paid, o.payment_date, o.closed, o.discount, o.coupon_code, o.coupon_discount,
  8.                                         o.date, o.user_id, o.name, o.address, o.phone, o.email, o.comment, o.status,
  9. -                                       o.url, o.total_price, o.note
  10. +                                       o.url, o.total_price, o.note, o.pallada_id
  11.                                         FROM __orders o $where LIMIT 1");
  12.  
  13.         if($this->db->query($query))
  14. diff --git "a/design/\320\241\320\270\320\274\321\204\320\276\320\275\320\270\321\217/html/cart.tpl" "b/design/\320\241\320\270\320\274\321\204\320\276\320\275\320\270\321\217/html/cart.tpl"
  15. index 2628989..dde41f2 100644
  16. --- "a/design/\320\241\320\270\320\274\321\204\320\276\320\275\320\270\321\217/html/cart.tpl"
  17. +++ "b/design/\320+41\320+70\320+74\321+04\320+76\320+75\320+70\321+17/html/cart.tpl"
  18. @@ -222,6 +222,9 @@ $("input[name='coupon_code']").keypress(function(event){
  19.     <label>Адрес доставки</label>
  20.     <input name="address" type="text" value="{$address|escape}"/>
  21.  
  22. +   <label>Pallada ID<br/><span style="font-size:80%">(только для участников объединения потребителей "Паллада")</span></label>
  23. +   <input name="pallada_id" type="text" value="{$pallada_id|escape}" />
  24. +
  25.     <label>Комментарий к&nbsp;заказу</label>
  26.     <textarea name="comment" id="order_comment">{$comment|escape}</textarea>
  27.    
  28. diff --git "a/design/\320\241\320\270\320\274\321\204\320\276\320\275\320\270\321\217/html/email_order.tpl" "b/design/\320\241\320\270\320\274\321\204\320\276\320\275\320\270\321\217/html/email_order.tpl"
  29. index 055f14d..52d1ff1 100644
  30. --- "a/design/\320\241\320\270\320\274\321\204\320\276\320\275\320\270\321\217/html/email_order.tpl"
  31. +++ "b/design/\320+41\320+70\320+74\321+04\320+76\320+75\320+70\321+17/html/email_order.tpl"
  32. @@ -64,6 +64,16 @@
  33.         </td>
  34.     </tr>
  35.     {/if}
  36. +   {if $order->pallada_id}
  37. +   <tr>
  38. +       <td style="padding:6px; background-color:#f0f0f0; border:1px solid #e0e0e0;font-family:arial;">
  39. +           Pallada ID
  40. +       </td>
  41. +       <td style="padding:6px; background-color:#ffffff; border:1px solid #e0e0e0;font-family:arial;">
  42. +           {$order->pallada_id|escape}
  43. +       </td>
  44. +   </tr>
  45. +   {/if}
  46.     {if $order->address}
  47.     <tr>
  48.         <td style="padding:6px; background-color:#f0f0f0; border:1px solid #e0e0e0;font-family:arial;">
  49. diff --git "a/design/\320\241\320\270\320\274\321\204\320\276\320\275\320\270\321\217/html/order.tpl" "b/design/\320\241\320\270\320\274\321\204\320\276\320\275\320\270\321\217/html/order.tpl"
  50. index c2c7a68..cd52c57 100644
  51. --- "a/design/\320\241\320\270\320\274\321\204\320\276\320\275\320\270\321\217/html/order.tpl"
  52. +++ "b/design/\320+41\320+70\320+74\321+04\320+76\320+75\320+70\321+17/html/order.tpl"
  53. @@ -149,6 +149,16 @@
  54.         </td>
  55.     </tr>
  56.     {/if}
  57. +   {if $order->pallada_id}
  58. +   <tr>
  59. +       <td>
  60. +           Pallada ID
  61. +       </td>
  62. +       <td>
  63. +           {$order->pallada_id|escape}
  64. +       </td>
  65. +   </tr>
  66. +   {/if}
  67.     {if $order->address}
  68.     <tr>
  69.         <td>
  70. diff --git a/simpla/OrderAdmin.php b/simpla/OrderAdmin.php
  71. index f7130b4..4602fef 100755
  72. --- a/simpla/OrderAdmin.php
  73. +++ b/simpla/OrderAdmin.php
  74. @@ -15,6 +15,7 @@ class OrderAdmin extends Simpla
  75.             $order->name = $this->request->post('name');
  76.             $order->email = $this->request->post('email');
  77.             $order->phone = $this->request->post('phone');
  78. +           $order->pallada_id = $this->request->post('pallada_id');
  79.             $order->address = $this->request->post('address');
  80.             $order->comment = $this->request->post('comment');
  81.             $order->note = $this->request->post('note');
  82. diff --git a/simpla/design/html/email_order_admin.tpl b/simpla/design/html/email_order_admin.tpl
  83. index 4e6dc45..bae56c5 100755
  84. --- a/simpla/design/html/email_order_admin.tpl
  85. +++ b/simpla/design/html/email_order_admin.tpl
  86. @@ -67,6 +67,16 @@
  87.         </td>
  88.     </tr>
  89.     {/if}
  90. +   {if $order->pallada_id}
  91. +   <tr>
  92. +       <td style="padding:6px; background-color:#f0f0f0; border:1px solid #e0e0e0;font-family:arial;">
  93. +           Pallada ID
  94. +       </td>
  95. +       <td style="padding:6px; background-color:#ffffff; border:1px solid #e0e0e0;font-family:arial;">
  96. +           {$order->pallada_id|escape}
  97. +       </td>
  98. +   </tr>
  99. +   {/if}
  100.     {if $order->address}
  101.     <tr>
  102.         <td style="padding:6px; background-color:#f0f0f0; border:1px solid #e0e0e0;font-family:arial;">
  103. diff --git a/simpla/design/html/order.tpl b/simpla/design/html/order.tpl
  104. index 5e33608..6021976 100755
  105. --- a/simpla/design/html/order.tpl
  106. +++ b/simpla/design/html/order.tpl
  107. @@ -112,6 +112,16 @@
  108.             </div>
  109.         </li>
  110.         <li>
  111. +           <label class=property>Pallada ID</label>
  112. +           <div class="edit_order_detail" style='display:none;'>
  113. +               <input name="pallada_id" class="simpla_inp " type="text" value="{$order->pallada_id|escape}" />
  114. +           </div>
  115. +           <div class="view_order_detail">
  116. +               {if $order->pallada_id}
  117. +               <span class="ip_call" data-pallada_id="{$order->pallada_id|escape}" target="_blank">{$order->pallada_id|escape}</span>{else}{$order->pallada_id|escape}{/if}
  118. +           </div>
  119. +       </li>
  120. +       <li>
  121.             <label class=property>Адрес <a href='http://maps.yandex.ru/' id=address_link target=_blank><img align=absmiddle src='design/images/map.png' alt='Карта в новом окне' title='Карта в новом окне'></a></label>
  122.             <div class="edit_order_detail" style='display:none;'>
  123.                 <textarea name="address">{$order->address|escape}</textarea>
  124. diff --git a/view/CartView.php b/view/CartView.php
  125. index 18cde37..e5c887d 100755
  126. --- a/view/CartView.php
  127. +++ b/view/CartView.php
  128. @@ -48,6 +48,7 @@ class CartView extends View
  129.         $order->email       = $this->request->post('email');
  130.         $order->address     = $this->request->post('address');
  131.         $order->phone       = $this->request->post('phone');
  132. +       $order->pallada_id  = $this->request->post('pallada_id');
  133.         $order->comment     = $this->request->post('comment');
  134.         $order->ip          = $_SERVER['REMOTE_ADDR'];
  135.        
  136. @@ -55,6 +56,7 @@ class CartView extends View
  137.         $this->design->assign('name', $order->name);
  138.         $this->design->assign('email', $order->email);
  139.         $this->design->assign('phone', $order->phone);
  140. +       $this->design->assign('pallada_id', $order->pallada_id);
  141.         $this->design->assign('address', $order->address);
  142.  
  143.         $captcha_code =  $this->request->post('captcha_code', 'string');
  144. @@ -179,6 +181,7 @@ class CartView extends View
  145.                 $this->design->assign('name', $last_order->name);
  146.                 $this->design->assign('email', $last_order->email);
  147.                 $this->design->assign('phone', $last_order->phone);
  148. +               $this->design->assign('pallada_id', $last_order->pallada_id);
  149.                 $this->design->assign('address', $last_order->address);
  150.             }
  151.             else
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement