Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct (\Magento\Catalog\Block\Product\Context $context, \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory, \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, \Magento\Framework\App\Http\Context $httpContext, array $data=[], \Magento\Framework\Serialize\Serializer\Json $serializer=null) | |
getCurrentPage () | |
getCacheKeyInfo () | |
getDisplayType () | |
getProductsCount () | |
getProductsPerPage () | |
showPager () | |
getPagerHtml () | |
![]() | |
__construct (\Magento\Catalog\Block\Product\Context $context, \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory, \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, \Magento\Framework\App\Http\Context $httpContext, array $data=[]) | |
getCacheKeyInfo () | |
setProductsCount ($count) | |
getProductsCount () | |
getIdentities () | |
![]() | |
__construct (\Magento\Catalog\Block\Product\Context $context, array $data=[]) | |
getAddToCartUrl ($product, $additional=[]) | |
getSubmitUrl ($product, $additional=[]) | |
getAddToWishlistParams ($product) | |
getAddToCompareUrl () | |
getMinimalQty ($product) | |
getReviewsSummaryHtml (\Magento\Catalog\Model\Product $product, $templateType=false, $displayIfNoReviews=false) | |
getProduct () | |
getProductUrl ($product, $additional=[]) | |
hasProductUrl ($product) | |
getColumnCount () | |
addColumnCountLayoutDepend ($pageLayout, $columnCount) | |
removeColumnCountLayoutDepend ($pageLayout) | |
getColumnCountLayoutDepend ($pageLayout) | |
getPageLayout () | |
getCanShowProductPrice ($product) | |
displayProductStockStatus () | |
getRandomString ($length, $chars=null) | |
getProductPrice (\Magento\Catalog\Model\Product $product) | |
isRedirectToCartEnabled () | |
getProductDetailsHtml (\Magento\Catalog\Model\Product $product) | |
getDetailsRenderer ($type=null) | |
getImage ($product, $imageId, $attributes=[]) | |
![]() | |
__construct (Template\Context $context, array $data=[]) | |
setTemplateContext ($templateContext) | |
getTemplate () | |
setTemplate ($template) | |
getTemplateFile ($template=null) | |
getArea () | |
assign ($key, $value=null) | |
fetchView ($fileName) | |
getBaseUrl () | |
getObjectData (\Magento\Framework\DataObject $object, $key) | |
getCacheKeyInfo () | |
![]() | |
__construct (\Magento\Framework\View\Element\Context $context, array $data=[]) | |
getJsLayout () | |
getRequest () | |
getParentBlock () | |
setLayout (\Magento\Framework\View\LayoutInterface $layout) | |
getLayout () | |
setNameInLayout ($name) | |
getChildNames () | |
setAttribute ($name, $value=null) | |
setChild ($alias, $block) | |
addChild ($alias, $block, $data=[]) | |
unsetChild ($alias) | |
unsetCallChild ($alias, $callback, $result, $params) | |
unsetChildren () | |
getChildBlock ($alias) | |
getChildHtml ($alias='', $useCache=true) | |
getChildChildHtml ($alias, $childChildAlias='', $useCache=true) | |
getBlockHtml ($name) | |
insert ($element, $siblingName=0, $after=true, $alias='') | |
append ($element, $alias='') | |
getGroupChildNames ($groupName) | |
getChildData ($alias, $key='') | |
getUiId ($arg1=null, $arg2=null, $arg3=null, $arg4=null, $arg5=null) | |
getJsId ($arg1=null, $arg2=null, $arg3=null, $arg4=null, $arg5=null) | |
getUrl ($route='', $params=[]) | |
getViewFileUrl ($fileId, array $params=[]) | |
formatDate ( $date=null, $format=\IntlDateFormatter::SHORT, $showTime=false, $timezone=null) | |
formatTime ( $time=null, $format=\IntlDateFormatter::SHORT, $showDate=false) | |
getModuleName () | |
escapeHtml ($data, $allowedTags=null) | |
escapeJs ($string) | |
escapeHtmlAttr ($string, $escapeSingleQuote=true) | |
escapeCss ($string) | |
stripTags ($data, $allowableTags=null, $allowHtmlEntities=false) | |
escapeUrl ($string) | |
escapeXssInUrl ($data) | |
escapeQuote ($data, $addSlashes=false) | |
escapeJsQuote ($data, $quote='\'') | |
getNameInLayout () | |
getCacheKeyInfo () | |
getCacheKey () | |
getVar ($name, $module=null) | |
isScopePrivate () | |
![]() | |
__construct (array $data=[]) | |
addData (array $arr) | |
setData ($key, $value=null) | |
unsetData ($key=null) | |
getData ($key='', $index=null) | |
getDataByPath ($path) | |
getDataByKey ($key) | |
setDataUsingMethod ($key, $args=[]) | |
getDataUsingMethod ($key, $args=null) | |
hasData ($key='') | |
toArray (array $keys=[]) | |
convertToArray (array $keys=[]) | |
toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
toJson (array $keys=[]) | |
convertToJson (array $keys=[]) | |
toString ($format='') | |
__call ($method, $args) | |
isEmpty () | |
serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"') | |
debug ($data=null, &$objects=[]) | |
offsetSet ($offset, $value) | |
offsetExists ($offset) | |
offsetUnset ($offset) | |
offsetGet ($offset) | |
![]() | |
toHtml () | |
![]() | |
addData (array $arr) | |
setData ($key, $value=null) | |
Data Fields | |
const | DISPLAY_TYPE_ALL_PRODUCTS = 'all_products' |
const | DISPLAY_TYPE_NEW_PRODUCTS = 'new_products' |
const | DEFAULT_SHOW_PAGER = false |
const | DEFAULT_PRODUCTS_PER_PAGE = 5 |
const | PAGE_VAR_NAME = 'np' |
![]() | |
const | DEFAULT_PRODUCTS_COUNT = 10 |
![]() | |
const | XML_PATH_TEMPLATE_ALLOW_SYMLINK = 'dev/template/allow_symlink' |
![]() | |
const | CACHE_GROUP = \Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER |
const | CACHE_KEY_PREFIX = 'BLOCK_' |
Protected Member Functions | |
_getProductCollection () | |
getPageSize () | |
![]() | |
_construct () | |
_beforeToHtml () | |
![]() | |
_addProductAttributesAndPrices (\Magento\Catalog\Model\ResourceModel\Product\Collection $collection) | |
getDetailsRendererList () | |
![]() | |
_construct () | |
_toHtml () | |
getRootDirectory () | |
getMediaDirectory () | |
![]() | |
_construct () | |
_prepareLayout () | |
_beforeToHtml () | |
_afterToHtml ($html) | |
_toHtml () | |
_getNotFoundUrl ($route='', $params=['_direct'=> 'core/index/notFound']) | |
getCacheTags () | |
getCacheLifetime () | |
_loadCache () | |
_saveCache ($data) | |
_getSidPlaceholder ($cacheKey=null) | |
![]() | |
_getData ($key) | |
_underscore ($name) | |
Additional Inherited Members | |
![]() | |
static | extractModuleName ($className) |
![]() | |
static | $_underscoreCache = [] |
New products widget
Definition at line 11 of file NewWidget.php.
__construct | ( | \Magento\Catalog\Block\Product\Context | $context, |
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory | $productCollectionFactory, | ||
\Magento\Catalog\Model\Product\Visibility | $catalogProductVisibility, | ||
\Magento\Framework\App\Http\Context | $httpContext, | ||
array | $data = [] , |
||
\Magento\Framework\Serialize\Serializer\Json | $serializer = null |
||
) |
NewWidget constructor.
\Magento\Catalog\Block\Product\Context | $context | |
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory | $productCollectionFactory | |
\Magento\Catalog\Model\Product\Visibility | $catalogProductVisibility | |
\Magento\Framework\App\Http\Context | $httpContext | |
array | $data | |
\Magento\Framework\Serialize\Serializer\Json | null | $serializer |
Definition at line 62 of file NewWidget.php.
|
protected |
Product collection initialize process
Definition at line 86 of file NewWidget.php.
getCacheKeyInfo | ( | ) |
Get key pieces for caching block content
Definition at line 135 of file NewWidget.php.
getCurrentPage | ( | ) |
Get number of current page based on query value
Definition at line 125 of file NewWidget.php.
getDisplayType | ( | ) |
Retrieve display type for products
Definition at line 153 of file NewWidget.php.
getPagerHtml | ( | ) |
Render pagination HTML
Definition at line 215 of file NewWidget.php.
|
protected |
Retrieve how many products should be displayed on page
Definition at line 205 of file NewWidget.php.
getProductsCount | ( | ) |
Retrieve how many products should be displayed
Definition at line 166 of file NewWidget.php.
getProductsPerPage | ( | ) |
Retrieve how many products should be displayed
Definition at line 179 of file NewWidget.php.
showPager | ( | ) |
Return flag whether pager need to be shown or not
Definition at line 192 of file NewWidget.php.
|
protected |
Definition at line 45 of file NewWidget.php.
const DEFAULT_PRODUCTS_PER_PAGE = 5 |
Default value for products per page
Definition at line 31 of file NewWidget.php.
const DEFAULT_SHOW_PAGER = false |
Default value whether show pager or not
Definition at line 26 of file NewWidget.php.
const DISPLAY_TYPE_ALL_PRODUCTS = 'all_products' |
Display products type - all products
Definition at line 16 of file NewWidget.php.
const DISPLAY_TYPE_NEW_PRODUCTS = 'new_products' |
Display products type - new products
Definition at line 21 of file NewWidget.php.
const PAGE_VAR_NAME = 'np' |
Name of request parameter for page number value
Definition at line 38 of file NewWidget.php.