Gift sertificate value - cyrilic font error


  • Default avatar
    matvey    
     7 years ago
    0

    Hello. I try to generate sertifactes, upload cyrilic fonts but if I try type something on russian I see incorrect characters in jpg and pdf sertificate files.
  • Your avatar
    seyi    
     7 years ago
    0

    Hello,

    What font did you upload/use?

    Also can you give an example of the text used?
  • Default avatar
    matvey    
     7 years ago
    0

    I tried some fonts (Arial, Century Gothic) but I think problem in render script. For example, If I edit controller.php and try to type some cyrilic characters instead of '20.00 USD' , AWO can't render preview of certificate. I searching for russian forums and I know that this problem exist from older versions of AWO. Fast method - print all cyrilic characters on background of PNG file but currency-prefix (for example cost: 1000 rub) also have cyrilic characters and script render squareboxes instead of 'rub' prefix.
  • Your avatar
    seyi    
     7 years ago
    0

    Adding cyrilic characters directly to the file will not work. For the font, it would have to support cyrilic characters to render properly.

    Can you give me an example of the text that is coming up in square boxes?
  • Default avatar
    matvey    
     7 years ago
    0

    For example price of gift sertificate 2000 руб.
    http://excam.ru/catalog/podarochnye-sertifikaty/podarochnyj-sertifikat-2000.html

    voucher jpg
    https://yadi.sk/i/JC9v2AFPwRkxD

    all cyrilic characters print in background png directly, AWO print only certificate cost
  • Your avatar
    seyi    
     7 years ago
    0

    Hello,

    I tested this using the default font, arial, and did not have any problems. Here is the preview screen before purchase:
    preview.png

    And here is the image of the voucher after purchase:
    voucher.png

    So it must be something else, maybe the encoding of the website?
  • Default avatar
    matvey    
     7 years ago  last edited 7 years ago
    0

    encoding: UTF-8
    I really don't know where to look for a solution to this problem.

    If I try to type cyrilic characters in any text areas - preview not working. In email - squareboxes. AWO code has not been modified

    Ok, please ask me how I can delete currency suffix from certificate cost?
  • Your avatar
    seyi    
     7 years ago
    0

    Hello,

    If you like, I can have a look, would just need you to send me a private message temp admin and ftp access.

    To disable the currency you would have to edit code.

    In www/administrator/components/com_awocoupon/helpers/estore/estoregiftcerthandler.php, around line 210 is this:

    <?php
                        $row
    ['coupon_row']->coupon_price $row['coupon_row']->coupon_value_type=='amount' 
                                $this->formatcurrency($row['coupon_row']->coupon_value)
                                round($row['coupon_row']->coupon_value).'%';
    ?>

    You can change it to this
    <?php
                        $row
    ['coupon_row']->coupon_price $row['coupon_row']->coupon_value_type=='amount' 
                                $row['coupon_row']->coupon_value
                                
    round($row['coupon_row']->coupon_value).'%';
    ?>

    That should do it.
  • Default avatar
    matvey    
     7 years ago
    0

    After these edits the price is displayed with five zeros after the decimal point
  • Your avatar
    seyi    
     7 years ago  last edited 7 years ago
    0

    You can round it:

    <?php
    round(<span style="color:rgb(0,0,187);">$row</span><span style="color:rgb(0,119,0);">[</span><span style="color:rgb(221,0,0);">'coupon_row'</span><span style="color:rgb(0,119,0);">]-></span><span style="color:rgb(0,0,187);">coupon_value,2)</span>
    <
    span style="color:rgb(0,0,187);">
    ?>

    Thanks for the access, after debugging, the russian characters are throwing the error below, causing the block characters to be printed:

    Warning: imagettfbbox() [function.imagettfbbox]: any2eucjp(): invalid code in input string

    After searching the web, it seems it might be a php version issue. Are you able to upgrade?

  • Default avatar
    matvey    
     7 years ago
    0

    Yes. You are absolutelyright. Changed version up to 5.4 (prev 5.3) and everything was ok. Thank you very much!