multilingual site e-mail always in default language for gift certificates


  • Default avatar
    edvard    
     3 years ago
    0

    Hello,

    I have configured everything in 2 languages in "Email Templates" section but e-mail subject and text in e-mails, upon gift certificate creation, are in default website language only,  no matter which language customer uses during gift certificate purchase.

    What could be the issue?

    J3.9.27 / VM 3.8.8 10472 / AC 3.6.0.3 /PHP 7.4.20

  • Your avatar
    seyi    
     3 years ago
    0

    Hello,

    How is the git certificate being generated?  Is it triggered from admin by updating the order status?  If so, this will always use the default front end language.  If the gift cert email is triggered from being purchased in the front end, causing order status to automatically go to giftcert order status, then it should use the correct language.
  • Default avatar
    edvard    
     3 years ago  last edited 3 years ago
    0

    Hi, it is being purchased in the front end, causing order status to automatically go to giftcert order status.

    In Configuration "Order status for sending automatic email" is set to "Paid", and "Order status to set after sending automatic email" is set to "Sent"...

  • Your avatar
    seyi    
     3 years ago
    0

    What payment method is being used?
  • Default avatar
    edvard    
     3 years ago
    0

    any, I have just tried PayPal and it is the same
  • Your avatar
    seyi    
     3 years ago
    0

    Ok, here is the fix.  In the file:
    \administrator\components\com_awocoupon\helper\class-awocoupon-helper-language.php, around line 272 is this:
    <?php
                $languages
    [] = JFactory::getLanguage()->getTag(); // current front end language
    ?>

    Change it to this:
    <?php
                $lang 
    AC()->helper->get_request'lang' );
                if ( ! empty( $lang ) ) {
                    $languages[] = $lang;
                }
                else {
                    $languages[] = JFactory::getLanguage()->getTag(); // current front end language
                }
    ?>

    That should work better