Editor - Orders - Order Details
In this view, you can see details of a specific order in which you can use all the information of this accessing your order model. This view also lists the states that can exist in an order, in the status variable, which will then be used to change the status of an order.
Utility functions
getOrderState(status)
: Returns the state of the order in text depending on the language. status must be an Integer.changeStatus(order, status)
: change the status of an order to any desired state. order is a JSON with the order and status the state to which you want to change, an integer.changeDriver(order, driver)
: this function allows assigning or changing a driver in an order. order is a json that contains the order, driver, the id of the driver, this must be an integer.calcSubtotal(order)
: calculates the total sum of the products and their ingredientscalcTax(order)
: calculate the tax payable in an ordercalcServiceFee(order)
: Calculate the service fee based on the subtotal of the order and its percentage value.calcriverTip(order)
: Calculate the driver's tip based on the subtotal of the order based on the percentage assigned. This only returns value for delivery type orers.calcTotalOrder(order)
: calculates the total order including discounts if they exist, tips and other fees.
Example of base theme
1 Contains the model order.status with the action ng-change using the function changeStatus(order, order.status)
. To list the options that can be selected ng-repeat is used with the argument “state in status”
where the value of an option selected is state.id
.
2 Contains the model order.driver_id
with the action change using the function changeDriver(order, order.driver_id)
. To list the options that can be selected ng-repeat is used with the argument “user in filteredDrivers”
where the value of an option selected is user.id
.
3 The customer information and models used are order.customer.name
, order.customer.name
, order.customer.email
, etc.
4 The business and some order information and models used are order.business.name
, order.business.phone
, order.paymethod.gateway
, etc
5 Here the order porducts are listed with ng-repeat="product in order.products"
6 product.quantity
inside the ng-repeat
7 product.name
inside the ng-repeat
8 calcTotalProduct(product)
inside the ng-repeat
9 calcSubtotal(order)
10 calcTax(order)
11 order.delivery_zone_price
12 calcDriverTip(order)
13 calcServiceFee(order)
14 calcTotalOrder(order)
Updated almost 6 years ago