title: Using a do_shortcode in wordpress via an ajax call
body: <p>I have the following piece of Ajax which calls a php file which intends to return the HTML content of a shortcode.</p>
  
  <p>The Ajax call looks like this :</p>
  
  <pre><code> var PostData = "Action=refresh-cart";
                       jQuery.ajax({
                         dataType: "text",
                         type: 'POST',
                         url : '&lt;?php echo plugins_url( 'class-booking-system/class-booking-process.php', dirname(__FILE__) );?&gt;',
                         cache: false,
                         data : PostData,
                         complete : function() {  },
                         success: function(data) {
                           //   jQuery("#loading-img").hide();
                              alert(data);
                             // jQuery("#join-class-div-3").html(data);
  
                          }           
                  });
  </code></pre>
  
  <p>The PHP looks like this :</p>
  
  <pre><code>&lt;?php
  require_once( ABSPATH . '/wp-includes/shortcodes.php' );
  
  if(isset($_POST['Action'])) {
          $Action = $_POST['Action'];
          if($Action == "refresh-cart") {
  
  
             echo do_shortcode('[woocommerce_cart]'); 
  
              }
          }
  ?&gt;
  </code></pre>
  
  <p>However when I call my Ajax method it returns an HTTP 500 - which I assume means the do_shortcode function was not found in this context. How can I give my plugin the ability to call this wordpress function via ajax?</p>