How to post them another script of wordpress?

Implement ajax cart, which connects to database and retrieves the id of the items in the current cart of the user, hence the need for Id to get title, thumbnail and other data of the post.
I understand the need to connect the file that generates the query and define the concept of $post.
June 10th 19 at 16:50
1 answer
June 10th 19 at 16:52
// indicate that we need at least WP
define('SHORTINIT', true);

// loadable environment WordPress
// WP does some checks and loads only the necessary DB connection
require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' );

global $wpdb;

Find more questions by tags WordPress