Jump to content

Save new field in order table in prestashop


sabreen22

Recommended Posts

I need to pass data of new added text box in checkout page and save it in order table in new column i searched a lot but i didn't find way to make that. I need to know which page that save order in database and I need to know how to pass text box value to this page and save this value in table order. I wish to find solution here and thanks in advance

Link to comment
Share on other sites

First thanks to reply :)  ... but i don't know how to send the value from checkout page to order controller .?!!

that's what i made 

i added textbox in checkout page 

then i add variable x to   class/order.php

then in paymentModule.php i set this line  under function validateorder()  

 

$order->x= '11';

 and value 11 is saved in order table in x column but i need to know how to send the value from checkout page not set the value in code

sorry about bade English :mellow: and thanks in advance  :)

Link to comment
Share on other sites

it isn't solve my problem  :(  so any body know how to send value from checkout to to paymentmodule.php in function validateorder()

this function contains lines that fill order

 $order->id_customer = (int)$this->context->cart->id_customer;
 $order->Payedcash = '11'; //this line that i added and 11 saved in db but i need to pass this value
 $order->id_address_invoice = (int)$this->context->cart->id_address_invoice;
 $order->id_address_delivery = (int)$id_address;
 $order->id_currency = $this->context->currency->id;
 $order->id_lang = (int)$this->context->cart->id_lang;
 $order->id_cart = (int)$this->context->cart->id;
 $order->reference = $reference;
 $order->id_shop = (int)$this->context->shop->id;
 $order->id_shop_group = (int)$this->context->shop->id_shop_group;
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...