A Function Written for BigCommerce using JS and PHP

Job ID: 36848559

Budget: $30 – $250 USD

I have a chat tab/window written in JS. I need just the function written that will check if the person is logged in on to the BigCommerce store it is running on. If they are logged in I need to get a unique identifier (i.e. user id, email, or such.) I also want to grab their past orders, customer info, and current cart contents. If they are not logged in and are browsing the BigCommerce site as a guest I need to give them a non sequential unique ID that I will store in their cookies.

This needs done in the JS of the chat window. I can not modify any BC files.

Outline:
1. User submits the JS form.
2. (This is the function I need written. It can be done in the JS that is running on the BC page. If needed we can send a value to the server and use whatever. PHP, Python...) Check if user is logged in, get unique ID, past orders, current cart contents, and customer info, or create a unique ID.
3. User prompt loads a PHP script that processes the User Prompt and returns a response.
4. Response is displayed in the chat window.
Related categories: PHP JavaScript jQuery / Prototype BigCommerce