Skip to content

Commit

Permalink
improved requireDefaultRecords
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnysideup committed Oct 6, 2015
1 parent e2df040 commit bb85ea9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions code/OrderConfirmationPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,22 @@ function LinkOrCurrent(){
return parent::LinkOrCurrent();
}

public function requireDefaultRecords(){
parent::requireDefaultRecords();
$checkoutPage = CheckoutPage::get()->first();
if($checkoutPage) {
$orderConfirmationPage = OrderConfirmationPage::get()->first();
if($orderConfirmationPage) {
$orderConfirmationPage = CheckoutPage::create();
$orderConfirmationPage->Title = "Order Confirmation";
$orderConfirmationPage->MenuTitle = "Order Confirmation";
$orderConfirmationPage->URLSegment = "order-confirmation";
$orderConfirmationPage->writeToStage("Stage");
$orderConfirmationPage->publish("Stage", "Live");
}
}
}

}

class OrderConfirmationPage_Controller extends CartPage_Controller{
Expand Down

0 comments on commit bb85ea9

Please sign in to comment.