Sunnysideup\Ecommerce\Pages\ProductGroup
Product Group is a 'holder' for Products within the CMS.
- Author: : Nicolaas [at] Sunny Side Up .co.nz
Synopsis
class ProductGroup
extends Page
{
- // members
- protected $baseProductList;
- protected static array $filterForCandidateCategoriesCache = ;
- protected static array $searchStringCache = ;
- protected static $parentGroupCache;
- protected static array $parentPageCache = ;
- protected static array $topParentGroupCache = ;
- protected static array $getProductCountCache = ;
- protected static array $recursiveValuesCache = ;
- private static $template_for_selection_of_products = ProductGroupSchema::class;
- private static string $base_buyable_class = Product::class;
- private static integer $maximum_number_of_products_to_list = 999;
- private static string $table_name = 'ProductGroup';
- private static array $db = ;
- private static array $has_one = ;
- private static array $owns = ;
- private static array $belongs_many_many = ;
- private static array $defaults = ;
- private static array $indexes = ;
- private static array $summary_fields = ;
- private static array $searchable_fields = ;
- private static array $casting = ;
- private static $default_child = Product::class;
- private static string $icon = 'sunnysideup/ecommerce:client/images/icons/productgroup-file.gif';
- private static string $singular_name = 'Product Category';
- private static string $plural_name = 'Product Categories';
- private static string $description = 'A page the shows a bunch of products, based on your selection. By default it shows products linked to it (children)';
- private static integer $count = 0;
- // methods
- public void i18n_singular_name()
- public void i18n_plural_name()
- public void canCreate()
- public bool canEdit()
- public bool canDelete()
- public bool canPublish()
- public void getCMSFields()
- public void FilterForGroupSegment()
- public void getFilterForCandidateCategories()
- public void getLumberjackTitle()
- public void requireDefaultRecords()
- public ProductGroupSchema getProductGroupSchema()
- public void getProductsPerPage()
- public void getListConfigCalculated()
- public void getMyLevelOfProductsToShow()
- public void SearchResultLink()
- public static void set_search_string_for_base_list()
- public BaseProductList getBaseProductList()
- public DataList getProducts()
- public void hasProducts()
- public ProductGroup MyFilterParent()
- public void getProductsToBeIncludedFromOtherGroupsArray()
- public void IDForSearchResults()
- public void MainParentGroup()
- public void ParentGroup()
- public void TopParentGroup()
- public null|Image BestAvailableImage()
- public void IsEcommercePage()
- public void getNumberOfProducts()
- public array|string getSortFilterDisplayValues()
- public void getBuyableClassName()
- public void getProductsAlsoInOtherGroups()
- public SS_List ChildCategoriesBasedOnProducts()
- public void ChildCategories()
- public void getShowProductLevelsArray()
- public void VardumpMe()
- public void onAfterPublish()
- public void onBeforeUnpublish()
- public void onBeforeDelete()
- protected void getTemplateForSelectionOfProducts()
- protected void addDropDownForListConfig()
- protected array getOptionsForDropdown()
- protected GridField getProductGroupsTable()
- protected mixed recursiveValue()
- protected void getProductSearchTableDataValues()
Hierarchy
Extends
- Page
Members
private
- $base_buyable_class — string
- $belongs_many_many
- $casting
- $count
- $db
- $default_child
- $defaults
- $description
- $has_one
- $icon
- $indexes
- $maximum_number_of_products_to_list
- $owns
- $plural_name
- $searchable_fields
- $singular_name
- $summary_fields
- $table_name
- $template_for_selection_of_products
protected
- $baseProductList
- $filterForCandidateCategoriesCache
- $getProductCountCache
- $parentGroupCache
- $parentPageCache
- $recursiveValuesCache — array
- $searchStringCache
—
array
set by ID of RootGroup. - $topParentGroupCache
Methods
protected
- addDropDownForListConfig()
- getOptionsForDropdown() — GROUPFILTER: not available.
- getProductGroupsTable() — Used in getCMCFields.
- getProductSearchTableDataValues()
- getTemplateForSelectionOfProducts()
- recursiveValue() — get recursive value for Product Group and check EcommerceConfig as last resort.
public
- BestAvailableImage() — returns a "BestAvailable" image if the current one is not available In some cases this is appropriate and in some cases this is not.
- ChildCategories()
- ChildCategoriesBasedOnProducts() — Returns children ProductGroup pages of this group.
- FilterForGroupSegment()
- IDForSearchResults()
- IsEcommercePage() — tells us if the current page is part of e-commerce.
- MainParentGroup() — Returns the parent page, but only if it is an instance of Product Group.
- MyFilterParent() — returns the parent Product Group that is the same type.
- ParentGroup() — Returns the parent page, but only if it is an instance of Product Group.
- SearchResultLink() — Link to the search results.
- TopParentGroup() — Returns the parent page, but only if it is an instance of Product Group.
- VardumpMe()
- canCreate()
- canDelete() — Standard SS method.
- canEdit() — Shop Admins can edit.
- canPublish() — Standard SS method.
- getBaseProductList() — Retrieve the base list of products for this group.
- getBuyableClassName() — Returns the class we are working with.
- getCMSFields()
- getFilterForCandidateCategories()
- getListConfigCalculated() — work out the recursive value in the Database for SORT / FILTER / DISPLAY.
- getLumberjackTitle() — used if you install lumberjack.
- getMyLevelOfProductsToShow() — Returns the number of product groups (children) to show in the current product list based on the user setting for this page.
- getNumberOfProducts() — the number of direct descendants.
- getProductGroupSchema() — returns the template for providing related groups and products.
- getProducts()
- getProductsAlsoInOtherGroups() — Do products occur in more than one group.
- getProductsPerPage()
- getProductsToBeIncludedFromOtherGroupsArray() — If products are shown in more than one group then this returns an array for any products that are linked to this product group.
- getShowProductLevelsArray()
- getSortFilterDisplayValues() — Returns the full sortFilterDisplayNames set, a subset, or one value by either type (e.g. FILTER) or variable (e.g dbFieldName) or both.
- hasProducts()
- i18n_plural_name()
- i18n_singular_name()
- onAfterPublish()
- onBeforeDelete()
- onBeforeUnpublish()
- requireDefaultRecords()
- set_search_string_for_base_list() — This can be set from the controller to create a filtered baselist.