Injectable JavaScript Code for Lazada Seller Center to help sellers thru their day.
WIP BUT USEABLE. MORE COMING SOON!
Inject the JS and CSS into Lazada Seller Center using an Extension (Chrome: User JavaScript and CSS).
Refresh the page and the following button by default will be shown on Order Management page:
And this is what it looks like when it need to tell you something:
Note: The "Count Selected" button was pressed in order to make that message appear.
Here's the quick intro:
- A new method called
size
was added to theObject
object. This method is used to determine the length of an object. - A document manipulator object called
doc
was added. window.alertCounter
will be used to keep track of the alerts.Alert
,Routes
,Orders
,SelectOrders
,InteractionHandler
, andButton
object was added. Explainations below.InitOrderQueryPage
function was added and will be called if the current path is/order/query
About Button
Object
- To add or remove buttons, edit
Button.buttons
array. - Everytimne a button is clicked, the corresponding handler on
InteractionHandler
object will be called. - To add a new handler, just add another method/object/function to the
InteractionHandler
object and bind it to the button from the buttons array.
About Orders
Object
This is will WIP but useable. More information will be added soon!
- You can get all orders with
Orders.getOrders()
. - You can select an order from the returned object itself. Example:
Orders.getOrders()[0].select()
.
About SelectOrders
Object
This object is responsible for selective selection of the orders such as by date or by print status. Also responsible for counting and inverting the selection.
- The
Alert.alerts
is an Array which contains collections of JSON object that looks like the following:
{
"id": "25",
"timestamp": "1559834459",
"dateObject": "[object Date]",
"about": "OrderSelectedCount",
"type": "info",
"message": "Selected 5 out of 10 orders"
}
- Alerts will be rendered with the About and Timestamp title inside a bracket for easier identification.
- See the JS file for better understanding!
This system consist of a Routes
object and an anonymous function below it.
The anonymous function will check the current path and compare it with the path registered in the routes.
If the path matches, the function that was binded to the route will be called.
Note: Only important methods are documented. Please see the JS files for other methods!
Argument | Type | Required | Description |
---|---|---|---|
orderNumbers | Array | Yes | Array of order numbers to select |
Returns | JSON/Object | Information about selected and missed orders |
Argument | Type | Required | Description |
---|---|---|---|
- | - | - | - |
Returns | JSON/Object | Array of JSON Objects containing the order information |
Example order information:
{
"orderNumber": "276578706050832",
"isSelected": false,
"isPrinted": true,
"orderDate": "02 Jun 2019"
}