From 4b7426097ba26a48682e2acf25ff9b0ae8adac58 Mon Sep 17 00:00:00 2001 From: Evstati Zarkov Date: Wed, 18 Oct 2017 11:24:58 +0300 Subject: [PATCH] Allow zero for shipping group --- classes/Kohana/Model/Shipping/Group.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/Kohana/Model/Shipping/Group.php b/classes/Kohana/Model/Shipping/Group.php index 7d3b63b..b539df9 100644 --- a/classes/Kohana/Model/Shipping/Group.php +++ b/classes/Kohana/Model/Shipping/Group.php @@ -30,7 +30,8 @@ public static function initialize(Jam_Meta $meta) 'additional_item_price' => Jam::field('price', array('convert_empty' => FALSE)), 'discount_threshold' => Jam::field('price'), )) - ->validator('price', 'shipping', 'location', 'method', 'delivery_time', array('present' => TRUE)) + ->validator('shipping', 'location', 'method', 'delivery_time', array('present' => TRUE)) + ->validator('price', array('present' => array('allow_zero' => TRUE))) ->validator('additional_item_price', 'discount_threshold', 'price', array('price' => array('greater_than_or_equal_to' => 0))) ->validator('delivery_time', array('range' => array('consecutive' => TRUE, 'greater_than_or_equal_to' => 0))); }