0

In my site, I am using drupal commerce in order to run a shop.

In my plan, a new node must be created when an order is completed. (paid)

Also in new node creation I want to use the order's field values. (for example order id, or username (and uid ) who ordered , entity values & etc )

Please help me. How can I setup this solution? can I do this process via "Rules" or I have to create a module and use hook functions?

Thanks a lot for your guidance.

  • you should preferably create a custom code – harshal Nov 7 '13 at 18:22
  • you mean custom module programming? – Mehrdad201 Nov 7 '13 at 18:41
1

Yes, its time to create a module, and use these nice hooks Commerce API is offering to interfere to the regular execution of things in your Drupal site.

After getting the big picture, creating a node will be as easy as this first script. So in a hook which is invoked whenever an order is complete, you would add the node creation code.

| improve this answer | |
  • yes, I am working on it. I will share my codes as soon as I can. – Mehrdad201 Nov 7 '13 at 20:43
  • I am still working on it. Automatic node creation is completed when a new order is registered and paid. But I need to modify specific nodes when an order is modified. Can you tell me what is the hook name when a commerce order is modified by user? – Mehrdad201 Nov 8 '13 at 15:00

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.