Hello,
I am trying to use the Price Bucket as a calculator for a shipping
method in Spree 0.40 / ruby 1.8.7. I am not sure how this should
exaclty works. I could not find current documentation in guides for
this (link for calculators guide not working), so I had a look at the
price_bucket.rb source file.
My understanding of the parameters (minimal, discount, normal) now is
if total_cost_of_order >= minimal
shipping_cost = discounts
else
shipping_cost = normal
For instance, with (minimal=120, discount=0, normal=5) if the order
price sums up to 140, it would be shipped without charge. Could
somebody confirm this?
Anyway, the problem is that, during checkout, after entering the
address I get the folllowing error:
undefined method `to_d' for #<Order:0xb56b7078>
activemodel (3.0.3) lib/active_model/attribute_methods.rb:364:in `method_missing'
activerecord (3.0.3) lib/active_record/attribute_methods.rb:46:in `method_missing'
spree_core (0.40.0) app/models/calculator/price_bucket.rb:21:in `compute'
activerecord (3.0.3) lib/active_record/associations/association_proxy.rb:218:in `send'
activerecord (3.0.3) lib/active_record/associations/association_proxy.rb:218:in `method_missing'
spree_core (0.40.0) app/models/order.rb:321:in `rate_hash'
spree_core (0.40.0) app/models/order.rb:317:in `collect'
spree_core (0.40.0) app/models/order.rb:317:in `rate_hash'
could you try switching class caching on (class reloading off) by
editing config/environments/development.rb to
config.cache_classes = true
and say if that resolves the issue.
Torsten
> --
> You received this message because you are subscribed to the Google
> Groups "Spree" group.
> To post to this group, send email to spree...@googlegroups.com.
> To unsubscribe from this group, send email to spree-user+...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/spree-user?hl=en
> .
>