我很想幫助解決我遇到的令人沮喪的問題。第一次設置Spree,但我在Rails中開發了3年,所以我很熟悉它的工作原理。Spree Commerce在結帳時出錯:「我們無法將所選商品發送到您的送貨地址。」
相當多的默認設置。但是,當我試圖結帳時,點擊地址頁面上的「保存並繼續」,我會在標題中看到錯誤。我可以從那裏錯誤是來自順序模型中看到:https://github.com/spree/spree/blob/2-0-stable/core/app/models/spree/order.rb
def ensure_available_shipping_rates
if shipments.empty? || shipments.any? { |shipment| shipment.shipping_rates.blank? }
errors.add(:base, Spree.t(:items_cannot_be_shipped)) and return false
end
end
有沒有容易能弄清楚其中的那些條件,返回true。如果它是我的應用程序,我只需添加一個調試器語句並以這種方式檢查事情。任何人都可以給我任何關於如何排除故障或嘗試嘗試的建議。
我在Rails 3.2.14,Spree 2-0-stable。
謝謝!