lib/spree/retailops/rop_order_helper.rb
# Find or create an advisory (not selectable) shipping method to represent how ROP shipped this item
Find or create an advisory (not selectable) shipping method to represent how ROP shipped this item
Find or create an advisory ( not selectable ) shipping method to represent how ROP shipped this item
def advisory_method(name)
        use_any_method = options["use_any_method"]
        @advisory_methods ||= {}
        unless @advisory_methods[name]
          @advisory_methods[name] = ShippingMethod.where(admin_name: name).detect { |s| use_any_method || s.calculator.is_a?(Spree::Calculator::Shipping::RetailopsAdvisory) }
        end
        unless @advisory_methods[name]
          raise "Advisory shipping method #{name} does not exist and automatic creation is disabled" if options["no_auto_shipping_methods"]
          @advisory_methods[name] = ShippingMethod.create!(name: name, admin_name: name) do |m|
            m.calculator = Spree::Calculator::Shipping::RetailopsAdvisory.new
            m.shipping_categories << ShippingCategory.first
          end
        end
        @advisory_methods[name]
      end
def advisory_method ( name ) use_any_method = options [ "use_any_method" ] @advisory_methods ||= { } unless @advisory_methods [ name ] @advisory_methods [ name ] = ShippingMethod . where ( admin_name : name ) . detect { | s | use_any_method || s . calculator . is_a? ( Spree :: Calculator :: Shipping :: RetailopsAdvisory ) } end unless @advisory_methods [ name ] raise "Advisory shipping method #{name} does not exist and automatic creation is disabled" if options [ "no_auto_shipping_methods" ] @advisory_methods [ name ] = ShippingMethod . create! ( name : name , admin_name : name ) do | m | m . calculator = Spree :: Calculator :: Shipping :: RetailopsAdvisory . new m . shipping_categories << ShippingCategory . first end end @advisory_methods [ name ] end
Find or create an advisory (not selectable) shipping method to represent how ROP shipped this item
Find or create an advisory ( not selectable ) shipping method to represent how ROP shipped this item
name
<not_specific>