Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Fpt.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Block\Block;
10 use Magento\Mtf\Client\Locator;
11 
15 class Fpt extends Block
16 {
22  protected $totalFpt = '.price';
23 
29  public function getTotalFpt()
30  {
31  $grandTotal = $this->_rootElement->find($this->totalFpt, Locator::SELECTOR_CSS)->getText();
32  return $this->escapeCurrency($grandTotal);
33  }
34 
41  protected function escapeCurrency($price)
42  {
43  preg_match("/^\\D*\\s*([\\d,\\.]+)\\s*\\D*$/", $price, $matches);
44  return (isset($matches[1])) ? $matches[1] : null;
45  }
46 }
$price