I've been looking into this module again. Beta 3 and dev are not working for me.

I've installed according to the readme. Created a product. Added the recipient email address attribute and the Gift certificate feature to the product.

On my test site I've enabled the Credit Card test gateway which sets the order status to "complete" when the transaction is done. I've configured the Giftcert module to apply on order status complete.

Any test transactions I've done do not create the gift certificate for the recipient. The don't appear in the database at all. I don't get any error message.

I'm testing on a drupal 5.15 installation. I know torgospizza has this running on a live site, I just can't get any available version on drupal.org or ubercart.org to work.

I'm willing to sponsor some development to get this out of BETA and working for everyone.

Thanks!

Comments

torgospizza’s picture

Assigned: Unassigned » torgospizza
Priority: Normal » Critical

Hi there,

If you'd like to sponsor development that'd be great, but I know how important it is to get this running. Strange thing is, this module works fine on our D5 production environment. (We are running on the Dev version.)

When you look in Watchdog, do you see any errors pertaining to the uc_gift_certificate database table? My first guess is that there's something wrong with the table's schema, perhaps some code that is out of sync with the table's fields. I don't think that's 100% the case but it might be.

I will take a look at this on our live and test sites and see if anything jumps out at me. I'll also try it with the credit card test gateway to see if I can replicate your issue.

Thanks for reporting this.

torgospizza’s picture

One thing I just wanted to make sure of, you said that you added the "Email address" attribute, but did you also add the "Dollar Amount" attribute? That's the most important one. You'll need to also make sure it's called exactly that: Dollar Amount.

This should have been created automatically when the module was installed. If not that might be the problem. I'm working on a better way to implement this.

torgospizza’s picture

Wanted to post after doing some testing, I'm not able to reproduce your issue at this time, but again this is an existing instance of the module, and not a new install. I'll give that a shot next chance I get. Also please verify my question in #2, that you have included the Dollar Amount attribute in your certificate product.

Erik

sleepingmonk’s picture

Hey Erik,

Thanks for the responses. I did not add the Dollar Amount attribute. I was using the Feature Tab to add a Gift certificate amount. I see now in dev that that's "deprecated". I just remembered doing it in an older version so that's what I did this time too.

Looking at attributes instead I found "Certificate Amount" but I was using Beta3, not dev. When I searched the code in the dev version I found the "Dollar Amount" attribute so I installed that version. The attribute does not get added to the uc_attributes table. I modified the install to include an insert for "Dollar Amount" and re-installed.

I set up a new product with the recipient email and Dollar Amount attributes. I then set up options for the Dollar Amount attribute the normal way I would for any attribute. Starting to look good, but still doesn't work.

I search more code and change my sku/model to Gift-Cert because uc_gift_certificate_create_new_certs is looking for "LIKE Gift-Cert or Gift-Card". Still doesn't work. Checking my log this time reveals the database table for uc_gift_certificates is wrong.

Unknown column 'order_product_id' in 'field list' query: INSERT INTO uc_gift_certificates (name, value, purchaser_id, order_id, order_product_id) VALUES ('Gift Certificate', '20', 1, 842, 2271) in .../includes/database.mysql.inc on line 174.

I guess the big issue with this module is that the install file isn't updated properly. Needs to include the Dollar Amount attribute INSERT and the order_product_id in the table.

I'll try to update this myself and let you know if I get it to work. Unless you can provide a fix before I can.

Thanks.

sleepingmonk’s picture

Status: Active » Needs review
StatusFileSize
new3.03 KB

The attached patch does the following:

  • Updates .install to add a order_product_id column to the uc_gift_certificate table
  • Updates .install to add "Dollar Amount" attribute to uc_attributes table
  • Updates the README.txt to include more instructions for successful setup of a Gift Certificate product.

Please review and let me know if I did everything correctly. What I've done seems to be working for me.

Hope this helps.

torgospizza’s picture

Brilliant! Thanks for your work on this. Actually looking back at my work, I think it should actually be called "Certificate Amount" to differentiate itself from other attributes that might call for a "Dollar amount"... (it's been awhile since I've worked on this module, so please excuse my fuzziness in memory).

