Adding code to print template ?

savirtan

Avatar: savirtan

2007-01-19 10:54

Is it possible to add a PHP or Javascript code in template, so when printing order, there is line that is computed with PHP code ?

savirtan

Avatar: savirtan

2007-01-19 10:55

i use QC 2.0

idaryl

Avatar: idaryl

2007-01-19 18:53

Panos answered that one - http://opensolution.org/Quick.Cart/forum/?p=readTopic&nr=3587 - I think this is what you want

savirtan

Avatar: savirtan

2007-01-20 10:06

No

I want some code to add there. The code computes bankrefrence number from order id, but if i copy-paste the php code directly to sendOrderToClient.tpl then the code is printed ass text (whole code) to the email.

This is the code that calculates the bankrefrence (works when order ID is 3 digits):

 

<?php
$viite
=LaskeViite($iOrder);


$viite=LaskeViite($luku1);
echo 
$viite;

function 
LaskeViite ($luku){
$kerroin="7137137137137137137";

if (
TarkistaNumero ($luku)) {
$pituus=strlen(strval($luku) );
$apui=strlen(strval($kerroin) );

for (
$i=$pituus$i>=$i--) {
$tulo=$tulo+($luku[$i]*$kerroin[$apui]);
$apui--;
}
$tarkiste = (10 - ($tulo 10)) %10;
$viite=$luku.$tarkiste;
return 
$viite;
} else {

echo 
"Anna numero josta haluat viitenumeron laskea.";
}

}

function 
TarkistaNumero ($tarkistettavaluku){
if ( 
is_numeric($tarkistettavaluku) ) {
$pituus=strlen(strval($tarkistettavaluku) );
if (
$pituus>&& $pituus<20) {
return 
True;
} else {
echo 
"Antamasi luku on liian lyhyt tai pitkä. Luku voi olla 3-19 numeroa";
return 
False;
}
} else {
return 
False;
}
}
?>

savirtan

Avatar: savirtan

2007-01-20 10:27

and can i ad that code somewhere else, because the tpl doesn't seem to right place ?

idaryl

Avatar: idaryl

2007-01-20 10:34

and the language is?

savirtan

Avatar: savirtan

2007-01-20 10:37

Well its finnish, but is there a place for additional PHP code, so the server would compute it ?

savirtan

Avatar: savirtan

2007-01-20 12:19

Here is more simple example:



<?php
 
print("Hello World");
?>



How can i get that example php work in sendOrderToClient plugin ?

panos

No avatar

2007-01-20 12:38

can to me say what precisely you want to make because I did not understand??

because my English they are not good

panos >>>> My Freelance

savirtan

Avatar: savirtan

2007-01-20 12:50

Well my english is even worse :)

What i ment, was that i want to add some php (that calculates refrencenumber from order id) somewhere in sendOrderToClient plugin or tpl so when client gets email, there is also a line like this:

---- example ----
your bankrefrence number is:
1234
---- example ends ----

numbers 123 are the order id, and number 4 is confirm number calculated from numbers 123.

I have the code that calculates finnish refrence numbers, but now i need it to integrated to sendOrderToClient plugin.

Because i don't want to send handmade invoices anymore after every order.

panos

No avatar

2007-01-20 13:01

can i see him in the practice this in order to him I search better??

panos >>>> My Freelance

panos

No avatar

2007-01-20 13:22

XMMM can you send me your url in Info@ergalia.com ??

panos >>>> My Freelance

savirtan

Avatar: savirtan

2007-01-20 15:16

Link where ?

To shop where i'm testing ? Or where ?

There is not much to see, because i don't know much about code and i need that refrencenumber to calculated for email that sendOrderToClient plugin sends to customer.

panos

No avatar

2007-01-20 15:47

give to me your site URL

panos >>>> My Freelance

panos

No avatar

2007-01-20 17:21

Well.
you need help other us
you not give more elements

how how can help you ??!!!

I believe that it should you add something in the config/general.php
like

$config['sYOUR NAME CODE']

and afterwards you put in en_sendOrderToClient.tpl $config['sYOUR NAME CODE']

test and tell us

panos >>>> My Freelance

Back to top
about us | contact