Realized we had the "Add a certificate" form field in the Checkout stage, but there is nowhere in the code that it actually validates the certificate during op 'cart-process'. Here's the code that fixes that:

  // If they entered a certificate code in the checkout pane, make sure it belongs to them. (Should we make sure it's anon (0) first?
  if ($arg1->data['certificate_code']) {         
    uc_gift_certificate_validate($arg1->data['certificate_code']);
  }

I added this to uc_payment_method_zero_total but it could go pretty much anywhere the cart gets processed. I would like to add this to one of the next commits, along with some of the additions I made to the Conditional Actions integration. (I needed to allow users to be granted gift certificates, so I fleshed out the CA action for that process. I'll post that in its own thread.)

CommentFileSizeAuthor
#1 uc_cert.675334.patch1.01 KBtorgospizza

Comments

torgospizza’s picture

Status: Active » Needs review
StatusFileSize
new1.01 KB

Patch is attached.