Ver Mensaje Individual
  #5 (permalink)  
Antiguo 25/04/2014, 04:21
Avatar de josebeguia
josebeguia
 
Fecha de Ingreso: noviembre-2010
Mensajes: 45
Antigüedad: 13 años, 6 meses
Puntos: 1
Respuesta: fallo en programacion carrito compra

Muchas gracias guardarmicorreo por contestarme y enseñarme esto, te pongo el código como me has dicho gracias por tu ayuda





Código PHP:
Ver original
  1. <?php
  2.     $this->load->view("header");
  3. ?>
  4. <script type="text/javascript">
  5. $(document).ready(function(){
  6.     $("#change_password_form").validate({errorElement:"p",errorClass:"Frm_Error_Msg",focusInvalid: false})
  7.    
  8.     ("#order_amount").numeric();
  9.    
  10.     ("#alerts").hide();
  11.    
  12.     if("#alerts_quantity").hide();
  13.    
  14.     $("#order_amount").keyup(function(){
  15.         var order_amount=parseInt($("#order_amount").val());
  16.        
  17.         var option_max_purchase=parseInt($("#option_max_purchase_<?php echo $deal_id?>").val())
  18.         var unit_price=parseInt($("#unit_price_<?php echo $deal_id?>").val())
  19.         var deal_quantity=parseInt($("#deal_quantity_<?php echo $deal_id?>").val())
  20.         var deal_order_amount=parseInt($("#order_amount_<?php echo $deal_id?>").val())
  21.         if($("#order_amount").val()=="")
  22.         {
  23.             order_amount=1;
  24.             $("#order_amount").val(1);
  25.         }
  26.            
  27.         if(order_amount==0 || order_amount=='')
  28.             $("#order_amount").val(1);
  29.         else
  30.         {
  31.             /*if(order_amount>option_max_purchase)
  32.             {
  33.                 $("#order_amount").val(option_max_purchase);
  34.                 order_amount=parseInt($("#order_amount").val());
  35.                 $("#alerts").show();
  36.                 setTimeout('$("#alerts").hide("slow")',3000);
  37.                
  38.                 //delay(800);
  39.                 //setTimeout(50000,"$(\"#alerts\").hide()");
  40.             }
  41.             var total=order_amount*unit_price;
  42.            
  43.             $(".currency_html .integer").html(+total);
  44.             $(".clsMyPrice_Span2").html("$ "+total);
  45.             $("#total_price").val(total);*/
  46.         }
  47.         if(order_amount>deal_quantity)
  48.         {
  49.             $("#order_amount").val(1);
  50.                 order_amount=parseInt($("#order_amount").val());
  51.             $("#alerts_quantity").show();
  52.            
  53.             setTimeout('$("#alerts_quanity").hide("slow")',3000);
  54.                
  55.             var total=order_amount*unit_price;
  56.            
  57.             $(".currency_html .integer").html(+total);
  58.             $(".clsMyPrice_Span2").html("$ "+total);
  59.             $("#total_price").val(total);
  60.         }
  61.         else
  62.         {
  63.     });
  64. })
  65. </script>
  66. <style type="text/css">
  67. .clsLoging_Form
  68. {
  69.     margin-left:20px;
  70. }
  71. </style>
  72. <div class="clsFloatLeft" id="Main_left">
  73.     <div class="inner_pages">
  74.         <h1 class="Main_Tittle"><span><?php echo $title?></span></h1>
  75.          <div class="clsInput_Bg1">
  76.             <div class="inner_content">
  77.                 <div class="clsUr_Purchase_Blk">
  78.                 <div id="alerts">
  79.                     <ul class="alerts info">
  80.                       <li class="info">Cantidad debe ser<?php echo $deal_max_purchase; if($deal_max_purchase>1) echo 'or less';?>; nos ocupamos de eso para usted
  81.                         <div></div>
  82.                         </li>
  83.                      </ul>
  84.                  </div>
  85.                   <div id="alerts_quanity">
  86.                     <ul class="alerts info"><li class="info">Cantidad Menos Así que usted debe comprar<?php echo $deal_quantity; if($deal_quantity>1) echo ' or less';?>
  87.                       <div></div>
  88.                         </li>
  89.                      </ul>
  90.                  </div>
  91.                 <?php
  92.                     $attribute=array("name"=>"paypal_post","id"=>"paypal_post","method"=>"post");
  93.                    
  94.                     echo form_open("home/paypal_checkout",$attribute)
  95.                 ?>
  96.                 <table>
  97.                   <thead>
  98.                     <tr>
  99.                       <th class="grid_9 first">Description</th>
  100.                       <th class="grid_2 text_center"><label for="order_amount">cantidad</label></th>
  101.                       <th class="grid_1 text_center">&nbsp;</th>
  102.                       <th class="grid_2 text_center">Price</th>
  103.                       <th class="grid_1 text_center">&nbsp;</th>
  104.                       <th class="grid_2 last text_right">Total</th>
  105.                     </tr>
  106.                   </thead>
  107.                   <tbody>
  108.                     <tr class="line_item">
  109.                       <td id="gift_options_container" class="grid_9 first">
  110.                             <p>
  111.                                 <input type="hidden" value="<?php echo $deal_id?>" id="deal_id" name="deal_id">
  112.                                
  113.                                 <input type="hidden" value="<?php echo current_url()?>" id="current_pay_url" name="current_pay_url">
  114.                                
  115.                                 <input type="hidden" value="<?php echo $deal_price?>" id="unit_price_<?php echo $deal_id?>">
  116.                                 <input type="hidden" value="<?php echo $deal_max_purchase?>" id="option_max_purchase_<?php echo $deal_id?>">
  117.                                  <input type="hidden" value="<?php echo $deal_quantity?>" id="deal_quantity_<?php echo $deal_id?>">
  118.                                 <?php echo $deal_title?>                                      
  119.                              </p>
  120.                          </td>
  121.                       <td class="grid_2 text_center quantity">
  122.                         <input type="text" value="1" size="3" name="order_amount" maxlength="3" id="order_amount" class="numerical input">
  123.                       </td>
  124.                       <td class="grid_1 text_center">x</td>
  125.                       <td class="grid_2 text_center">
  126.                         <input type="hidden" value="<?php echo $deal_price?>" name="deal_price" id="deal_price">          
  127.                         <span class="deal_price_currency_html">
  128.                         <span class="unit multi_letter">$</span>
  129.                         <span class="integer"><?php echo $deal_price?></span></span>
  130.                       </td>
  131.                       <td class="grid_1 text_center">=</td>
  132.                       <td class="grid_2 text_right total">
  133.                         <span class="currency_html">
  134.                             <span class="unit multi_letter">$</span>
  135.                             <span class="integer"><?php echo $deal_price?></span>
  136.                         </span>
  137.                       </td>
  138.                     </tr>
  139.                     </tbody>
  140.                 </table>
  141.                 <input type="hidden" name="total_price" id="total_price" value="<?php echo $deal_price?>" />
  142.                 <div class="clsMy_Price">
  143.                     <p class="clearfix"><span class="clsMyPrice_Span1">My Price:</span><span class="clsMyPrice_Span2">$ <?php echo $deal_price?></span></p>
  144.                 </div>
  145.                 <br />
  146.                 <input type="submit" name="complete_order" value="Pay Now" id="complete_order" class="Butt_Bg" style="font-size:9px;"/>
  147.                 <?php
  148.                     echo form_close();
  149.                 ?>
  150.                 </div>
  151.             </div>
  152.         </div>
  153.    </div>
  154. </div>
  155. <?php
  156. $this->load->view("right_side_bar");
  157. ?>    
  158. <?php
  159.     $this->load->view("footer");
  160. ?>