ZiedDams Posted August 8, 2022 Share Posted August 8, 2022 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 More sharing options...
ZiedDams Posted August 8, 2022 Author Share Posted August 8, 2022 Solved using this public function hookDisplayOrderConfirmation($params){ $order = $params['order']; $cart = new Cart($order->id_cart); $weight = $cart->getTotalWeight(); } Hope it helps anyone. 1 Link to comment Share on other sites More sharing options...
ventura Posted August 8, 2022 Share Posted August 8, 2022 public function hookDisplayOrderConfirmation($params){ $order = $params['order']; $cart = new Cart($order->id_cart); $weight = sprintf('%.3f ' . Configuration::get('PS_WEIGHT_UNIT'), (float) $cart->getTotalWeight()); } 1 Link to comment Share on other sites More sharing options...
ZiedDams Posted August 8, 2022 Author Share Posted August 8, 2022 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now