0

以前可以工作,但在最新更新时,结帐付款信息表单在应显示信用卡字段和贝宝选项时不显示任何信息。

在此处输入图像描述

在管理面板中,我包含了所有 Spree 和 Paypal 快递信息。我为结帐编辑表单使用自定义视图文件(见下文)。

我在错误日志中找不到任何问题。

更新:javascript错误如下:

在此处输入图像描述

宝石文件

source 'https://rubygems.org'
#ruby=ruby-2.1.0

ruby '2.1.0'
gem 'rails', '4.0.5'

group :development, :test do
    gem 'sqlite3'
  gem 'better_errors'
  gem 'binding_of_caller'
end


# Use sqlite3 as the database for Active Record
# gem 'pg'
# gem 'mysql'
  gem 'mysql'
gem "font-awesome-rails"
gem 'money', '5.1.1'
gem 'sass-rails', '4.0.3'
gem 'bootstrap-sass', '3.1.1.0'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.1.0'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
gem 'aws-sdk'
gem 'highline', '1.6.21'
gem 'paperclip'
gem 'fog'
gem 'deface'

group :doc do
  gem 'sdoc', '0.3.20', require: false
end

group :production do
  gem 'unicorn'
  gem 'unicorn-worker-killer'
  gem 'rails_12factor', '0.0.2'
end

gem 'spree', github: 'spree/spree', branch: '2-2-stable'
gem 'spree_gateway', :git => 'https://github.com/spree/spree_gateway.git', :branch => '2-2-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-2-stable'
gem 'spree_paypal_express', :github => "radar/better_spree_paypal_express", :branch => "2-2-stable"
gem 'spree_static_content', github: 'spree/spree_static_content', branch: '2-2-stable'
gem 'spree_i18n', github: 'spree/spree_i18n', branch: '2-2-stable'
gem 'spree_active_shipping', :git => "git://github.com/spree/spree_active_shipping", :branch => "2-2-stable"
gem 'spree_contact_us', :git => 'https://github.com/jdutil/spree_contact_us', :branch => '2-2-stable'
gem 'spree_chimpy', github: 'DynamoMTL/spree_chimpy'

app/views/spree/checkout/edit.html.erb

<script>
$(document).ready(function () {
  $('.payment-options label:nth-child(1)').on('click', function () {
      $('#payment-methods li:nth-child(1)').show();
      $('#payment-methods li:nth-child(2)').hide();
  });
  $('.payment-options li:nth-child(2) label').on('click', function () {
    $('#payment-methods li:nth-child(1)').hide();
    $('#payment-methods li:nth-child(2)').show();
  });
  $('.payment-options li:nth-child(2) label').click();
  $('#payment-methods li:nth-child(2)').show();

$('#use_existing_card_yes').on('click', function () {
    $("div[data-hook='checkout_payment_step']").hide();
      $("table[data-hook='existing_cards']").show();
});
$('#use_existing_card_no').on('click', function () {
    $("div[data-hook='checkout_payment_step']").show();
    $("table[data-hook='existing_cards']").hide();
});
  $('#use_existing_card_yes').click();
  $("div[data-hook='checkout_payment_step']").hide();


  });

</script>
<div id="checkout" data-hook>
  <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @order } %>

  <div class="row" data-hook="checkout_header">
    <div class="checkout-header" class="col-sm-3">
    <h2 class="columns three alpha" data-hook="checkout_title"><%= Spree.t(:checkout) %></h2>
  </div>
  <%= render :partial => 'spree/layouts/shared/wizard', :locals => { :target => @order } %>
</div>
  <div class="row" data-hook="checkout_content">
    <div class="<%= if @order.state != 'confirm' then 'col-md-9' else 'col-md-12' end %>" data-hook="checkout_form_wrapper">
      <%= form_for @order, :url => update_checkout_path(@order.state), :html => { :id => "checkout_form_#{@order.state}" } do |form| %>
        <% unless @order.email? %>
          <p class="field" style='clear: both'>
            <%= form.label :email %><br />
            <%= form.text_field :email %>
          </p>
        <% end %>
        <%= render @order.state, :form => form %>
      <% end %>
    </div>

    <% if @order.state != 'confirm' %>
      <div id="checkout-summary" data-hook="checkout_summary_box" class="col-md-3">
        <%= render :partial => 'summary', :locals => { :order => @order } %>
      </div>
    <% end %>
  </div>
</div>

<script>
Spree.current_order_id = "<%= @order.number %>"
Spree.current_order_token = "<%= @order.token %>"
</script>

<% if I18n.locale != :en %>
  <script src="<%= assets_prefix %>/jquery.validate/localization/messages_<%= I18n.locale %>.js"></script>
<% end %>
4

1 回答 1

1

这似乎表明 jquery.payment - 提供该.payment功能的库 - 根本没有被加载。你能在一个新的应用程序中重现这个吗?

于 2014-06-30T04:08:24.740 回答