Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractCartItem.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Block\Block;
10 
14 class AbstractCartItem extends Block
15 {
21  protected $productName = '.product-item-name > a';
22 
28  protected $price = './/td[@class="col price"]//span[@class="price"]';
29 
35  protected $priceInclTax = './/td[@class="col price"]/*[@class="price-including-tax"]/span';
36 
42  protected $priceExclTax = './/td[@class="col price"]/*[@class="price-excluding-tax"]/span';
43 
49  protected $qty = './/input[@data-role="cart-item-qty"]';
50 
56  protected $subtotalPrice = '.col.subtotal .price';
57 
63  protected $subTotalPriceExclTax = '.col.subtotal .price-excluding-tax .price';
64 
70  protected $subTotalPriceInclTax = '.col.subtotal .price-including-tax .price';
71 
77  protected $optionsBlock = './/dl[contains(@class, "item-options")]';
78 
85  protected function escapeCurrency($price)
86  {
87  preg_match("/^\\D*\\s*([\\d,\\.]+)\\s*\\D*$/", $price, $matches);
88  return (isset($matches[1])) ? $matches[1] : null;
89  }
90 }