Jump to content

How are manufacturers added/saved?


Recommended Posts

Hi there!

I'm adding a field to the add/update form for manufacturers. This is what I added so far:

class AdminManufacturersController extends AdminManufacturersControllerCore {

    public $shopOptions = array();

    public function __construct() {
        parent::__construct();

        global $shopOptions;
        $shopSQL = 'SELECT id_shop, name FROM '._DB_PREFIX_.'_shop WHERE active=1';
        $result = Db::getInstance()->ExecuteS($shopSQL);
        foreach ($result as $row) {
            $shopOptions[] = array(
                "id" => (int)$row["id_shop"],
                "name" => $row["name"]
            );
        }

    }

    public function renderForm()
    {
        global $shopOptions;
        $this->fields_form_override = array(
             array(
                 'type' => 'checkbox',
                 'label' => 'Shop',
                 'name' => 'shop_select',
                 'desc' => 'Choose The Shops This Manufacturer Applies To',
                 'values' => array(
                     'query' => $shopOptions,
                     'id' => 'id',
                     'name' => 'name'
                 ),
             ),
         );
        return parent::renderForm();

    }

}

It adds those boxes to the form successfully.

 

I cannot however figure out how this form saves its data... I can see that the forms submits to index.php but that file seems to be mostly empty.

 

Can anyone explain to me where the AdminProductsController sends its form data to?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...