Skip to content

Commit

Permalink
Merge pull request #20 from OpenBuildings/price-validation-fix
Browse files Browse the repository at this point in the history
Allow zero price for shipping group
  • Loading branch information
EZarkov authored Oct 18, 2017
2 parents 1dc9ccc + 4b74260 commit 12d9a40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion classes/Kohana/Model/Shipping/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}
Expand Down

0 comments on commit 12d9a40

Please sign in to comment.