Jump to content

PS8 How to add order note on delivery slip?


VBLED

Recommended Posts

  • 2 months later...
On 11/17/2023 at 2:22 AM, VBLED said:

How to add order note text on delivery slip?  it is in ps_orders table in database.

 

Hi,

You might need to customize the template files responsible for generating the delivery slip.

In the template file, you can retrieve order notes from the database. The order notes are stored in the ps_message table. You can use SQL queries or PrestaShop's built-in functions to fetch the necessary data.

Once you have retrieved the order notes, display them in the appropriate section of the delivery slip. You can use HTML and the template's existing structure to format and display the order notes.

For Example:

<?php
// Locate the section for order information in the template file

// Retrieve order notes
$orderNotes = Db::getInstance()->executeS(
    'SELECT `message` FROM `' . _DB_PREFIX_ . 'message` WHERE `id_order` = ' . (int)$order->id
);

// Display order notes
foreach ($orderNotes as $note) {
    echo '<p>Order Note: ' . $note['message'] . '</p>';
}
?>

Create a backup of the template file before making any modifications.

Thanks!

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...