Jump to content

Product Custom Fields


Recommended Posts

Wondering if someone can help?  I have no idea how to program, I have been going through discussions and looking at current setup so I can try to modify.  I have some custom fields in a module...2 work fine they were existing.  The 3rd one I created.  I can't get Select Options to work from drop down.  The rest shows up.  Not sure if my code is right either.

Any help much appreciated.

$username = array(
                'fieldname' => $row['custom_field_username'],
                'fieldtype' => 'text',
                'description' => '(Leave empty if you want system to generate randomly) 8 - 28 Characters in length, NO special characters',
                'regexpr' => "/^[a-zA-Z0-9]{8,28}/",
                'required' => '',
                'showorder' => 'on',
                'showinvoice' => 'on',
            );
            $passwordfield = array(
                'fieldname' => $row['custom_field_password'],
                'fieldtype' => 'password',
                'description' => '(Leave empty if you want system to generate randomly) 8 - 28 Characters in length, NO special characters',
                'regexpr' => "/^[a-zA-Z0-9]{8,28}/",
                'required' => '',
                'showorder' => 'on',
                'showinvoice' => 'on',
            );
            
            $yourdevice = array(
                'fieldname' => 'Your Device',
                'fieldtype' => 'dropdown', 
                'fieldoptions' => 'Android Box, Firestick',
                'description' => 'What device are you using?',
                'regexpr' => "",
                'required' => 'on',
                'showorder' => 'on',
                'showinvoice' => 'on',
            );
            
                    $custom_fields = array($row['custom_field_username'] => $username, $row['custom_field_password'] => $passwordfield, 'Your Device' => $yourdevice);

image.png.ad290925c766ac0e62061b87d138cd1a.png

Link to comment
Share on other sites

Yes.  I am trying to auto populate custom fields when i select module.  So far everything shows up except select options.  Of course i can manually add select options but what to auto populate it.   So is my code correct for "your device"?  

 

 

 

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