PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

 

UTF-8 koduotė PDF sąskaitoje (v. 1.2.5)

68 replies to this topic
#1
mantoza

    PrestaShop Apprentice

  • Members
  • PipPip
  • 41 posts
Sveiki,

Matau čia daugumai problemų yra kaip PDF padaryti lietuviškai simoboliai ant 1.2.5 versijos.
Bent mums šis sprendimas tai tikrai padėjo :)

1. Parsisiųskite TCPDF, iš čia: http://www.sourcefor.../projects/tcpdf

2. Nukopijuotike visą turinį į /tools/tcpdf/

3. /config/config.inc.php byloje padarykite šiuos pakeitimus

define('_PS_FPDF_PATH_',            _PS_TOOL_DIR_.'fpdf/');

pakeiskite į
define('_PS_TCPDF_PATH_',            _PS_TOOL_DIR_.'tcpdf/');


4. /clases/PDF.php faile padarykite šiuos pakeitimus

4.1
include_once(_PS_FPDF_PATH_.'fpdf.php');

class PDF extends FPDF


pakeiskite į
require_once(_PS_TCPDF_PATH_.'config/lang/eng.php');
include_once(_PS_TCPDF_PATH_.'tcpdf.php');

class PDF_PageGroup extends TCPDF


4.2
FPDF::FPDF($orientation, $unit, $format);


pakeiskite į
TCPDF::__construct($orientation, $unit, $format, true);


4.3
static private function convertSign($s)
{
return str_replace('¥', chr(165), str_replace('£', chr(163), str_replace('€', chr(128), $s)));
}


pakeiskite į
static private function convertSign($s)
{
return html_entity_decode($s,ENT_NOQUOTES,'UTF-8');
}


4.4
return $font ? $font : 'Arial';


pakeiskite į
return $font ? $font : 'freesans';


5. /classes/Tools.php faile padarykite šiuos pakeitimus
static public function iconv($from, $to, $string)
{
//Uncoment lines below to return to previous condition
//$converted = htmlentities($string, ENT_NOQUOTES, $from);
//$converted = html_entity_decode($converted, ENT_NOQUOTES, $to);
//return $converted;
//Delete line below to return on previous condition.
return $string;
}


Bandykit :)
Jei kas neveiktų, rašykit.

#2
NuZz

    PrestaShop Newbie

  • Members
  • Pip
  • 12 posts
Gal galetum įmesti jau perdarytus failus nes man kažkaip neišeina :roll:
Sorry For My Poor English :)

#3
abatisa

    PrestaShop Apprentice

  • Members
  • PipPip
  • 41 posts
pas mane po pakeitimo ten kur preferences>> pdf koduotes ir fonto pasirinkimas dabar yra tuscia. O kai paprasai parodyti pdf saskaita nieko visai neivyksta.

#4
Tommygun

    PrestaShop Newbie

  • Members
  • Pip
  • 3 posts
Sveiki visi

PDF viskas pasitaiso, kai auksciau papostintoj instrukcijoj (Mantozo) kode istaisote viena klaida. Ateiciau, prasyciau postint kodus be klaidu, nes paskui uzsiknisimas buna totalus kai bandai galus suvest.

Klaida yra Punkte 4.1 (Reikia prirasyti raidele r pirmame zodyje, kad butu require)

require_once(_PS_TCPDF_PATH_.'config/lang/eng.php');
include_once(_PS_TCPDF_PATH_.'tcpdf.php');

class PDF extends TCPDF

#5
Tommygun

    PrestaShop Newbie

  • Members
  • Pip
  • 3 posts
Bet kuriuo atveju padeka Mantozui, kad papostino kodus.

#6
Tommygun

    PrestaShop Newbie

  • Members
  • Pip
  • 3 posts
Tiesa, tam paciam 4.1 punkte vietoj class PDF extends TCPDF bent jau as suvedziau:

class PDF_PageGroup extends TCPDF

Gal tai dar padejo.

#7
mantoza

    PrestaShop Apprentice

  • Members
  • PipPip
  • 41 posts
Kodas pataisytas.

#8
abatisa

    PrestaShop Apprentice

  • Members
  • PipPip
  • 41 posts
O taip, :-) dideliausias aciu chebryte

