Opensourcepos: How can i take the custom field 1 to the top of add new item form.

Created on 22 Dec 2017  路  2Comments  路  Source: opensourcepos/opensourcepos

Background information

__IMPORTANT: If you choose to ignore this issue report template, your issue will be closed as we cannot help without the requested information.__

Please make sure you tick (add an x between the square brackets with no spaces) the following check boxes:

  • [x] Reporting an issue of an unmodified OSPOS installation
  • [x] Checked open and closed issues and no similar issue was already reported (please make sure you searched!)
  • [x] Read README, WHATS_NEW and UPGRADE
  • [x] Read the FAQ for any known install and/or upgrade gotchas (in specific PHP extensions installed)
  • [x] Read the wiki
  • [x] Executed any database upgrade scripts if an upgrade pre 3.0.0 (e.g. database/2.4_to_3.0.sql)
  • [x] Aware the installation code is in bintray (see README), and GitHub master is for developers only and therefore not complete nor stable

Installation information

  • OSPOS version is: 3.1.1
  • OSPOS git commit hash is: 4f5ad57
  • PHP version is: (e.g. 5.5, 5.6, 7.0, 7.1)
  • MySQL or MariaDB version is: (e.g. MySQL 5.5, MySQL 5.6, MySQL 5.7, MariaDB 10.0, MariaDB 10.1, MariaDB 10.2)
  • OS and version is: (e.g. CentOS 6.9, Ubuntu 16.4, Windows 10)
  • WebServer is: (e.g. Apache 2.2, Apache 2.4, Nginx 1.12, Nginx 1.13)
  • (If applicable) Docker installation:
  • (If applicable) Installation package for the LAMP/LEMP stack is: (e.g. WAMP, XAMPP)

Issue / Bug / Question / New Feature

I just want to know how can i take my custon field 1 to the top of the add new item form.If it is related to coding kindly tell me the file name and the code, please..I will be really thankful for any kind of help

question

All 2 comments

Is Custom 1 the only Custom field you are using? If so you can change the placement of application/views/items/form.php. Towards the bottom of the form you will see the following code.

<?php
        for ($i = 1; $i <= 10; ++$i)
        {
        ?>
            <?php
            if($this->config->item('custom'.$i.'_name') != null)
            {
                $item_arr = (array)$item_info;
            ?>
                <div class="form-group form-group-sm">
                    <?php echo form_label($this->config->item('custom'.$i.'_name'), 'custom'.$i, array('class'=>'control-label col-xs-3')); ?>
                    <div class='col-xs-8'>
                        <?php echo form_input(array(
                                'name'=>'custom'.$i,
                                'id'=>'custom'.$i,
                                'class'=>'form-control input-sm',
                                'value'=>$item_arr['custom'.$i])
                                );?>
                    </div>
                </div>
        <?php
            }
        }
        ?>

You can then place that code towards the top of the form. If you are using more Custom fields they will now also show.

Hey Odiea, Thanks for helping me out...I just pick up the custom field code and put it where i want.
Its works fine for me thanks a lot

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tekkeur picture tekkeur  路  4Comments

daN4cat picture daN4cat  路  5Comments

asakpke picture asakpke  路  4Comments

SteveIreland picture SteveIreland  路  3Comments

aterad picture aterad  路  3Comments