Check the database first to see if the ID has been set, otherwise, fallback to querying the API based on product name.

This commit is contained in:
2023-09-10 20:56:53 -04:00
parent 07f3c69977
commit bb2e8ac538
2 changed files with 22 additions and 3 deletions

View File

@@ -22,7 +22,7 @@ if (!function_exists('add_hook_os_templates')) {
$cs = new ConfigureService();
$templates_data = $cs->fetchTemplates(
$cs->fetchPackageId($vars['productinfo']['name'])
$cs->fetchPackageByDbId($vars['productinfo']['pid']) ?? $cs->fetchPackageId($vars['productinfo']['name'])
);
if (empty($templates_data)) {
@@ -72,7 +72,6 @@ if (!function_exists('add_hook_os_templates')) {
];
$configurableoptions = $vars['configurableoptions'];
array_push(
$configurableoptions,
$osTemplates,