Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

mandatory module's parameters?


amd.miri

Recommended Posts

Hello everybody,

does somebody know how to create a mandatory parameter for a module in the admin site?

 

I explain myself : after installing a module (in my case ,it's a shipping module that I developed myself) , you are directed to the page of the installed module and when you click on the installed module, there are some personalized parameters on the right side to be filled in. so my question is there : how can I have a mandatory parameter? that means that if the parameter is not filled in , then the module should not work... and better the admin can have a message that there's a configuration missing. is that possible?

 

in my case my parameters are defined like this :

 

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('The Netherlands - Sender ID', 'MODULE_SHIPPING_NL_SENDER_ID', '', 'For using this module in The Netherlands, you need to register on test.nl', '6', '0', now())");

 

thanks in advance for your help

Miri

Link to comment
Share on other sites

There is no validation for what is entered of is is entered, however, the whole thing is a form.

 

Maybe the easiest would be to add a text saying what you want to say, as you already did in the field description

 

To prevent the module from working, you can add a condition for this either within function execute() (or quote()) or earlier, when the class is checking if the module is enabled or not , something like this

Link to comment
Share on other sites

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...