Fixed is_shipping
This commit is contained in:
@@ -14,6 +14,7 @@ class PreorderApicontroller extends mfBaseApicontroller {
|
||||
private $hausnummer_add_zusatz = false;
|
||||
private $exist_is_error = false;
|
||||
private $require_connectiontype = false;
|
||||
private $allow_unit_update = false;
|
||||
|
||||
protected function init() {
|
||||
$db = $this->db(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME);
|
||||
@@ -59,6 +60,9 @@ class PreorderApicontroller extends mfBaseApicontroller {
|
||||
if($campaign->require_connectiontype == 1) {
|
||||
$this->require_connectiontype = true;
|
||||
}
|
||||
if($campaign->allow_unit_update == 1) {
|
||||
$this->allow_unit_update = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -155,7 +159,7 @@ class PreorderApicontroller extends mfBaseApicontroller {
|
||||
}
|
||||
|
||||
$shipping_address = "customer";
|
||||
if(array_key_exists("is_shipping", $this->post['address']) && $this->post['address']['is_shipping']) {
|
||||
if(property_exists($this->post['address'], "is_shipping") && $this->post['address']->is_shipping) {
|
||||
$shipping_address = "address";
|
||||
}
|
||||
|
||||
@@ -236,6 +240,7 @@ class PreorderApicontroller extends mfBaseApicontroller {
|
||||
/*
|
||||
* search wohneinheit
|
||||
*/
|
||||
$update_unit = false;
|
||||
$where = "1=1 ";
|
||||
$unit = false;
|
||||
if(count($unit_search)) {
|
||||
@@ -277,6 +282,7 @@ class PreorderApicontroller extends mfBaseApicontroller {
|
||||
$res = $this->db()->query($sql);
|
||||
if($this->db()->num_rows($res)) {
|
||||
$unit = $this->db()->fetch_object($res);
|
||||
$update_unit = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -440,6 +446,14 @@ class PreorderApicontroller extends mfBaseApicontroller {
|
||||
return mfResponse::InternalServerError();
|
||||
}
|
||||
|
||||
// update wohneinheit if allowed
|
||||
/*if($this->allow_unit_update && $update_unit) {
|
||||
var_dump($unit_search);
|
||||
var_dump($unit);
|
||||
exit;
|
||||
}*/
|
||||
|
||||
|
||||
$return = ["code" => $preorder->ucode];
|
||||
if($addon_data) {
|
||||
$return["additionalData"] = $addon_data;
|
||||
|
||||
Reference in New Issue
Block a user