Sunnysideup\Ecommerce\Forms\OrderFormAddress
This class is the form for editing the Order Addresses.
It is also used to link the order to a member.
Synopsis
class OrderFormAddress
extends Form
{
- // members
- protected bool $debug = false;
- protected array $debugArray = ;
- protected $orderMember;
- protected $loggedInMember;
- protected integer $newlyCreatedMemberID = 0;
- protected Order $order;
- private static bool $shipping_address_first = true;
- // methods
- public void __construct()
- public HTTPRequest saveAddress()
- public HTTPRequest saveAddressDetails()
- public void saveDataToSession()
- public void clearSessionData()
- public bool uniqueMemberFieldCanBeUsed()
- protected void orderHasFullyOperationalMember()
- protected bool orderDoesNotHaveFullyOperationalMember()
- protected Member createOrFindMember()
- protected bool memberShouldBeCreated()
- protected bool memberShouldBeSaved()
- protected bool memberShouldBeLoggedIn()
- protected void anotherExistingMemberWithSameUniqueFieldValue()
- protected false|string enteredEmailAddressDoesNotMatchLoggedInUser()
- protected string validPasswordHasBeenEntered()
Hierarchy
Extends
- SilverStripe\Forms\Form
Tasks
Line | Task |
---|---|
669+ | : explain why password needs to be more than three characters... |
669+ | : create class that checks if password is good enough |
Members
private
- $shipping_address_first — Sunnysideup\Ecommerce\Forms\bool
protected
- $debug — Sunnysideup\Ecommerce\Forms\bool
- $debugArray — array
- $loggedInMember
—
the logged in member, if any this is not always the same as the orderMember. - $newlyCreatedMemberID
—
int
ID of the member that has just been created. - $order
—
Sunnysideup\Ecommerce\Model\Order
ID of the member that has just been created. - $orderMember
—
the member attached to the order this is not always the same as the loggedInMember.
Methods
protected
- anotherExistingMemberWithSameUniqueFieldValue() — returns existing member if it already exists and it is not the logged-in one.
- createOrFindMember() — Works out the most likely member for the order after submission of the form.
- enteredEmailAddressDoesNotMatchLoggedInUser() — returns the email if - user is logged in already - user's email in DB does not match email entered.
- memberShouldBeCreated() — Should a new member be created?
- memberShouldBeLoggedIn() — returns TRUE if - the member is not logged in - the member is new AND - the password is valid.
- memberShouldBeSaved()
- orderDoesNotHaveFullyOperationalMember() — Opposite of orderHasFullyOperationalMember method.
- orderHasFullyOperationalMember() — Is there a member that is fully operational? - saved - has password.
- validPasswordHasBeenEntered() — Check if the password is good enough.
public
- __construct()
- clearSessionData() — clear the form data (after the form has been submitted and processed).
- saveAddress() — Process the items in the shopping cart from session, creating a new {@link Order} record, and updating the customer's details {@link Member} record.
- saveAddressDetails() — Process the items in the shopping cart from session, creating a new {@link Order} record, and updating the customer's details {@link Member} record.
- saveDataToSession() — saves the form into session.
- uniqueMemberFieldCanBeUsed() — returns TRUE if - there is no existing member with the same value in the unique field - OR the member is not logged in.