order

Drupal Commerce: Get order quantity from order_id with sample code

In Drupal, commerce order contains multiple products. These products are attached to the line item to the orders. The line item table holds the information about the quantities and other information. The below is the simplest code to get the quantity of the order with different products.

Drupal 7: Commerce POS Accessing Order object

The Drupal Commerce Commerce POS module help us to achieve Point of Sale concept. The Drupal Commerce POS differs from normal commerce order. On Commerce POS they have implemented their own Order management rather than using Commerce Order. This has been achieved by its own interface and classes. On Completing each order, the order is again mapped to normal commerce order.

Drupal 7 : Loading Order Details from LineItem ID

The Line Items in Drupal commerce used to refer the product in Order. Using the Line Item id we can able to load order details. The function commerce_line_item_load() will contains respective order ID of the order. We can able to get the order details from order ID using the function commerce_order_load().

Drupal 7: Commerce Order Status update programmatically

In Drupal, commerce Orders are acted as a separate entity. The order has different status during each stage on purchasing. These status updates are taken place during the order checkout process. It possible us to update order status programmatically from one state to others.

Drupal 7: Programatically place a Commerce Orders with sample code

In Drupal 7 using the core functions of commerce, we can place orders programmatically. Using the function "commerce_product_line_item_new()" and "commerce_line_item_save()" we can add item to cart. The function "commerce_order_save()" will place all line items into order. The below is the sample code which demonstrates.