diff --git a/app/controllers/open_food_network/cart_controller.rb b/app/controllers/open_food_network/cart_controller.rb index 38489ce849..a4bc1c7b76 100644 --- a/app/controllers/open_food_network/cart_controller.rb +++ b/app/controllers/open_food_network/cart_controller.rb @@ -20,7 +20,7 @@ module OpenFoodNetwork def add_variant @cart = Cart.find(params[:cart_id]) - distributor = Enterprise.find(params[:distributor_id]) + distributor = Enterprise.find_by_permalink(params[:distributor_id]) order_cycle = OrderCycle.find(params[:order_cycle_id]) if params[:order_cycle_id] if @cart.add_variant params[:variant_id], params[:quantity], distributor, order_cycle, current_currency @@ -36,4 +36,4 @@ module OpenFoodNetwork Spree::Config[:currency] end end -end \ No newline at end of file +end