如果其中一个订单项缺货,则 Spree 将订单分成两批发货

Spree Split order into two shipments if one of the line items is backorder

我正在使用 Spree 3.1 版创建 Spree 应用程序,但我遇到了一个问题,如果订单中的任何订单项缺货,即使我是使用

Rails.application.config.spree.stock_splitters = []

根据文档可以防止订单拆分

Or if you don't want to split packages just set the option above to an empty array. e.g. a store with the following configuration in spree.rb won't have any package splitted.

这个问题有什么解决方案吗?!

我已经通过覆盖寄存器库存拆分器初始化程序解决了这个问题

initializer 'spree.register.stock_splitters' do |app|
  app.config.spree.stock_splitters = []
end 

此修复:

关闭拆分发货

如果您不想在任何情况下拆分包,您可以将 config.spree.stock_splitters 选项设置为一个空数组:

Rails.application.config.spree.stock_splitters = []

这里记录的似乎为我解决了这个问题。

https://github.com/solidusio/solidus/blob/master/guides/source/developers/shipments/split-shipments.html.md