php - Different Order Id for order from multiple restaurants -
i trying place order multiple restaurants. when place order, same order id adding in database orders. have is, when user places order multiple restaurants, have separate order id them.
here code:
$order_id = $this->generateneworderid(); foreach ($cart_content->rest_item_list $item) { $td_data['order_id'] = $order_id; $td_data['item_id'] = $item->id; $i_details = $this->restaurant_menu_items_model->get_item_detail_by_id($item->id); $td_data['item_name'] = $i_details->name; $td_data['item_price'] = $i_details->price; $td_data['item_quantity'] = $item->quantity; }
well stands reason, since you're generating order id once, outside loop, not once per order. move inside loop:
foreach ($cart_content->rest_item_list $item) { $order_id = $this->generateneworderid(); $td_data['order_id'] = $order_id; //... etc ...
Comments
Post a Comment