FAQ
In my /spree/views/home/index my erb code from 1.3.2 makes reference to the following preference


  :show_zero_stock_products, :boolean, :default => true


Its is not available in the 2.0 release. is there and alternative?

--
Don't miss SpreeConf on May 20-21: http://spreeconf.com
Spree is hiring: http://spreecommerce.com/careers

Search Discussions

  • Randy Terbush at May 8, 2013 at 1:37 am
    I believe a few of these stock quantity helpers are gone in 2.0. I'm sure
    someone will correct me if I am wrong.

    I've done the following to get on_hand values for products. Might give you
    some ideas on how go do what you are trying to do.

    Spree::Product.class_eval do

       def count_available
         quantifier = Spree::Stock::Quantifier.new(master.id)
         inventory = quantifier.total_on_hand
         inventory
       end
    end



    On Tuesday, May 7, 2013 4:05:57 PM UTC-6, Abdullah jeffers wrote:

    In my /spree/views/home/index my erb code from 1.3.2 makes reference to the following preference


    :show_zero_stock_products, :boolean, :default => true


    Its is not available in the 2.0 release. is there and alternative?
    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers
  • Stefan Wrobel at Aug 19, 2013 at 9:49 pm
    Re-implemented show_zero_stock_products on 2.0+:
    https://github.com/swrobel/spree_zero_stock_products
    On Wednesday, May 8, 2013 10:26:52 AM UTC-7, Abdullah jeffers wrote:

    that is good. I have not gotten around to overriding models, back to the
    docs.
    On Tuesday, May 7, 2013 9:37:13 PM UTC-4, Randy Terbush wrote:

    I believe a few of these stock quantity helpers are gone in 2.0. I'm sure
    someone will correct me if I am wrong.

    I've done the following to get on_hand values for products. Might give
    you some ideas on how go do what you are trying to do.

    Spree::Product.class_eval do

    def count_available
    quantifier = Spree::Stock::Quantifier.new(master.id)
    inventory = quantifier.total_on_hand
    inventory
    end
    end



    On Tuesday, May 7, 2013 4:05:57 PM UTC-6, Abdullah jeffers wrote:

    In my /spree/views/home/index my erb code from 1.3.2 makes reference to the following preference


    :show_zero_stock_products, :boolean, :default => true


    Its is not available in the 2.0 release. is there and alternative?

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedMay 7, '13 at 10:06p
activeAug 19, '13 at 9:49p
posts3
users3
websitespreecommerce.com
irc#RubyOnRails

People

Translate

site design / logo © 2022 Grokbase