Jump to content

Adding a new field to order_conf.html


ro6er

Recommended Posts

Hi,

 

I'm trying to add a new field to order_conf.html

 

Here's what I've done so far:

 

I have a new payment module which I made from editing a tutorial I found online. This allow's customers to add an order number at the end of the transaction (don't ask why I'm doing it this way around it's the clients idea not mine so I'm stuck with it..). I can pop this field into the pdf by using some mysql, I don't really get the whole smarty/hook thing in prestashop which is where I think I'm falling down here.

 

 

Any way I read that if I edit mailalerts.php and add to // Filling-in vars for email

 

'{invoice_cardHoldername}' => $cardHoldername,

 

it will appear in my order_conf.html

 

But it doesn't, how do I call this?

 

Thanks in advance,

 

Roger

Link to comment
Share on other sites

Talking to myself..

 

So I figured I'm looking at the wrong file. I needed PaymentModule.php

 

In order_conf.html I used

{invoice_other}

as it doesn't seem to do a great deal (not much prestashop knowledge sorry) as my new field.

 

In PaymentModule.php I added the following:

 

$orderid1 = intval($order->id);

$result = mysql_query("SELECT * FROM ps_orders INNER JOIN ps_order_paymentcard ON ps_orders.id_order = ps_order_paymentcard.id_order WHERE ps_orders.id_order =  $orderid1") 
or die(mysql_error());  
                   $row = mysql_fetch_array( $result );

 

And in the

 // Send an e-mail to customer

I referenced it:

'{invoice_other}' => $row['cardholdername'],

 

And it kinda works.. Well it works if I replace

 

intval($order->id) with a number obviously but it just seems like I'm re-inventing the wheel just to echo a field which should be easy??? yes/no?

 

If I figure out what I'm doing wrong I'll post it here..

Link to comment
Share on other sites

Ok so if I use

 $orderid1 = intval($this->id);

in PaymentModule.php that worked.. Now for some reason the pdf that is sent via email doesn't have the new field I've added. If any one's reading this which file generates the pdf in the email? Is it PDF.php? As that works in terms of my field appearing from order's when I use that to get a pdf.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...