app/controllers/spree/admin/sale_prices_controller.rb
# Load the variant as a before filter. Redirect to the referer if no product is found
Load the variant as a before filter. Redirect to the referer if no product is found
Load the variant as a before filter . Redirect to the referer if no product is found
def load_product_and_variant
        @product = Spree::Product.find_by(slug: params[:product_id])
        @variant = @product.variants_including_master.find(params[:variant_id])
        redirect_to request.referer unless @variant
      end
def load_product_and_variant @product = Spree :: Product . find_by ( slug : params [ :product_id ] ) @variant = @product . variants_including_master . find ( params [ :variant_id ] ) redirect_to request . referer unless @variant end
Load the variant as a before filter.
Load the variant as a before filter .