Can't get recipient name to show on Gift Certificate


  • Default avatar
    coreyna    
     4 years ago
    0

    Hi there,

    I'm running the latest version with J1.5 and Virtuemart 2 and I can't get the recipient name to show up on the coupon.

    I have created a custom text input field
    I have added this to the product in Virtuemart
    I have added the id of the custom field into the Awo config
    I have tested on the frontend and the custom field shows, I type in a recipient name and this displays in checkout
    The profile I am using has {recipient_name} as one of the free text fields

    When the product is purchased the git certificate is emailed out correctly but it always displays the purchaser first/late name where the recipient name should be.

    Where am I going wrong?

    Happy to PM or emails logins so you can take a look.
  • Your avatar
    seyi    
     4 years ago
    0

    Hello,

    Can you please send a PM with login information to take a look?
  • Default avatar
    bryan4    
     4 years ago
    0

    I need help with this too, I really wish you would post the answer in the forum.

    Bryan
  • Your avatar
    seyi    
     4 years ago
    0

    It was solved. I believe the problem was the email was not filled out, in which case it defaults the recipient name to the purchaser name and message to blank.
  • Default avatar
    bryan4    
     3 years ago
    0

    especially if the order is set to be mailed via postal mail. Is there a way to make the email field mandatory? Interesting that I just got an email from the client today saying that the coupon was incorrect. This is the reason.

    To: William ###,

    From William ###

    If they intend to send it via mail, the way it is configured now will make the cert wrong. Thats not ok.

    I need help with this immediately....

    Bryan
  • Your avatar
    seyi    
     3 years ago
    0

    Hello Bryan,

    Im not sure how you could make the email field manditory, that would be somewhere within Virtuemart, but you can take away the email restriction, so even if they do not enter an email, the recipient name and message are used.

    in www/administrator/components/com_awocoupon/assets/virtuemart/ps_awo_giftcert.php, search for this:
    <?php
                
    if(!empty($attrlist[$email_field]) && JMailHelper::isEmailAddress($attrlist[$email_field])) {
    ?>


    and change it to this
    <?php
                
    //if(!empty($attrlist[$email_field]) && JMailHelper::isEmailAddress($attrlist[$email_field])) {
                
    if(1==1) {
                    if(empty(
    $attrlist[$email_field]) || !JMailHelper::isEmailAddress($attrlist[$email_field])) $attrlist[$email_field] = $row->user_email;
    ?>
  • Default avatar
    bryan4    
     3 years ago
    0

    Thats even better!
  • Default avatar
    bryan4    
     3 years ago
    0

    Unfortunately, now it does not send the email at all. I pasted the code in exactly as above, any thoughts?
  • Your avatar
    seyi    
     3 years ago
    0

    Yes, I have updated the code, need to set the email to send to.
  • Default avatar
    bryan4    
     3 years ago
    0

    Still not working, here is what it looks like.

    //if(!empty($attrlist[$email_field]) && JMailHelper::isEmailAddress($attrlist[$email_field])) {
    if(1==1) {
    if(!empty($attrlist[$email_field]) && JMailHelper::isEmailAddress($attrlist[$email_field])) $attrlist[$email_field] = $row->user_mail;
    return array('recipient_name'=>@$attrlist[$name_field],'first_name'=>@$attrlist[$name_field],'last_name'=>'','email'=>$attrlist[$email_field],'message'=>@$attrlist[$message_field]);
  • Default avatar
    bryan4    
     3 years ago
    0

    Can you just send me a modified version of the file? It seems I may be doing something wrong.
  • Default avatar
    bryan4    
     3 years ago
    0

    Please dont disappear on me now.. The above is not working. I need this resolved.
  • Your avatar
    seyi    
     3 years ago
    0

    the condition was wrong, I have updated it again, please try.
  • Default avatar
    bryan4    
     3 years ago
    0

    Did not work...
    Maybe Im doing something wrong, can you please just send me a copy of this form with the revisions already applied or would it be easier if I just gave you access to the site.

    If it helps, once I apply this change it does not send the certificate email at all.

    Bryan
  • Your avatar
    seyi    
     3 years ago
    0

    I have updated the code, there was an error, changed $row->user_mail to $row->user_email and it works now.