Sha256: a109eaa6d676c2d51c3fb04787390cb7d12f1b6e461a1798b4ab6015e57bdf8e

Contents?: true

Size: 712 Bytes

Versions: 69

Compression:

Stored size: 712 Bytes

Contents

module Spree::ZonePricing::Admin::VariantsController

  def self.included(target)
    target.class_eval do

      create.before do
        # Set zone product to default if they exist
        object.set_default_zone_prices(get_user_country_id)
        # Make sure to call original code to save
        create_before
      end

      update.response do |wants|
        wants.html do
          redirect_to object.is_master ? zone_prices_admin_product_variant_url(object.product, object) : collection_url
        end
      end

      def object
       @object ||= Variant.find(params[:id])
      end

      def zone_prices
        @variant = object
        @product = @variant.product
      end
    end
  end
  
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
spree_zone_pricing-0.1.69 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.68 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.66 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.65 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.64 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.63 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.62 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.61 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.60 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.59 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.58 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.57 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.56 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.55 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.54 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.53 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.52 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.51 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.50 lib/spree/zone_pricing/admin/variants_controller.rb
spree_zone_pricing-0.1.49 lib/spree/zone_pricing/admin/variants_controller.rb