#9
SmartiesKiller

    PrestaShop Addict

  • Members
  • PipPipPip
  • 542 posts
any chance to have an english or french translation of this topic ?thx

#10
abatisa

    PrestaShop Apprentice

  • Members
  • PipPip
  • 41 posts
Welcome,

I see many problems here are in PDF format by Lithuanian letters on the 1.2.5 version.
At least for us, this decision really helped

1. TCPDF Download from here: http://www.sourcefor.../projects/tcpdf

2nd Copy the entire contents of / tools / tcpdf /

3rd / config / config.inc.php file, make the following amendments

http://www.prestasho..._1_dot_2_dot_5/

pakeiskite į = change to
padarykite šiuos pakeitimus = Make these changes

#11
SmartiesKiller

    PrestaShop Addict

  • Members
  • PipPipPip
  • 542 posts
THX A LOT i think that help a lot of people.

#12
razaro

    PrestaShop Addict

  • Members
  • PipPipPip
  • 954 posts
Thanks a lot works fine :)
Just to add last part for me looks like this
    static public function iconv($from, $to, $string)
{
/*if (function_exists('iconv'))
return iconv($from, $to.'//TRANSLIT', str_replace('¥', '¥', str_replace('£', '£', str_replace('€', '€', $string))));
return html_entity_decode(htmlentities($string, ENT_NOQUOTES, $from), ENT_NOQUOTES, $to);*/
return $string ;
}


#13
seniz

    PrestaShop Newbie

  • Members
  • Pip
  • 8 posts
Sveiki,
nezinau kas ne taip bet as pastoviai gaunu sia klaida :

TCPDF ERROR: Some data has already been output, can't send PDF file

tad gal galetumet atmesti pataisytus failus kad galeciau palyginti kas cia ne taip?

email: seniz eta inbox.lt
~~~~
www.digitalas.lt
www.dsound.lt
www.elpa.lt
www.eurogps.lt

www.fallensword.eu

#14
Tomas LT

    PrestaShop Apprentice

  • Members
  • PipPip
  • 43 posts
o neveikia tas budas kur tik srifta nauja reikia pridet? nes cia matau daug darbelio ir neaisku ar gausis viskas.....

#15
mantoza

    PrestaShop Apprentice

  • Members
  • PipPip
  • 41 posts
Viskas čia veikia, tiesiog darykit kaip parašyta. Nes kitiem viskas čia gaunasi.

#16
abatisa

    PrestaShop Apprentice

  • Members
  • PipPip
  • 41 posts
:0
Gautis tai gaunas, tik dabar va kas išlenda.
Kai patvirtini uzsakyma, ish kar susigeneruoja saskaita pdf tarsi jau butum apmokejes ir nueina zinute emailu kad apmokejimas gautas. Zodziu kazkur cia dar makornas liko.

#17
mantoza

    PrestaShop Apprentice

  • Members
  • PipPip
  • 41 posts

From 1261409078:

:0
Gautis tai gaunas, tik dabar va kas išlenda.
Kai patvirtini uzsakyma, ish kar susigeneruoja saskaita pdf tarsi jau butum apmokejes ir nueina zinute emailu kad apmokejimas gautas. Zodziu kazkur cia dar makornas liko.

Kad čia nelabai susiję su PDF keitimu.

#18
abatisa

    PrestaShop Apprentice

  • Members
  • PipPip
  • 41 posts
na gal ir nelabai susiję, bet kai lietuviškų simbolių nebūdavo. Sąskaita susigeneruodavo tik tada kai per tvs patvirtindavai, kad mokėjimas gautas. dabar išsiunčia Order confirmation ir jau pdf sąskaita sugeneruojama. Na ji aišku negali būti sąskaitą, nes negautas apmokėjimas :(.
Kai rankomis per tvs padarai Payment accepted, gaujni dar katrą emailą Payment accepted.
na ten pirmu atveju gal užsakymo patvirtinimas tada ir išankstinė sąskaitą.

#19
Tomas LT

    PrestaShop Apprentice

  • Members
  • PipPip
  • 43 posts
paprasciausia iseitis nesiusti niekam jokiu saskaitu. as taip darau ir galvos neskauda.

#20
abatisa

    PrestaShop Apprentice

  • Members
  • PipPip
  • 41 posts
Koks pardos adresas?