TransWikia.com

I have issue with commerce_order_load_multiple function

Drupal Answers Asked by user3686276 on October 1, 2020

The way i am using this function is

foreach ($mms as $mm) {
$orders_of_user += commerce_order_load_multiple(array(), array('uid' => $mm->uid, 'status' => 'cart'));
}

But i am not getting anything output from this and when i use static value of integer in place of uid i am getting result..

 $orders_of_user += commerce_order_load_multiple(array(), array('uid' => 421, 'status' => 'cart'));

I don’t understand what causing the problem in foreach

One Answer

when i use static value of integer in place of uid i am getting result

Logically speaking, that can only mean that $mm->uid doesn't contain what you think it does.

Install the devel module and use the dpm function to inspect the var:

foreach ($mms as $mm) {
  dpm($mm);
}

That should tell you what's going wrong.

Answered by Clive on October 1, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP