owen2345 / camaleon-ecommerce

This is an ecommerce plugin for CAMALEON CMS
MIT License
21 stars 20 forks source link

ninitialized constant Plugins::Ecommerce::ProductDecorator::UserProductService error with latest commit #43

Closed mazharoddin closed 8 years ago

mazharoddin commented 8 years ago

Hi, I am getting below error with latest commit.

uninitialized constant Plugins::Ecommerce::ProductDecorator::UserProductService
            <div class="purchase">
                <% if @post.in_stock? %>
                    <% if @post.the_qty_real.to_i > 0 %>
                        <%= form_tag(plugins_ecommerce_checkout_cart_add_path, :method => "post", :class => "form") do %>
                            <div class="input-group">
                                <span class="input-group-addon">Qty: </span>
app/apps/themes/e_shop/views/post_types/commerce/single.html.erb:35:in `_app_apps_themes_e_shop_views_post_types_commerce_single_html_erb___536506145151137213_70196084205220'
p-decoraid commented 8 years ago

Please check if #44 fixes that, sorry.

mazharoddin commented 8 years ago

Np, but it didn't fixed the issue, I am seeing same error.

p-decoraid commented 8 years ago

Looks like I missed a spot, please try #47

mazharoddin commented 8 years ago

Now I am getting below error with latest commit.

NoMethodError in CamaleonCms::Frontend#post 
undefined method `sum' for 3.0:Float
    else
      (product.get_field_value('ecommerce_qty').to_f || 0).
        sum("#{Plugins::Ecommerce::ProductItem.table_name}.qty")
    end
  end
end

/Users/mazhar/.rvm/gems/ruby-2.3.0@rails4.2.7/bundler/gems/camaleon-ecommerce-536cfab43475/app/services/plugins/ecommerce/product_service.rb:16:in `available_qty'
/Users/mazhar/.rvm/gems/ruby-2.3.0@rails4.2.7/bundler/gems/camaleon-ecommerce-536cfab43475/app/decorators/plugins/ecommerce/product_decorator.rb:112:in `the_qty_real'
/Users/mazhar/.rvm/gems/ruby-2.3.0@rails4.2.7/bundler/gems/camaleon-ecommerce-536cfab43475/app/decorators/plugins/ecommerce/product_decorator.rb:86:in `the_stock_status'
/Users/mazhar/.rvm/gems/ruby-2.3.0@rails4.2.7/bundler/gems/camaleon-ecommerce-536cfab43475/app/views/post_types/commerce/single.html.erb:42:in 
p-decoraid commented 8 years ago

Is that when you are not logged in?

mazharoddin commented 8 years ago

Yeah @p-decoraid.

p-decoraid commented 8 years ago

Could you try https://github.com/Decor-Aid/camaleon-ecommerce/commit/0cb58177f6fe33f14a23f83904b84fab54963104 ?