0
 $product_load = commerce_product_load(456);

 $product_load->uid = $GLOBALS['user']->uid; 

 $product_load->example[LANGUAGE_NONE][0]['tid'] = 123;

 commerce_product_save($product_load);

As I am doing this it is not updating commerce product and takes lot of time to load the page.

  • 2
    The syntax and methods are correct, you definitely have a field named example in there? It's not called field_example? – Clive Mar 3 '15 at 11:38
  • i am having example field in my DB but still it is not updating.when creating new product or manually added , it is updating – Ajay Reddy Mar 3 '15 at 11:39
0

You may have better luck using entity metadata wrappers' ->set() and ->save() functions.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.