The problem with commerce_coupon_code_is_valid() function is that if the code is invalid, we do not set error message in global $commerce_coupon_validation_error_message;.

  // if no such coupon found, the $code is invalid
  if (!is_object($coupon)) {
    return FALSE;
  }

This causes inconsistency in error handling that is fairly easy to fix.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ygerasimov’s picture

Status: Active » Needs review
FileSize
414 bytes

Patch attached.

pcambra’s picture

Status: Needs review » Fixed

Thanks for the patch, fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Samvel’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs review
FileSize
496 bytes

Hello guys,

Seems patch was not applied correctly and i see error in variable name.
I still haven't any error messages if i enter invalid coupon code.

Patch attached, please review.

mdupree’s picture

This issue seems to be implemented in (atleast in the sense of error message on invalid coupon)
Commerce Coupon 7.x-2.x

mdupree’s picture

Status: Needs review » Closed (outdated)