【问题标题】:Show all spree ecommerce products together with their count-on-hand displayed显示所有大礼包电子商务产品及其显示的手数
【发布时间】:2014-06-16 16:38:57
【问题描述】:

如何在 Spree Commerce 的一个位置同时显示所有产品及其数量?我看到 count_on_hand 实现的唯一地方是在 admin/stock_transfers 中,即使这样,管理员也需要多次点击。

 admin --> configuration --> stock transfers --> view transfer

然后您可以看到每个项目显示的手数变量。

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-4 e-commerce spree commerce


    【解决方案1】:

    每个产品都有一个在这里定义的总手头方法:

    https://github.com/spree/spree/blob/v2.2.2/core/app/models/spree/product.rb#L200-L206

    您可以遍历所有产品,并调用 total_on_hand 以查找现有产品的数量(针对所有变体和库存位置)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-03-26
      • 1970-01-01
      • 1970-01-01
      • 2021-09-11
      • 2022-11-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多