Sunnysideup\Ecommerce\Model\Extensions\EcommerceRole
class for the ecommerce module.
Synopsis
class EcommerceRole
extends DataExtension
implements
PermissionProvider
{
- // members
- protected static $adminMemberCache;
- protected static $shopAssistantMemberCache;
- private static integer $max_count_of_members_in_array = 1500;
- private static array $api_access = ;
- private static string $permission_category = 'E-commerce';
- private static bool $allow_customers_to_setup_accounts = true;
- private static bool $must_have_account_to_purchase = false;
- private static bool $automatically_update_member_details = true;
- private static string $customer_group_code = 'shopcustomers';
- private static string $customer_group_name = 'Shop Customers';
- private static string $customer_permission_code = 'SHOPCUSTOMER';
- private static string $admin_group_code = 'shopadministrators';
- private static string $admin_group_name = 'Shop Administrators';
- private static string $admin_group_user_first_name = '';
- private static string $admin_group_user_surname = '';
- private static string $admin_group_user_email = '';
- private static string $admin_permission_code = 'SHOPADMIN';
- private static string $admin_role_title = 'Managing Store';
- private static array $admin_role_permission_codes = ;
- private static string $assistant_group_code = 'shopassistants';
- private static string $assistant_group_name = 'Shop Assistants';
- private static string $assistant_group_user_first_name = '';
- private static string $assistant_group_user_surname = '';
- private static string $assistant_group_user_email = '';
- private static string $assistant_permission_code = 'SHOPASSISTANTS';
- private static string $assistant_role_title = 'Store Assistant';
- private static array $assistant_role_permission_codes = ;
- private static string $process_orders_permission_code = 'CMS_ACCESS_SalesAdmin_PROCESS';
- private static string $table_name = 'EcommerceRole';
- private static array $db = ;
- private static array $has_one = ;
- private static array $has_many = ;
- private static array $casting = ;
- // methods
- public void getCustomerDetails()
- public static DataObject get_customer_group()
- public static array list_of_customers()
- public static array list_of_admins()
- public static bool current_member_is_shop_admin()
- public static bool current_member_is_shop_assistant()
- public static bool current_member_can_process_orders()
- public static DataObject get_admin_group()
- public static DataObject get_assistant_group()
- public static DataObject get_default_shop_admin_user()
- public static DataObject get_default_shop_assistant_user()
- public void canDelete()
- public DataList Orders()
- public void getOrders()
- public void CancelledOrders()
- public void getCancelledOrders()
- public array providePermissions()
- public void updateCMSFields()
- public void SetPreferredCurrency()
- public CompositeField getEcommerceFieldsForCMS()
- public FieldList getEcommerceFields()
- public array getEcommerceRequiredFields()
- public bool IsShopAdmin()
- public bool IsShopAssistant()
- public bool CanProcessOrders()
- public void LastOrder()
- public void onAfterWrite()
- public ArrayList previousOrderAddresses()
- public void previousOrderAddress()
- public void LoginAsLink()
- public string CMSEditLink()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Implements
- SilverStripe\Security\PermissionProvider
Members
private
- $admin_group_code — string
- $admin_group_name — string
- $admin_group_user_email — string
- $admin_group_user_first_name — string
- $admin_group_user_surname — string
- $admin_permission_code — string
- $admin_role_permission_codes — array
- $admin_role_title — string
- $allow_customers_to_setup_accounts — Sunnysideup\Ecommerce\Model\Extensions\bool
- $api_access
- $assistant_group_code — string
- $assistant_group_name — string
- $assistant_group_user_email — string
- $assistant_group_user_first_name — string
- $assistant_group_user_surname — string
- $assistant_permission_code — string
- $assistant_role_permission_codes — array
- $assistant_role_title — string
- $automatically_update_member_details — Sunnysideup\Ecommerce\Model\Extensions\bool
- $casting
- $customer_group_code — string
- $customer_group_name — string
- $customer_permission_code — string
- $db
- $has_many
- $has_one
- $max_count_of_members_in_array
- $must_have_account_to_purchase — Sunnysideup\Ecommerce\Model\Extensions\bool
- $permission_category — string
- $process_orders_permission_code — string
-
$table_name
standard SS method.
protected
- $adminMemberCache
- $shopAssistantMemberCache
Methods
public
- CMSEditLink() — link to edit the record.
- CanProcessOrders() — Is the member a member of the SHOPASSISTANTS Group.
- CancelledOrders()
- IsShopAdmin() — Is the member a member of the ShopAdmin Group.
- IsShopAssistant() — Is the member a member of the SHOPASSISTANTS Group.
- LastOrder() — returns the last (submitted) order by the member.
- LoginAsLink()
- Orders() — we need this function because $this->Orders does not return anything that is probably because Order links the member twice (placed by and cancelled by).
- SetPreferredCurrency() — Save a preferred currency for a member.
- canDelete() — you can't delete a Member with one or more orders.
- current_member_can_process_orders() — tells us if the current member can process the orders.
- current_member_is_shop_admin() — tells us if the current member is in the Shop Administrators Group.
- current_member_is_shop_assistant() — tells us if the current member is in the Shop Administrators Group.
- getCancelledOrders()
- getCustomerDetails()
- getEcommerceFields()
- getEcommerceFieldsForCMS() — get CMS fields describing the member in the CMS when viewing the order.
- getEcommerceRequiredFields() — Return which member fields should be required on {@link OrderForm} and {@link ShopAccountForm}.
- getOrders()
- get_admin_group()
- get_assistant_group()
- get_customer_group()
- get_default_shop_admin_user()
- get_default_shop_assistant_user()
- list_of_admins() — returns an aray of customers The unselect option shows an extra line, basically allowing you to deselect the current option.
- list_of_customers() — returns an aray of customers The unselect option shows an extra line, basically allowing you to deselect the current option.
- onAfterWrite() — standard SS method Make sure the member is added as a customer.
- previousOrderAddress() — Finds the last address used by this member.
- previousOrderAddresses() — Finds previous addresses from the member of the current address.
- providePermissions() — creates two permission roles.
- updateCMSFields() — Update the CMS Fields for /admin/security.