Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Switcher Class Reference
Inheritance diagram for Switcher:

Public Member Functions

 selectStoreView ($name)
 
 getStoreView ()
 
 isStoreViewVisible ($store)
 
 isStoreViewDropdownVisible ()
 

Protected Attributes

 $dropDownButton = '#switcher-language-trigger'
 
 $storeViewSelector = 'li.view-%s'
 

Detailed Description

Class Switcher Store switcher block

Definition at line 18 of file Switcher.php.

Member Function Documentation

◆ getStoreView()

getStoreView ( )

Get store view

Returns
string

Definition at line 53 of file Switcher.php.

54  {
55  return $this->_rootElement->find($this->dropDownButton)->getText();
56  }

◆ isStoreViewDropdownVisible()

isStoreViewDropdownVisible ( )

Check if StoreView dropdown is visible

Returns
bool

Definition at line 80 of file Switcher.php.

81  {
82  return $this->_rootElement->find($this->dropDownButton)->isVisible();
83  }

◆ isStoreViewVisible()

isStoreViewVisible (   $store)

Check is Store View Visible

Parameters
Store$store
Returns
bool

Definition at line 64 of file Switcher.php.

65  {
66  $storeViewDropdown = $this->_rootElement->find($this->dropDownButton);
67 
68  $storeViewDropdown->click();
69  $isStoreViewVisible = $this->_rootElement->find(sprintf($this->storeViewSelector, $store->getCode()))
70  ->isVisible();
71  $storeViewDropdown->click();
72  return $isStoreViewVisible;
73  }

◆ selectStoreView()

selectStoreView (   $name)

Select store

Parameters
string$name
Returns
void

Definition at line 40 of file Switcher.php.

41  {
42  if ($this->_rootElement->find($this->dropDownButton)->isVisible() && ($this->getStoreView() !== $name)) {
43  $this->_rootElement->find($this->dropDownButton)->click();
44  $this->_rootElement->find($name, Locator::SELECTOR_LINK_TEXT)->click();
45  }
46  }
if(!isset($_GET['name'])) $name
Definition: log.php:14

Field Documentation

◆ $dropDownButton

$dropDownButton = '#switcher-language-trigger'
protected

Definition at line 25 of file Switcher.php.

◆ $storeViewSelector

$storeViewSelector = 'li.view-%s'
protected

Definition at line 32 of file Switcher.php.


The documentation for this class was generated from the following file: