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

Related Questions

Changing library path with hook_library_info_alter

1  Asked on September 8, 2020 by extect

   

How can execute batch api over cron jobs

3  Asked on September 6, 2020 by johntang

     

How can I programatically add a shipping method to a store?

1  Asked on September 4, 2020 by vintorg

   

Local Dev .theme file not loading

1  Asked on September 4, 2020 by jmichael

   

Webform submitted data in views

5  Asked on August 31, 2020 by user3783391

 

Export and Import Taxonomies and Extra Fields

1  Asked on August 21, 2020 by monkeyuser

   

How to resolve lazy_builder error?

1  Asked on August 19, 2020 by usernameabc

     

redirect whole site to HTTPS

3  Asked on August 11, 2020 by naomisl

     

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP