Jump to content

Bul action for order list.


pravinsiddhi

Recommended Posts

Hello,

 

I need some help to add bulk action on order list page in dashboard. I implement all code and bulck action functionality working but i get one issue and try to resolve it but not solve it.

 

After my custom bulk action call when i click on pagination button always click last bulk action. I add two custom bulk action on order list for generate pdf and generate delivery slip.

 

I trash full code and find out when my bulk action call that store in form action attribute so when i call other action lick click on pagination number for submit again with previous action which already set on form action.

 

Any body know how to solve this issue?

 

AdminOrdersController.php in override folder

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

$this->bulk_actions = array(
            'printDeliverySlips' => array('text' => 'Print Delivery Slips', 'icon' => 'icon-truck'),
            'printOrderInvoice' => array('text' => 'Print Order Invoice', 'icon' => 'icon-file-text')
        );

}
protected function processBulkprintOrderInvoice(){
        //echo "testing";
        //die;
        if (is_array($this->boxes) && !empty($this->boxes))
        {
            $reult = OrderInvoice::getByOrderIdInterval($this->boxes);
             if (count(OrderInvoice::getByOrderIdInterval($this->boxes))) {
                    Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf').'&submitAction=generateOrderInvoicesPDF&orderids='.urlencode(json_encode($this->boxes)));
                }
        }
    
        //Tools::redirectAdmin($this->context->link->getAdminLink('AdminOrders'));
    }
    protected function processBulkprintDeliverySlips(){
        if (is_array($this->boxes) && !empty($this->boxes))
        {
             if (count(OrderInvoice::getByOrderIdDeliveryInterval($this->boxes))) {
                    Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf').'&submitAction=generateOrderDeliveryInvoicesPDF&orderids='.urlencode(json_encode($this->boxes)));
                }
        }
        //Tools::redirectAdmin($this->context->link->getAdminLink('AdminOrders'));
    }
Edited by pravinsiddhi (see edit history)
Link to comment
Share on other sites

  • 10 months later...

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