-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes2
75 lines (50 loc) · 2.21 KB
/
notes2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
use admin panel to empty modules from homepage. we will write our own.
New version has the modules inside the extensions folder. This creates 3-deep routes.
login form is in account/login.tpl
logout page is in account/logout.tpl
the main account page is account/account
/* get rid of wishlist */
https://forum.opencart.com/viewtopic.php?t=32955
and cntrlshiftF
right side bar
\openCart\catalog\view\theme\default\template\extension\module\account.tpl:
Will force login:
in catalog\controller\common\home
if (!$this->customer->isLogged()){
$this->response->redirect($this->url->link('account/login', '', 'SSL'));
}
Your controller should have this sorta thing
public function updateOrderById(){
$newVal = $_POST['newVal'];
$newTitle = $_POST['of_title'];
$order_id = $_GET['order_id'];
$this->load->model('sale/order');
$this->model_sale_order->setOrderById($newTitle,$newVal,$order_id);
}
you post to that by ajax
$(".tracking_edit").on("click", function(){ //when we click edit/save button
var trackingNumber = $(this).closest(".order_row").find(".tracking_number_entry").val(); //get the input box value
var entry_container = $(this).closest(".order_row").find('.tracking_entry_container'); //select that row
(only need the token in admin)
var token = "<?php echo $_GET['token']; ?>"; //admin api token
if (toggle.html()=="save"){ //if we've clicked on save button
$.ajax({
type: "POST",
url: 'index.php?route=sale/order/updatetracking&token=' + token + '&order_id=' + order_id,
data: { tracking_number: trackingNumber,
tracking_comp: trackingCompany
}, //key value pairs in JSON format
crossDomain: true, //possibly not necessary
success: function (msg) {
entry_container.hide();
tracking_display_numb.show();
}
});
};
// else
$(this).html("save"); //turn the toggle to save
cancel.show();
and in the model
public function setTracking($trackingNum,$trackingComp,$order_id){
$this->db->query("UPDATE " . DB_PREFIX . "order SET shipping_tracking = '" . $trackingNum . "',shipping_tracking_company = '" . $trackingComp . "' WHERE order_id = '" . (int)$order_id . "'");
}