public function add($autodate = true, $nullValues = false) { $context = Context::getContext(); $id_shop = $context->shop->id; if ($this->position <= 0) { $this->position = Item::getHigherPosition($this->id_block) + 1; } $res = parent::add($autodate, $nullValues); if ($this->id_block == 0) { $res &= Db::getInstance()->execute(' INSERT INTO `' . _DB_PREFIX_ . 'advance_topmenu_main_shop` (`id_shop`, `id_item`) VALUES(' . (int) $id_shop . ', ' . (int) $this->id . ')'); } return $res; }