Jump to:

2082 Posts in 1002 Topics by 452 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » emailing the shopping cart info on cartpage

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1
Go to End
Author Topic: 813 Views
  • slavelabourer
    Avatar
    Community Member
    25 Posts

    emailing the shopping cart info on cartpage Link to this post

    i want to create a quote request that is emailed for my project rather than run through the payment process. Bare with me as this is my first time using the ecommerce module. (version 0.70).

    in it's current state email just returns the word 'order' in the email rather than that ordered items or quantities. How can I get this data saved in the database properly and emailed? Any help much appreciated, Thanks.

    these are my functions in the CartPage.php

    function SubmitEnquiry($data, $form) {
       
          $order = ShoppingCart::save_current_order();
          ShoppingCart::clear();
          
          $form->saveInto($order);
          $order->write();
          
          //$Enquiry = new Enquiry();
          //$form->saveInto($Enquiry);
          
          $form->makeReadonly();
          $email = new Email;
          $email->to = 'daniel.tait@digital-pollution.net';
          $email->from = 'sales@tcs-nz.co.nz';
          $email->subject = 'New Enquiry';
          $email->body = $order.'<br />'.$form->forTemplate();
          $email->send();
          
          //$Enquiry->write();
          
             // Redirect to a page thanking people for registering
             Director::redirect('thanks-for-your-enquiry/');

       }   
          
          function Order() {
          if($orderID = Director::urlParam('Action')) return DataObject::get_by_id('Order', $orderID);
          else return ShoppingCart::current_order();
          }

    813 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.