php - opencart adding the new post input to $this->session -
in payment_method.tpl
of checkout section of opencart template have added input named (and id also) "cheque_number
".
in checkout.tpl
, have modified jquery code sends ajax request new input appended wrapped data , sent controller along other inputs.
however, don't know should in controller (which payment_method/validate
think, assign new input value $this->session gets added database too.
currently, though sent ajax, not known confirm , checkout controller , not saved in db.
things :
first
add (after doing necessary checks if empty or of required length etc)
$this->session->data['cheque_number'] = $this->request->post['cheque_number'];
second
in confirm.php
controller add following line before $this->session->data['order_id'] = $this->model_checkout_order->addorder($data);
$data['cheque_number'] = $this->session->data['cheque_number'];
and again before doing necessary validations may want to
third
now assuming edited order
(or other database table) include new field cheque_number
if edit addorder
function in model/checkout/order
such inserts cheque_number
along other fields
Comments
Post a Comment