What's best way to diable emailing of gift certificates?


  • Default avatar
    mowlman    
     11 years ago
    0

    We want to send out a printed gift certificate instead of email to the customer. What's best way to diable emailing of gift certificates?

    Maybe I am overlooking a setting or more likely I will need to comment out some code?

    Thanks for your help.
    -Bill
  • Your avatar
    seyi    
     11 years ago
    0

    Hi Bill,

    No, you are not overlooking a setting. You can disable it by updating parts of the code:
    in www/administrator/components/com_awocoupon/assets/virtuemart/ps_awo_giftcert.php, find this line
    <?php
    if ( ps_awo_giftcert::sendMail($from_email$from_name$to$subject$message$profile['message_type']=='html' 0$bcc$mycodes['attachments'], $is_embed) !== true ) {
    ?>


    comment it out and add the below
    <?php
    if(1!=1) {
    ?>
  • Default avatar
    mowlman    
     11 years ago
    0

    This is solved. Thanks you for your time.
    Since we had a need where we wanted to print out a certificate and snail mail to the customer instead of automatically emailing a digital copy.

    your solution worked:
    commenting out the IF on line 258
     if ( ps_awo_giftcert::sendMail($from_email, $from_name, $to, $subject, $message, $profile['message_type']=='html' ? 1 : 0, $bcc, $mycodes['attachments'], $is_embed) !== true ) { 

    And replacing with:
     if(1!=1) { 


    So that the certificate email would not be sent, but the error cleanup code would still execute. Full code block pasted below:
        //    if ( ps_awo_giftcert::sendMail($from_email, $from_name, $to, $subject, $message, $profile['message_type']=='html' ? 1 : 0, $bcc, $mycodes['attachments'], $is_embed) !== true ) {
          if(1!=1) { //Code change - Replaced above line with this - we did not want certificate emails to be sent out
                    ps_awo_giftcert::cleanup_error($allcodes, $used_codes, $is_new, 'cannot mail codes');
                    return false;
                } 
  • Your avatar
    seyi    
     11 years ago
    0

    Glad you got it working. The cleanup should not initiate in that block as it still needs to record the gift certificate issued to the customer. But eventually it will.
  • Default avatar
    david91    
     11 years ago
    0

    Hey Seyi,

    Following on from Bill's query and the solution that you both found (listed below):

    Is there a way to offer the choice to the purchaser that if they want a printed gift certificate, they don't receive the emailed certificate, but also, leaves open the option for purchasers that only want emailed certificates to still have that option?

    The workaround for Bill's original problem would not work for what we are after. It disabled the sending of gift certificates all together, whereas we want to know if we can disable it only when the shipping method in virtuemart is postage.

    Could you let us know of anyway to access the virtuemart shipping method data to add the workaround?

    Thanks for your help...

    Dave
  • Your avatar
    seyi    
     11 years ago
    0

    Hello,

    I think you should offer an attribute of sorts in the product that gives the customer of electronic or mail. Then within the gift certificate code, you would check that attribute for that specific product and if it set for mail, do not send the gift certificate. This would require a little coding.