Catalog layered navigation view block.
Definition at line 16 of file Navigation.php.
◆ applyFilter()
applyFilter |
( |
|
$filter, |
|
|
|
$linkPattern |
|
) |
| |
Apply Layered Navigation filter.
- Parameters
-
string | $filter | |
string | $linkPattern | |
- Returns
- void
- Exceptions
-
Definition at line 103 of file Navigation.php.
105 $links = sprintf($this->filterLink, $filter);
106 $this->openFilterContainer($filter,
$links);
108 $links = $this->_rootElement->getElements(
$links, Locator::SELECTOR_XPATH);
110 if (preg_match($linkPattern, trim(
$link->getText()))) {
115 throw new \Exception(
"Can't find {$filter} filter link by pattern: {$linkPattern}");
◆ clearAll()
Remove all applied filters.
- Returns
- void
Definition at line 72 of file Navigation.php.
74 $this->_rootElement->find($this->
clearAll)->click();
◆ getFilterContents()
getFilterContents |
( |
|
$attributeLabel | ) |
|
Get Layered Navigation filter options.
- Parameters
-
- Returns
- array
Definition at line 139 of file Navigation.php.
143 if (trim($attributeLabel) ===
'') {
147 $link = sprintf($this->filterLink, $attributeLabel);
148 $this->openFilterContainer($attributeLabel,
$link);
150 $optionContents = $this->_rootElement->getElements(
$link, Locator::SELECTOR_XPATH);
152 foreach ($optionContents as $optionContent) {
153 $data[] = trim(strtoupper($optionContent->getText()));
◆ getFilters()
Get all available filters.
- Returns
- array
Definition at line 82 of file Navigation.php.
84 $this->waitForElementVisible($this->loadedNarrowByList);
86 $options = $this->_rootElement->getElements(sprintf($this->optionTitle,
''), Locator::SELECTOR_XPATH);
◆ isCategoryVisible()
isCategoryVisible |
( |
Category |
$category, |
|
|
|
$qty |
|
) |
| |
Check that category with product quantity can be displayed on layered navigation.
- Parameters
-
Category | $category | |
int | $qty | |
- Returns
- bool
Definition at line 125 of file Navigation.php.
127 return $this->_rootElement->find(
128 sprintf($this->categoryName,
$category->getName()) . sprintf($this->productQty, $qty),
129 Locator::SELECTOR_XPATH
◆ $clearAll
◆ $expandFilterButton
$expandFilterButton = '[data]' |
|
protected |
◆ $filterLink
$filterLink = './/div[@class="filter-options-title" and contains(text(),"%s")]/following-sibling::div//a' |
|
protected |
◆ $loadedNarrowByList
$loadedNarrowByList = '#narrow-by-list[role="tablist"]' |
|
protected |
◆ $optionTitle
$optionTitle = './/div[@class="filter-options-title" and contains(text(),"%s")]' |
|
protected |
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Block/Navigation.php