Jump to content

How to display the total number of item purchased in an order


gk

Recommended Posts

On BackOffice -> Orders page where I see details of individual orders, I would like to see the total number of items purchased by the customer. So if the customer purchase 1 item of A, 2 items of B, and 5 items of C, I would like to have the total (8) displayed.
Sounds like a simple thing to do, but I couldn't find any info in the forum already, so if anyone knows what changes to make to support this, I'd appreciate it very much.

Link to comment
Share on other sites

There may be a better way of doing this, but this will work.

Open "admin/tabs/AdminOrders.php"

Find:

                       $tokenCatalog = Tools::getAdminToken('AdminCatalog'.intval(Tab::getIdFromClassName('AdminCatalog')).intval($cookie->id_employee));



Replace with:

                        $tokenCatalog = Tools::getAdminToken('AdminCatalog'.intval(Tab::getIdFromClassName('AdminCatalog')).intval($cookie->id_employee));
                       $totalProducts = 0;



Find:

                        }
                   echo '

* '.$this->l('According to the group of this customer, prices are printed:').' '.($order->getTaxCalculationMethod() == PS_TAX_EXC ? $this->l('tax excluded.') : $this->l('tax included.')).(!Configuration::get('PS_ORDER_RETURN') ? '

'.$this->l('Merchandise returns are disabled') : '').'';



Replace with

                            $totalProducts += (intval($product['product_quantity']) - $product['customizationQuantityTotal']);
                       }
                   echo '

Total products:
'.$totalProducts.'
 


* '.$this->l('According to the group of this customer, prices are printed:').' '.($order->getTaxCalculationMethod() == PS_TAX_EXC ? $this->l('tax excluded.') : $this->l('tax included.')).(!Configuration::get('PS_ORDER_RETURN') ? '

'.$this->l('Merchandise returns are disabled') : '').'';

Link to comment
Share on other sites

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