Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. productCommand.errors.getAllErrors().each { error ->
  2. if (!productBean.quantity && error.code == 'plugin.opcAddToCart.message.validation.price.notvalid') {
  3. def tempQuantity = item.quantity
  4. item.quantity = convertedQuantity
  5. item.errors.rejectValue('quantity', 'plugin.opcAddToCart.message.quantity.notValid')
  6. item.quantity = tempQuantity
  7. } else {
  8. item.errors.addError(error)
  9. }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement