Jump to content

how add custom field in products prestashop?


Yichong

Recommended Posts

You must override the adminProduct to meet your ends.

 

The method to override is "__construct()", you must add "upc" to the field_list array. You can just Push it at the end or remplace reference via array_splice, that's up to you!

<?php

class AdminProductsController extends AdminProductsControllerCore
{

    public function __construct()
    {
        parent::__construct();
        $this->fields_list['upc'] = array(
            'title' => $this->l('upc'),
        );
    }
}

It should look like this in the end. Didn't test it, but since I'm pretty confident...(the force must be strong within me if that works).

 

If you use override, don't forget to regenerate your calss_index.

 

Sorry, I first answered in French, I'm giving support in 3 languages, I get mixed up sometime! Sorry!

 

Martin.

Edited by Martin Uker K (see edit history)
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...