Hi Velo Legends ,
I want to get pickup location from user on Cart Page.
And I need to Push that data and the OrderID to Database.
I can create a Lightbox which is having Dropdown and I can trigger On Cart Page Load/Ready.
I can Save Data in Seesion Memory.
-----For Backend
I can Trigger a OnNewOrder() Api From Backend .
But How i can Connect it Together and Save data in DB.
Actual requirement :
My client has multiple pickup stores,
User needs to select one pickup location and That data should save in some where else.
Have Tried wix-restaurant but require feature in Request.
Planned to use OnNewOrder() Method
But i cant(dont know) communicate between front-end and Backend.
Can anyone help me out on this?
And Open for other possible ideas too.
Can give you more clarity if any
Thanks in advance
You have a back-end.jws-file where you have stored your back-end-code
Let it be → function xxx(){…});
All functions in backend are—> export-functions.
And then you have to import that backend on your frontend, how???
import { function_name of backend_function here} from ‘backend/backend_file-name_here’;
Now you have connected to your back-end-function.
Now using the back-end-function…
$w.onReady(async()=>{
let zzz = await xxx(); console.log(xxx);
});
Thanks for your valuable response.
But the OnNewOrder() (under Wix-store, Events)Method Will trigger only when order is Placed .
It event based method.
Not common Backend functions.
To which API do you reffer? Can you post the right link to the right API ?
https://www.wix.com/velo/reference/wix-stores-backend/events/onneworder
And Please read the requirement
Open for another creative ideas TOO
Thanks for your Valuable Response.
So—> like described in the API-DOC → you place that code inside a …
→ event.js-file (Public-File)

@russian-dima
Thanks a lot.
Let me check and Get back to you
Thanks again Velo-Ninja … 
@kottravaipaalai @russian-dima events.js resides on the backend, events’ handlers you declare in this document - in the public space - will never be triggered at all.
@ahmadnasriya
Thanks for your valuable response.
Is there any alternative way to accomplish my requirement ?
Actual requirement :
My client has multiple pickup stores,
User needs to select one pickup location and That data should save in some where else.
Thanks again for you guys
Am waiting for solution, My client sitting on my head.
Anyone please help me out
Thanks again
Hi @kottravaipaalai
The short answer to your question: You cannot call frontend code from the backend , only the opposite is correct .
My solution is to create a database for the storage, defining the name, value, and type, and store all your data on the cloud, only this way, you can access your values from the backend.
Simple example:
On your cart, get the current user ID.
// Frontend: Cart Page
import { currentUser } from 'wix-users';
import { save } from 'wix-data';
$w.onReady(async () => {
let cache_id = null
// When the location is changed, create a cache object and save it.
$w('#location').onChange(event => {
const location = event.target.value;
const item = {
user: currentUser.id,
location
}
if (cache_id) { item._id = cache_id }
save('Cache', item).then((updated) => cache_id = updated._id)
})
})
Backend: events.js
import wixData from 'wix-data';
export async function wixStores_onNewOrder(event) {
const user_id = event.buyerInfo.id
const location = await wixData.query('Cache').eq('user', user_id).ascending('_createdDate').limit(1).find().then((x) => {
if (x.length > 0) {
return x.items[0].location;
}
return null;
})
if (location) {
// Run your code here
}
}
Hope this helps~!
Ahmad
Thank you very much for your help
Let me implement this and get back to you
Thanks a lot 
@kottravaipaalai You’re welcome
… LMK how it goes.
@ahmadnasriya
Do i need to create Database “Cache” ?
@ahmadnasriya Am facing Error. Can you tell me what i need to now please ?
@kottravaipaalai Yes you need to create that DB, how could you retrieve the details later on the backend without it?
Did you import it?
import { save } from 'wix-data';
@ahmadnasriya
Oh ok, i am too late
, i should never sleep xD.
Thanks for good info Ahmad. Without that info, i just would try to find a way, which is impossible, as it seems to be. Good to know.