getDb()->insert( WordpressDb::getInstance()->getDb()->prefix . AEIDN_TABLE_STATS, ['date' => date('Y-m-d'), 'product_id' => $id, 'quantity' => 1] ); $link = str_replace('&', '&', $link); header('Location: ' . $link . ''); exit(); } public function registerHit() { if (!is_admin()) { global $post; $postId = (int)$post->ID; if ($postId <= 0) { return false; } WordpressDb::getInstance()->getDb()->insert( WordpressDb::getInstance()->getDb()->prefix . AEIDN_TABLE_STATS, ['date' => date('Y-m-d'), 'product_id' => $postId] ); } } public function addToCart($cartItemKey = '', $productId = 0, $quantity = 0) { if (!is_admin()) { $postId = $productId; if ($postId <= 0) { return false; } WordpressDb::getInstance()->getDb()->insert( WordpressDb::getInstance()->getDb()->prefix . AEIDN_TABLE_STATS, ['date' => date('Y-m-d'), 'product_id' => $postId, 'quantity' => $quantity] ); return true; } } }