当前位置: 首页>>代码示例>>PHP>>正文


PHP CatalogProductSimple::getPrice方法代码示例

本文整理汇总了PHP中Magento\Catalog\Test\Fixture\CatalogProductSimple::getPrice方法的典型用法代码示例。如果您正苦于以下问题:PHP CatalogProductSimple::getPrice方法的具体用法?PHP CatalogProductSimple::getPrice怎么用?PHP CatalogProductSimple::getPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Catalog\Test\Fixture\CatalogProductSimple的用法示例。


在下文中一共展示了CatalogProductSimple::getPrice方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isProductVisible

 /**
  * Check if ordered product is in grid
  *
  * @param CatalogProductSimple $product
  * @return bool
  */
 public function isProductVisible(CatalogProductSimple $product)
 {
     $filter = [$product->getName(), $product->getPrice(), $product->getCheckoutData()['qty']];
     $rows = [];
     foreach ($filter as $value) {
         $rows[] = sprintf($this->rowTemplate, $value);
     }
     $location = $this->location . '[' . implode(' and ', $rows) . ']';
     return $this->_rootElement->find($location, Locator::SELECTOR_XPATH)->isVisible();
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:Ordered.php

示例2: isProductVisible

 /**
  * Check that product visible in grid
  *
  * @param CatalogProductSimple $product
  * @param string $carts
  * @return bool
  */
 public function isProductVisible(CatalogProductSimple $product, $carts)
 {
     $result = false;
     $productRowSelector = sprintf($this->productRow, $product->getName());
     $productPrice = sprintf($this->productPrice, $product->getPrice());
     $productRow = $this->_rootElement->find($productRowSelector, Locator::SELECTOR_XPATH);
     if ($productRow->isVisible()) {
         $result = $productRow->find($productPrice, Locator::SELECTOR_XPATH)->isVisible() && $productRow->find(sprintf($this->productCarts, $carts), Locator::SELECTOR_XPATH)->isVisible();
     }
     return $result;
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:18,代码来源:Grid.php

示例3: assertOnProductView

 /**
  * Assert data on the product view page
  *
  * @param CatalogProductSimple $product
  * @param CatalogProductView $catalogProductView
  * @return void
  */
 protected function assertOnProductView(CatalogProductSimple $product, CatalogProductView $catalogProductView)
 {
     $viewBlock = $catalogProductView->getViewBlock();
     $price = $viewBlock->getPriceBlock()->getPrice();
     $name = $viewBlock->getProductName();
     $sku = $viewBlock->getProductSku();
     \PHPUnit_Framework_Assert::assertEquals($product->getName(), $name, 'Product name on product view page is not correct.');
     \PHPUnit_Framework_Assert::assertEquals($product->getSku(), $sku, 'Product sku on product view page is not correct.');
     if (isset($price['price_regular_price'])) {
         \PHPUnit_Framework_Assert::assertEquals(number_format($product->getPrice(), 2), $price['price_regular_price'], 'Product regular price on product view page is not correct.');
     }
     $priceComparing = false;
     if ($specialPrice = $product->getSpecialPrice()) {
         $priceComparing = $specialPrice;
     }
     if ($priceComparing && isset($price['price_special_price'])) {
         \PHPUnit_Framework_Assert::assertEquals(number_format($priceComparing, 2), $price['price_special_price'], 'Product special price on product view page is not correct.');
     }
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:26,代码来源:AssertProductView.php


注:本文中的Magento\Catalog\Test\Fixture\CatalogProductSimple::getPrice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。