public function registerconfig() { $order = ShoppingCart::curr(); //hack to make components work when there is no order if (!$order) { $order = Order::create(); } $config = new CheckoutComponentConfig($order, false); $config->addComponent(CustomerDetailsCheckoutComponent::create()); $config->addComponent(MembershipCheckoutComponent::create()); return $config; }
public function __construct(Order $order) { parent::__construct($order); $this->addComponent(CustomerDetailsCheckoutComponent::create()); $this->addComponent(ShippingAddressCheckoutComponent::create()); $this->addComponent(BillingAddressCheckoutComponent::create()); if (Checkout::member_creation_enabled() && !Member::currentUserID()) { $this->addComponent(MembershipCheckoutComponent::create()); } if (count(GatewayInfo::getSupportedGateways()) > 1) { $this->addComponent(PaymentCheckoutComponent::create()); } $this->addComponent(NotesCheckoutComponent::create()); $this->addComponent(TermsCheckoutComponent::create()); }
public function setData(Order $order, array $data) { if (isset($data['RegisterAnAccount']) && $data['RegisterAnAccount']) { parent::setData($order, $data); } }