.padding.center#my_cart
  .order_recap
    %h1= "Validation de votre commande"
    %br
    -@recap = true
    %table.table
      =render @product_order.product_order_products.order(:product_id)
    
      
   
      %tr
        %td{:colspan => 3, :style => "border:0;"}
        %td
          %strong Total HT:
        %td.boutique-right
          %strong
            = number_to_currency(@product_order.total_ht, locale: :fr)
      %tr
        %td{:colspan => 3, :style => "border:0;"}
        %td
          %strong TVA:
        %td.boutique-right
          %strong
            = number_to_currency(@product_order.total_tva, locale: :fr)
            
            
      %tr
        %td{:colspan => 3, :style => "border:0;"}
        %td
          %strong Total TTC:
        %td.boutique-right
          %strong
            = number_to_currency(@product_order.total_ttc, locale: :fr)
        
      
        
        
        
  
    .clear


  = semantic_form_for [:public,@product_order], :url => select_payment_save_public_product_orders_path(), :html => { :method => :post, :onchange =>"cb_infos();"}do |f| 

    =f.hidden_field :force_payment
      
  
    %h3 Paiement
  
  
    -if params[:paid_fail]
      %p= "Votre tentative de paiement par carte bancaire a échouée, ou vous avez annulé votre paiement, merci de bien vouloir essayer de nouveau ou changer de mode de paiement."
    
      %br
  


    =f.input :product_order_payment_type_ok_id, :label => false, :collection => [["Chèque",1], ["Virement",2],["Carte bancaire",3],["Mandat administratif",4]], :as => :radio, :include_blank => false #["Pré-commande",10]


    .cb_infos
      = "Vous serez redirigé vers la page de paiement sécurisé."
    %br
    
    =f.input :cgv, :label => raw("J'accepte <a href='/mentions-legales.html' target='_blank'>les conditions générales de vente</a>.")
    .actions
      %center
        =f.submit  "Valider ma commande", :class => "btn btn-primary order_button"
    
    %br
    %br
    


    :coffeescript
      @cb_infos = ->
        if $('#product_order_product_order_payment_type_ok_id_3').is(':checked')
          $(".cb_infos").show()
        else
          $(".cb_infos").hide()
    :javascript
      cb_infos();