Jump to content

need help to make a drop down menu for comet backup


Tobias_dcgr

Recommended Posts

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
 

dropdown i am trying to make.png

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated