diff --git a/class/business/eCommerceSynchro.class.php b/class/business/eCommerceSynchro.class.php index c8cd6eb..cad59ec 100644 --- a/class/business/eCommerceSynchro.class.php +++ b/class/business/eCommerceSynchro.class.php @@ -891,6 +891,7 @@ public function synchCategory($toNb=0) $this->eCommerceMotherCategory->fk_category = $dBCategorie->id; $this->eCommerceMotherCategory->fk_site = $this->eCommerceSite->id; $this->eCommerceMotherCategory->remote_id = $categoryArray['parent_id']; + $this->eCommerceMotherCategory->last_update = ''; // Create an entry to map importRootCategory in eCommerceCategory $result = $this->eCommerceMotherCategory->create($this->user); diff --git a/class/data/eCommerceCategory.class.php b/class/data/eCommerceCategory.class.php index b140e81..dc15163 100644 --- a/class/data/eCommerceCategory.class.php +++ b/class/data/eCommerceCategory.class.php @@ -97,7 +97,7 @@ function create($user, $notrigger = 0) $sql.= " " . $this->db->escape($this->fk_site) . ","; $sql.= " " . (isset($this->remote_id) ? intval($this->remote_id) : 0) . ","; $sql.= " " . (isset($this->remote_parent_id) ? intval($this->remote_parent_id) : 0) . ","; - $sql.= " '" . $this->db->idate($this->last_update) . "'"; + $sql.= " " . ($this->last_update > 0 ? "'" . $this->db->idate($this->last_update) . "'" : "NULL"); $sql.= ")"; $this->db->begin();