Class: Plugins::Ecommerce::ShippingMethod
- Inherits:
-
CamaleonCms::TermTaxonomy
- Object
- CamaleonCms::TermTaxonomy
- Plugins::Ecommerce::ShippingMethod
- Defined in:
- app/models/plugins/ecommerce/shipping_method.rb
Instance Method Summary collapse
Instance Method Details
#get_price_from_weight(weight = 0) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'app/models/plugins/ecommerce/shipping_method.rb', line 10 def get_price_from_weight(weight = 0) price_total = 0 prices = ("prices") if prices.present? prices.each do |key, value| price_total = value[:price] if value[:min_weight].to_f <= weight.to_f && value[:max_weight].to_f >= weight.to_f end end price_total.to_f end |
#skip_slug_validation? ⇒ Boolean
6 7 8 |
# File 'app/models/plugins/ecommerce/shipping_method.rb', line 6 def skip_slug_validation? true end |