Naguro_Order_Place_Request

The WooCommerce Naguro Connect Naguro Order Place Request class.

Defined (1)

The class is defined in the following location(s).

/includes/naguro/requests/class-order-place-request.php  
  1. class Naguro_Order_Place_Request extends Naguro_Request { 
  2. public function output() { 
  3. $session = new Naguro_Session_Model( $this->params['session'] ); 
  4. $product = wc_get_product($session->get('product_id')); 
  5. $session_data = array( 'naguro_session' => array( 
  6. 'id' => $session->get_id(),  
  7. 'preview' => $session->get('order_preview'),  
  8. ) ); 
  9. WC()->cart->add_to_cart( $product->id, 1, '', '', $session_data ); 
  10.  
  11. $output_array = array( 
  12. 'redirect_url' => WC()->cart->get_cart_url(),  
  13. 'success' => true,  
  14. ); 
  15.  
  16. echo json_encode($output_array); die();