1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  function SubmitEnquiry($data, $form) {
  
    $order = ShoppingCart::save_current_order();
    
                $orderItems = ShoppingCart::get_items();

    $order->write();
  
    
    $form->makeReadonly();
    $email = new Email;
    $email->to = 'email.com'; 
    $email->from = '[email protected]';
    $email->subject = 'New Enquiry';
    $email->body = $orderItems;
    $email->send();

    ShoppingCart::clear();
    
     
    // Redirect to a page thanking people for registering
    Director::redirect('thanks-for-your-enquiry/');
 
  }