I'm actually confused as to whether or not the dev version that's on UC.org is the latest revision compared to my local copy. As soon as I can (I'm not in the office now) I will compare the two to make sure that I'm working on the newest code... because I would swear that I've already gone through these steps.

Again, forgive my haziness, been really busy (and I'm moving to a new apartment today) so the cards are not stacked in my favor. If this patch works for you, I will study it and make sure these fixes are kept in line with the latest dev version, and release a new beta if all seems to work.

Thanks again for your efforts.

torgospizza’s picture

I applied your patch, minus the one minor detail as I suspected: Changed "Dollar Amount" to "Certificate Amount". This is a change I had made before, but apparently had gotten lost during one of my CVS revisions (I had some trouble during a commit and had to go back a couple revisions).

The dev package should be posted shortly, please give that a try. I also will need to add an update() function to make sure that the attribute is called "Certificate amount" on current installs, although I'm a little hesitant to do that, since I would need to search for the attribute called "Dollar Amount" first. The trouble here is it's an ambiguous attribute, and the module would need to make sure that no other modules are using it as well - if they are then it would need to make an additional attribute instead. (Perhaps then it's best to add the new attribute rather than replace it?)

One item from your patch I left out, was the "Enter the SKU as GIft-Card or Gift-Cert" - this isn't necessary so long as the attribute called "Certificate Amount" is added to a product, hence why I am changing its name. If you've found that this is still a requirement I need to find out where this is being called, because in my current code I have removed any checking of the product SKU during the order completion process.

Thanks again for your help and please let me know if you find any more issues with the current Dev version.

sleepingmonk’s picture

Status: Needs review » Needs work

Great! Dev seems to be working except for one hicup on install. You have two order_product_id fields in the uc_gift_certificates schema. You might want to remove one and upload a new dev version.

Other than that my tests so far have been successful.

Thanks!

torgospizza’s picture

Glad to hear it. I just committed the fix for that field. Feel free to continue testing and let me know if you see anything else amiss. I'll finish testing on my end and if everything looks satisfactory, will issue another release.

torgospizza’s picture

Status: Needs work » Needs review
onsis’s picture

Title: Ubercart Gift Certificate not granting certificate to recipient on order completion. » modastrass
Assigned: torgospizza » onsis
Category: bug » task
Priority: Critical » Minor
Status: Needs review » Active

Swarovski steine Swarovski,Strasssteine Perlen: Strasssteine von Swarovski aus Hoechster Qualitaet im Strassstein Megastore. Glanz mit Swarovski Strasssteine aus Purem Kristall!

torgospizza’s picture

Title: modastrass » Ubercart Gift Certificate not granting certificate to recipient on order completion.
Assigned: onsis » torgospizza
Category: task » bug
Priority: Minor » Critical
Status: Active » Needs review

Thanks for choosing this issue to spam!

twirlingsky’s picture

I'm having the same problem - that gift certificates are not being issued to the recipient email. I've applied the patch but it doesn't seem to help.

rickyw’s picture

Version: 5.x-1.1-beta3 » 5.x-1.x-dev

Is the latest Dev snapshot supposed to have a fix?
It doesn't seem to work for me.
Installation seems fine and I added the product as per the instructions (added the three attributes), but when I go to order the product and set the status of the order to "payment received", the gift certificate is neither sent out, nor created.

torgospizza’s picture

Hi, sorry for the crazy delay. Haven't been keeping up on this module like I should be.

I'll take a look at the 5.x branch this week.

vrajak@gmail.com’s picture

Version: 5.x-1.x-dev » 5.x-1.1

I'm having the same issue with trying this, the recipient receives no email upon order submission. Any suggestions or input on how I can get this to work?

torgospizza’s picture

Is the gift certificate created, but you don't get the email sent out? Is that right?

vrajak@gmail.com’s picture

Yes that's right, its created but no email is sent out.

vrajak@gmail.com’s picture

I tried the dev version just now, but it doesn't seem to add the third attribute "Certificate Amount." Any ideas on that? I've definitely updated the module, and reloaded things etc, but that attribute doesn't show up.