HI
i am trying to make a drop down menu for comet backup so a costumer can choose what number of GB costumer want to buy.
i found out it is nor t part of the originally script form comet backup. i tired to change the script
FROM
// Apply storage vault quota if set
if (
!empty($params['configoptions']['storage_vault_quota_gb']) &&
!empty($profileData->Destinations)
) {
foreach (array_keys((array)$profileData->Destinations) as $destinationGUID) {
$profileData->Destinations->$destinationGUID->StorageLimitEnabled = true;
$profileData->Destinations->$destinationGUID->StorageLimitBytes = intval($params['configoptions']['storage_vault_quota_gb']) * pow(1024, 3);
}
} else if (
!empty($params['configoptions']['storage_vault_quota_tb']) &&
!empty($profileData->Destinations)
) {
foreach (array_keys((array)$profileData->Destinations) as $destinationGUID) {
$profileData->Destinations->$destinationGUID->StorageLimitEnabled = true;
$profileData->Destinations->$destinationGUID->StorageLimitBytes = intval($params['configoptions']['storage_vault_quota_tb']) * pow(1024, 4);
}
}
TO
// Apply storage vault quota if set
if (!empty($profileData->Destinations)) {
foreach (array_keys((array)$profileData->Destinations) as $destinationGUID) {
$profileData->Destinations->$destinationGUID->StorageLimitEnabled = true;
$storageQuotaGB = 0;
// Check for the presence of specific quota options and adjust the storage limit accordingly
if (!empty($params['configoptions']['storage_vault_quota_gb'])) {
$storageQuotaGB = intval($params['configoptions']['storage_vault_quota_gb']);
} elseif (!empty($params['configoptions']['storage_vault_quota_50gb'])) {
$storageQuotaGB = 50;
} elseif (!empty($params['configoptions']['storage_vault_quota_100gb'])) {
$storageQuotaGB = 100;
} elseif (!empty($params['configoptions']['storage_vault_quota_200gb'])) {
$storageQuotaGB = 200;
}
$profileData->Destinations->$destinationGUID->StorageLimitBytes = $storageQuotaGB * pow(1024, 3);
}
}
}
it works but not i the way i want it do to that i cant selected any other option then the first one in the Configurable Options and use the Option Name for some reason.
example if i use storage_vault_quota_gb in the Option Name and call it storage_vault_quota_gb | storage for the costumer.
the costumer will go to the store page and select 100gb in the option.
what the costumer will get is 0 gb do that it think that the costumer has not select anything.
if i change the Option Name to 'storage_vault_quota_50gb' it will only give costumer 50 gb in storage even then the costumer select 100gb.
is there any that got a explanation to the problem and a solutioncurrent functions.php