Jump to content
  • 0

Package Options And Custom Fields / Generate From Code? [Question]


Question

Posted

So i'm currently creating a module similar to the DigitalOcea module but for a different service, and one of the things I'd like to do is streamline alot of the product creation via code. Currently, thanks to PackageFields, we can set up custom fields for the main package. But I can't figure out how to do this for "Packages=>Options".

 

Right now, I have to by hand, click Create Group, call it Operating Systems, then "Create Option", choose Dropdown as type, and then for each entry list the label and the API's ID for that particular OS. In code during checkout, I'll then parse the OS-id that's sent and execute accordingly. BUT I have to know the OS-id's before hand. and when I say, "I have to know", I mean you the end user who's not a developer and just installing my module to use. I already have the API so that I can take care of letting the end user get the correct results, I just don't know how to code into the Options view fields.

 

Nothing in here https://docs.blesta.com/display/dev/Module+Methods appears relevant to that page either. 

 

Any help or advise would be appreciated. 

 

If it helps, the page I'm talking about is /admin/package_options/add/

1 answer to this question

Recommended Posts

  • 0
Posted

Package options are module independent, so you can create options for any purpose, be it for use by a module, multiple modules, or no modules at all. Modules do not have a way of pre-building, or making available, supported option values, like OS IDs retrieved via the API, when adding a package option in Blesta.

 

The page to create/update package options only defines fields to be entered by a manual process, so users will need to have apriori knowledge of the available OS IDs so they can enter them themselves. As long as there is documentation available that describes your module's supported package options (like SolusVM), users should be able to do so without much trouble. However, you could create your own automated process for creating the module's package options by creating a plugin in Blesta.

Join the conversation

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

Guest
Answer this question...

×   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.

Loading...
×
×
  • Create New...