Jump to content

Add custom flag to orders


hotice

Recommended Posts

Hello,

 

I want to add a new custom flag to orders. It should be visible only in admin panel.

 

So, until now I did this:

- added a new column in ps_orders table:

post-1228571-0-29718200-1495827825_thumb.jpg

 

- in AdminOrdersController.php, on line 67 I added is_paid,

- in AdminOrdersController.php, starting with line 153 I added:

'is_paid' => array(
                'title' => $this->l('Incasata'),
                'active' => 'status',
                'filter_key' => $alias.'!is_paid',
                'align' => 'text-center',
                'type' => 'bool',
                'class' => 'fixed-width-sm',
                'orderby' => false
            )

 With this changes, I have the new column in Orders table in admin panel:

post-1228571-0-79362700-1495827726_thumb.png

 

 

The only thing that does not work is changing the flag when clicking on V or X. Like changing the status of products, for example. Can you please help me on this?

 

Cheers,

Adrian

 

             

Link to comment
Share on other sites

When I modified AdminOrdersController.php I looked into AdminProductsController.php. I copied and modified the part of code that enables and disables the products:

$this->fields_list['active'] = array(
            'title' => $this->l('Status'),
            'active' => 'status',
            'filter_key' => $alias.'!active',
            'align' => 'text-center',
            'type' => 'bool',
            'class' => 'fixed-width-sm',
            'orderby' => false
        );

changed to this:

'is_paid' => array(
                'title' => $this->l('Incasata'),
                'active' => 'status',
                'filter_key' => $alias.'!is_paid',
                'align' => 'text-center',
                'type' => 'bool',
                'class' => 'fixed-width-sm',
                'orderby' => false
            )

The ajax is triggered (I can click on X or V and the page refreshes) but the database is not updated and I receive an error message: property "active" is missing in object Order.

 

Probably, I have to change something else too, but I don't know what and where...

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