diff --git a/README.md b/README.md index c0a28ec..9036a36 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -# Wuunder opencart plugin \ No newline at end of file +# Wuunder opencart plugin + +Troubles caused by use of other ports than HTTP can be fixed but are not part of the standard implementation. diff --git a/catalog/controller/module/wuunder.php b/catalog/controller/module/wuunder.php index 219a6d0..0faeffb 100644 --- a/catalog/controller/module/wuunder.php +++ b/catalog/controller/module/wuunder.php @@ -14,9 +14,11 @@ public function webhook() $order_id = $_REQUEST['order']; $booking_token = $_REQUEST['token']; $data = json_decode(file_get_contents('php://input'), true); + if ($data['action'] === "shipment_booked") { $this->db->query("UPDATE `wuunder_shipment` SET label_id = '" . $this->db->escape($data['shipment']['id']) . "', label_url = '" . $this->db->escape($data['shipment']['label_url']) . "', label_tt_url = '" . $this->db->escape($data['shipment']['track_and_trace_url']) . "' WHERE order_id = " . $order_id . " AND booking_token = '" . $booking_token . "'"); $this->load->model("checkout/order"); $this->model_checkout_order->addOrderHistory($order_id, 3); + } } } -} \ No newline at end of file +} diff --git a/vqmod/xml/orders_list.xml b/vqmod/xml/orders_list.xml index f660f24..0ed715e 100644 --- a/vqmod/xml/orders_list.xml +++ b/vqmod/xml/orders_list.xml @@ -16,7 +16,7 @@ + if (is_null($order['booking_url']) || empty($order['booking_url'])) { ?> @@ -30,4 +30,4 @@ ]]> - \ No newline at end of file +