app/models/concerns/spree/package_type_picking.rb
# Returns all package types that are capable of storing the items in this
# package/shipment for the given provider. The provider should just be the
# name and from that this method will find the object
Returns all package types that are capable of storing the items in this
package/shipment for the given provider. The provider should just be the
name and from that this method will find the object
Returns all package types that are capable of storing the items in this package / shipment for the given provider . The provider should just be the name and from that this method will find the object
def possible_package_types_for provider, service_type, must_fit=true
    provider = Spree::ShipmentProvider.find_by name: provider
    return [] unless provider
    provider.package_types.find_all do |type|
      (type.valid_services.nil? || type.valid_services.include?(service_type)) &&
      (!must_fit || type.can_fit?(self))
    end
  end
def possible_package_types_for provider , service_type , must_fit = true provider = Spree :: ShipmentProvider . find_by name : provider return [ ] unless provider provider . package_types . find_all do | type | ( type . valid_services . nil? || type . valid_services . include? ( service_type ) ) && ( ! must_fit || type . can_fit? ( self ) ) end end
Returns all package types that are capable of storing the items in this
package/shipment for the given provider.
Returns all package types that are capable of storing the items in this package / shipment for the given provider .
provider
service_type
must_fit