Show all spree ecommerce products together with their count-on-hand displayed

时间秒杀一切 提交于 2019-12-07 08:48:27

Each product has a total on hand method defined here:

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

You can iterate through all products, and call total_on_hand to find the number of those products on hand (for all variants and stock locations).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!