<%= t('plugin.ecommerce.details_order') %>: <%= @order.slug %>

<%= link_to raw(" #{t('plugin.ecommerce.edit_order')}"), {action: :edit, id: @order.slug}, class: "btn btn-primary pull-right" %>

<%= t('plugin.ecommerce.table.customer_info') %>

  • <%= t('plugin.ecommerce.table.name') %>: <%= @order.details.customer %>
  • <%= t('plugin.ecommerce.table.email') %>: <%= @order.details.email %>
  • <%= t('plugin.ecommerce.table.phone') %>: <%= @order.details.phone %>

<%= t('plugin.ecommerce.billing_address') %>

<% detail = @order.get_meta("billing_address") %>
  • <%= t('plugin.ecommerce.table.name') %>: <%= detail[:first_name] %> <%= detail[:last_name] %>
  • <%= t('plugin.ecommerce.table.address') %>: <%= detail[:address1] %>
    <%= detail[:address2] %>
    <%= detail[:city] %>
    <%= detail[:state] %>
    <%= detail[:zip] %>
    <%= detail[:country] %>

<%= t('plugin.ecommerce.shipping_address') %>

<% detail = @order.get_meta("shipping_address") %>
  • <%= t('plugin.ecommerce.table.name') %>: <%= detail[:first_name] %> <%= detail[:last_name] %>
  • <%= t('plugin.ecommerce.table.address') %>: <%= detail[:address1] %>
    <%= detail[:address2] %>
    <%= detail[:city] %>
    <%= detail[:state] %>
    <%= detail[:zip] %>
    <%= detail[:country] %>
    <% approved_accepted = @order.paid? approved_shipped = false %>
  • <%= t('plugin.ecommerce.order_received') %>
    <%= raw @order.the_pay_status %>

    on <%= @order.details.received_at %>

  • <% if approved_accepted %>
  • <% if @order.details.accepted_at.present? approved_shipped = true %>

    <%= t('plugin.ecommerce.order_accepted') %>

    on <%= @order.details.accepted_at %>

    <% else %> <%= form_tag(admin_plugins_ecommerce_order_accepted_path(order_id: @order.slug), :method => "post", :class => "form") do %> <% end %> <% end %>
  • <% end %> <% if approved_shipped %>
  • <% if @order.details.shipped_at.present? %>

    <%= t('plugin.ecommerce.order_shipped') %>

    on <%= @order.details.shipped_at %>

    <%= t('plugin.ecommerce.url_tracking') %>

    <% else %> <%= form_tag(admin_plugins_ecommerce_order_shipped_path(order_id: @order.slug), :method => "post", :class => "form") do %>
    <% end %> <% end %>
  • <% end %>

<%= t('plugin.ecommerce.table.products') %>

<%= render partial: 'plugins/ecommerce/partials/table_order_products', locals: {order: @order} %>

<%= t('plugin.ecommerce.method_shipped') %>

<%= t('plugin.ecommerce.order_shipped') %> <%= t('plugin.ecommerce.shipped_date') %> <%= t('plugin.ecommerce.table.url_tracking') %>
<%= @order.shipping_method.name rescue "#{t('plugin.ecommerce.message.not_shipped_assigned')}" %> <%= @order.details.shipped_at || "#{t('plugin.ecommerce.message.not_shipped')}" %> <%= @order.the_url_tracking %>
<%#= debug payment %>

<%= t('plugin.ecommerce.payments') %>

<% payment = @order.get_meta("payment") details = @order.get_meta("pay_#{payment[:type]}".to_sym) %>
<%= t('plugin.ecommerce.table.method') %> <%= t('plugin.ecommerce.table.amount') %> <%= t('plugin.ecommerce.table.details') %>
<%= @order.payment_method.name rescue "" %> <%= current_site.current_unit %> <%= payment[:amount] %> <%= raw details.present? ? details.map { |key, value| "#{key}: #{value}" }.join("
") : "#{t('plugin.ecommerce.table.not_paid')}" %>
<%= t('plugin.ecommerce.table.total') %> <%= current_site.current_unit %> <%= payment[:amount] %>
<%#= debug payment %>
<%#= debug @order.meta %> <% unless @order.closed? %>
<%= link_to raw(' Close order'), admin_plugins_ecommerce_order_closed_path(order_id: @order.slug), method: :post, data: {confirm: t('plugin.ecommerce.message.modal_close_order')}, class: "btn btn-danger cama_ajax_request", title: "#{t('plugin.ecommerce.buttons.close_order')}" unless @order.closed? %>
<% end %>