Jump to content

Edit History

webprog

webprog

Hello, there is no field NOTE in table ORDERS in early prestashop 1.7 versions. The NOTE field have appeared in later prestashop 1.7 versions. Then, you can try this code:

if (!empty($message) && Validate::isCleanHtml($message)) {
            // Retrieve the last created order for the current cart
            $order = Order::getByCartId((int)$id_cart);

            if ($order) {
                // Sanitize the message
                $cleanMessage = strip_tags($message, '<br>');

                // Update the note field in the orders table
                Db::getInstance()->update(
                    'orders',
                    ['note' => pSQL($cleanMessage)],
                    'id_order = ' . (int)$order->id
                );
            }
        }

 

 

webprog

webprog

Hello, there is no field NOTE in table ORDERS in prestashop 1.7 version. The NOTE field have appeared in prestashop 8.x

 

 

webprog

webprog

Hello, there is no field NOTE in table ORDERS in prestashop 1.7 version. The NOTE field have appeared in prestashop 1.8.

 

 

webprog

webprog

Hello, you can try:

if (!empty($message) && Validate::isCleanHtml($message)) {
            // Retrieve the last created order for the current cart
            $order = Order::getByCartId((int)$id_cart);

            if ($order) {
                // Sanitize the message
                $cleanMessage = strip_tags($message, '<br>');

                // Update the note field in the orders table
                Db::getInstance()->update(
                    'orders',
                    ['note' => pSQL($cleanMessage)],
                    'id_order = ' . (int)$order->id
                );
            }
        }

 

×
×
  • Create New...