Hi,
Can anyone show me how to add custom field in admin order form?
I need a ref_no so that I can put a value when adding new order.
I have already create ref_no in database order table.
I just not sure how to modify in the files because OC2 now use API to create order.
Please teach me where to modify the files in admin and catalog.
Thanks,
onnets
Can anyone show me how to add custom field in admin order form?
I need a ref_no so that I can put a value when adding new order.
I have already create ref_no in database order table.
I just not sure how to modify in the files because OC2 now use API to create order.
Please teach me where to modify the files in admin and catalog.
Thanks,
onnets
Possibly, one of those could match:
Custom field invoice and email
http://www.opencart.com/index.php?route ... n_id=23447
Address Landmark (OCMOD)
http://www.opencart.com/index.php?route ... n_id=20806
Good Luck
Ernie
hitline.info/shop/
Custom field invoice and email
http://www.opencart.com/index.php?route ... n_id=23447
Address Landmark (OCMOD)
http://www.opencart.com/index.php?route ... n_id=20806
Good Luck
Ernie
hitline.info/shop/
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
I assume you are not willing to use the default custom_field functionality.
Basically, you need to read and write this field. The API will need just few lines to read it from the request and pass it to DB.
In catalog/controller/api/order.php
add this in public function add() {
In catalog/model/checkout/order.php
in public function addOrder($data) { edit the SQL query starting with this INSERT INTO `" . DB_PREFIX . "order to add this:
You will need to enter it in the editOrder function too.
To read it:
In catalog/model/checkout/order.php
in public function getOrder( edit the return array( and add this:
2nd place
In admin/model/sale/order.php
in public function getOrder( edit the return array( and add this:
In admin/controller/sale/order.php
in public function info() { after $this->load->language('sale/order'); add this
To display it:
In admin/view/sale/order.tpl add this where you like
If you are not sure if you did it right, do somein the controllers / models;
My strong recommendation is to do this in a vQmod XML and never directly to your php files to avoid trouble.
Good luck
Basically, you need to read and write this field. The API will need just few lines to read it from the request and pass it to DB.
In catalog/controller/api/order.php
add this in public function add() {
Code: Select all
if (isset($this->request->post['ref_no'])) {
$order_data['ref_no'] = $this->request->post['ref_no'];
} else {
$order_data['ref_no'] = '';
}
in public function addOrder($data) { edit the SQL query starting with this INSERT INTO `" . DB_PREFIX . "order to add this:
Code: Select all
, ref_no = '" . $this->db->escape($data['ref_no']) . "'
To read it:
In catalog/model/checkout/order.php
in public function getOrder( edit the return array( and add this:
2nd place
In admin/model/sale/order.php
in public function getOrder( edit the return array( and add this:
Code: Select all
'ref_no' => $order_query->row['ref_no'],
in public function info() { after $this->load->language('sale/order'); add this
Code: Select all
$data['ref_no'] = $order_info['ref_no'];
In admin/view/sale/order.tpl add this where you like
Code: Select all
<?php echo $ref_no; ?>
Code: Select all
var_dump( $data['ref_no'])
My strong recommendation is to do this in a vQmod XML and never directly to your php files to avoid trouble.
Good luck
All mods | OpenCart Bulk Related Products Ultimate Edition |GeoIP hide Prices / no add to cart by country| CSS override | Direct link to checkout / skip add to cart / buy now link | AUTO pilot - reward & purchase points
This is what gogoweb is pointing in the code but the problem is that the value did not save in the database.IP_CAM wrote: Address Landmark (OCMOD)
http://www.opencart.com/index.php?route ... n_id=20806
Any help you can give?
Thanks,
Stenno
Anyone can help? Please?OnNets wrote:Can anyone show me how to add ref_no in ADMIN ORDER FORM?
I need a ref_no so that I can put a value when adding new order.
I have already create ref_no in database order table.
I just not sure how to modify in the files because OC2 now use API to create order.
Please teach me where to modify the files in admin and catalog.
Thanks.
onnets
I have use this extension.IP_CAM wrote:Possibly, one of those could match:
Custom field invoice and email
http://www.opencart.com/index.php?route ... n_id=23447
Good Luck
Ernie
hitline.info/shop/
But I create custom fields, not all customers must be filled.
In the current code, With or without fill in this field will display {custom_field_1} the data.
This is an obsession.
We hope that if do not fill is hidden fields, May I ask anybody know how to fix it?
Who is online
Users browsing this forum: No registered users and 437 guests