SilverCart\Checkout\Checkout
Checkout.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class Checkout
extends ViewableData
{
- // constants
- const SESSION_KEY = 'SilverCart.CheckoutData';
- const FINALIZED_SESSION_KEY = 'SilverCart.FinalizedCheckoutData';
- // members
- private static bool $show_cart_in_checkout_navigation = true;
- private static bool $allow_anonymous_checkout = true;
- private static Checkout $session_checkout = NULL;
- protected array $stepList = ;
- protected array $completedSteps = ;
- protected array $data = ;
- protected CheckoutStep $currentStep = NULL;
- protected $currentStepName = NULL;
- protected Controller $controller = NULL;
- // methods
- public void __construct()
- public array getDefaultStepList()
- public array getStepList()
- public $this setStepList()
- public bool stepExists()
- public bool nextStepExists()
- public ArrayList CheckoutSteps()
- public ArrayList VisibleCheckoutSteps()
- public int getVisibleCheckoutStepWithCartCount()
- public float getStepProgressPercentage()
- public CheckoutStep getCurrentStep()
- public CheckoutStep CurrentStep()
- public $this setCurrentStep()
- public Checkout resetCurrentStep()
- public string|null getStepNameByIndex()
- public CheckoutStep|null getStepByIndex()
- public bool ShowCartInCheckoutNavigation()
- public bool AllowAnonymousCheckout()
- public bool CurrentPageIsCartPage()
- public static Checkout create_from_session()
- public static void clear_session()
- public bool canAccess()
- public Checkout initFromSession()
- public void saveInSession()
- public void finalize()
- public array getFinalizedData()
- public Checkout addData()
- public Checkout addDataValue()
- public void clearData()
- public array getData()
- public mixed getDataValue()
- public Checkout setData()
- public string getCurrentStepName()
- public void setCurrentStepName()
- public bool isCurrentStep()
- public array getCompletedSteps()
- public Checkout setCompletedSteps()
- public Checkout addCompletedStep()
- public bool isCompletedStep()
- public Checkout redirectToCurrentStep()
- public Controller getController()
- public void setController()
- public Checkout initStep()
Hierarchy
Extends
- SilverStripe\View\ViewableData
Constants
Name | Value |
---|---|
SESSION_KEY | 'SilverCart.CheckoutData' |
FINALIZED_SESSION_KEY | 'SilverCart.FinalizedCheckoutData' |
Members
private
- $allow_anonymous_checkout
—
SilverCart\Checkout\bool
Determines whether to allow an anonymous checkout (without customer registration). - $session_checkout
—
SilverCart\Checkout\Checkout
Checkout from session.
protected
- $completedSteps
—
array
List of completed steps. - $controller
—
SilverStripe\Control\Controller
Controller. - $currentStep
—
SilverCart\Checkout\CheckoutStep
Current checkout step. - $currentStepName
—
string
Current checkout step. - $data
—
array
Checkout data. - $stepList
—
array
Step list.
Methods
public
- __construct() — Constructor.
- AllowAnonymousCheckout() — Returns whether to allow an anonymous checkout or not.
- CheckoutSteps() — Returns the checkout steps to use in template.
- CurrentPageIsCartPage() — Returns whether the current page controller is a CartPageController.
- CurrentStep() — Returns the current checkout step to use in template.
- VisibleCheckoutSteps() — Returns the visible checkout steps to use in template.
- addCompletedStep() — Adds a completed step.
- addData() — Adds the given data to the checkout data.
- addDataValue() — Adds the given data key value pair to the checkout data.
- canAccess() — Returns whether the given or current logged in Member can access the checkout.
- clearData() — Clears the checkout data.
- clear_session() — Clears the checkout data out of session.
- create_from_session() — Creates the checkout from session.
- finalize() — Finalizes the checkout and moves its data to a different session store.
- getCompletedSteps() — Returns the list of completed steps.
- getController() — Returns the controller.
- getCurrentStep() — Returns the current checkout step to use in template.
- getCurrentStepName() — Returns the current step name.
- getData() — Returns the checkout data.
- getDataValue() — Returns the value for the given data key out of the checkout data.
- getDefaultStepList() — Returns the checkout step list.
- getFinalizedData() — Returns the finalized checkout data.
- getStepByIndex() — Returns the step matching the given index to use in template.
- getStepList() — Returns the checkout step list.
- getStepNameByIndex() — Returns the step matching the given index to use in template.
- getStepProgressPercentage() — Returns the current step progress as a percent value (e.g. step 3 of 5 results in 60[%]).
- getVisibleCheckoutStepWithCartCount() — Returns the count of visible checkout steps including the shopping cart.
- initFromSession() — Initializes the checkout from session.
- initStep() — Initializes the current checkout step.
- isCompletedStep() — Returns if the given step is completed.
- isCurrentStep() — Sets the current step name.
- nextStepExists() — Returns whether there is a next step or not.
- redirectToCurrentStep() — Redirects to the current step.
- resetCurrentStep() — Resets the current step.
- saveInSession() — Saves the current checkout data in session.
- setCompletedSteps() — Sets the list of completed steps.
- setController() — Sets the controller.
- setCurrentStep() — Returns the current checkout step to use in template.
- setCurrentStepName() — Sets the current step name.
- setData() — Sets the checkout data.
- setStepList() — Sets the step list.
- stepExists() — Returns if the given step exists.