$page ]; // Merge base and custom params $allParams = is_array($params) ? array_merge($baseParams, $params) : $baseParams; return self::appendQueryParams($baseUrl, $allParams); } public static function getApiUrl($path = '', $params = null): string { $url = Str::of($path)->startsWith('/') ? Helper::getRestInfo()['url'] . $path : Helper::getRestInfo()['url'] . '/' . $path; if (is_array($params)) { return self::appendQueryParams($url, $params); } return $url; } public static function getDashboardUrl(string $path, $params = null): string { $url = admin_url('admin.php?page=fluent-cart#/'); if (is_array($params)) { return $url . self::appendQueryParams($path, $params); } return $url . $path; } public static function getCustomerDashboardUrl($path): string { $url = (new StoreSettings())->getCustomerProfilePage(); $url = rtrim($url, '/'); if ($path) { // add the extension with a leading slash $url .= '/' . rtrim($path, '/'); } return $url; } public static function getCustomerOrderUrl($uuid): string { $storeSettings = new StoreSettings(); $customerPage = $storeSettings->getCustomerProfilePage(); if ($customerPage) { return site_url("/{$customerPage}/order/{$uuid}"); } else { return self::getFrontEndUrl(); } } }