Jump to content

How To get Order Weight From Order Object


ZiedDams

Recommended Posts

Hi ,

I'm using the Hook

displayOrderConfirmation

and it's giving me the Order Object using this

public function hookDisplayOrderConfirmation($params){
$order = $params['order'];

and i want to get the weight of this Order ,  Any Help Please !

Link to comment
Share on other sites

        public function hookDisplayOrderConfirmation($params){
            $order = $params['order'];
            $cart = new Cart($order->id_cart);
            $weight = sprintf('%.3f ' . Configuration::get('PS_WEIGHT_UNIT'), (float) $cart->getTotalWeight());
        }

 

  • Like 1
Link to comment
Share on other sites

Just now, ventura said:
        public function hookDisplayOrderConfirmation($params){
            $order = $params['order'];
            $cart = new Cart($order->id_cart);
            $weight = sprintf('%.3f ' . Configuration::get('PS_WEIGHT_UNIT'), (float) $cart->getTotalWeight());
        }

 

SOLVED

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