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


PHP CheckoutCart::getCrosssellBlock方法代码示例

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


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

示例1: processAssert

 /**
  * Assert that product is not displayed in cross-sell section.
  *
  * @param BrowserInterface $browser
  * @param CatalogProductSimple $product
  * @param CatalogProductView $catalogProductView
  * @param CheckoutCart $checkoutCart
  * @param InjectableFixture[]|null $promotedProducts
  * @return void
  */
 public function processAssert(BrowserInterface $browser, CatalogProductSimple $product, CatalogProductView $catalogProductView, CheckoutCart $checkoutCart, array $promotedProducts = null)
 {
     if (!$promotedProducts) {
         $promotedProducts = $product->hasData('cross_sell_products') ? $product->getDataFieldConfig('cross_sell_products')['source']->getProducts() : [];
     }
     $checkoutCart->open();
     $checkoutCart->getCartBlock()->clearShoppingCart();
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $catalogProductView->getViewBlock()->addToCart($product);
     $checkoutCart->open();
     foreach ($promotedProducts as $promotedProduct) {
         \PHPUnit_Framework_Assert::assertFalse($checkoutCart->getCrosssellBlock()->getItemBlock($promotedProduct)->isVisible(), 'Product \'' . $promotedProduct->getName() . '\' is exist in cross-sell section.');
     }
 }
开发者ID:MikeTayC,项目名称:magento.dev,代码行数:24,代码来源:AssertProductAbsentCrossSells.php

示例2: processAssert

 /**
  * Assert that products are displayed in cross-sell section.
  *
  * @param Browser $browser
  * @param CheckoutCart $checkoutCart
  * @param CatalogProductSimple $product
  * @param CatalogProductView $catalogProductView
  * @param InjectableFixture[] $crossSellProducts
  * @return void
  */
 public function processAssert(Browser $browser, CheckoutCart $checkoutCart, CatalogProductSimple $product, CatalogProductView $catalogProductView, array $crossSellProducts)
 {
     $checkoutCart->open()->getCartBlock()->clearShoppingCart();
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $catalogProductView->getViewBlock()->addToCart($product);
     $errors = [];
     $crosssellBlock = $checkoutCart->getCrosssellBlock();
     foreach ($crossSellProducts as $crossSellProduct) {
         if (!$crosssellBlock->getItemBlock($crossSellProduct)->isVisible()) {
             $errors[] = "Product {$crossSellProduct->getName()} is absent in cross-sell section.";
         }
     }
     \PHPUnit_Framework_Assert::assertEmpty($errors, implode(" ", $errors));
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:24,代码来源:AssertCrossSellProductsSection.php

示例3: processAssert

 /**
  * Assert that product is displayed in cross-sell section.
  *
  * @param BrowserInterface $browser
  * @param CheckoutCart $checkoutCart
  * @param CatalogProductSimple $product
  * @param CatalogProductView $catalogProductView
  * @param InjectableFixture[]|null $promotedProducts
  * @return void
  */
 public function processAssert(BrowserInterface $browser, CheckoutCart $checkoutCart, CatalogProductSimple $product, CatalogProductView $catalogProductView, array $promotedProducts = null)
 {
     $errors = [];
     if (!$promotedProducts) {
         $promotedProducts = $product->hasData('cross_sell_products') ? $product->getDataFieldConfig('cross_sell_products')['source']->getProducts() : [];
     }
     $checkoutCart->open();
     $checkoutCart->getCartBlock()->clearShoppingCart();
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $catalogProductView->getViewBlock()->addToCart($product);
     $checkoutCart->open();
     foreach ($promotedProducts as $promotedProduct) {
         if (!$checkoutCart->getCrosssellBlock()->verifyProductCrosssell($promotedProduct)) {
             $errors[] = 'Product \'' . $promotedProduct->getName() . '\' is absent in cross-sell section.';
         }
     }
     \PHPUnit_Framework_Assert::assertEmpty($errors, implode(" ", $errors));
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:28,代码来源:AssertProductCrossSells.php

示例4: processAssert

 /**
  * Assert that product is displayed in cross-sell section for customer segment.
  *
  * @param Browser $browser
  * @param Customer $customer
  * @param CheckoutCart $checkoutCart
  * @param CatalogProductSimple $product
  * @param CatalogProductView $catalogProductView
  * @param CustomerAccountLogout $customerAccountLogout
  * @param InjectableFixture[] $promotedProducts
  * @return void
  */
 public function processAssert(Browser $browser, Customer $customer, CheckoutCart $checkoutCart, CatalogProductSimple $product, CatalogProductView $catalogProductView, CustomerAccountLogout $customerAccountLogout, array $promotedProducts)
 {
     // Create customer, logout and login to frontend
     $customer->persist();
     $customerAccountLogout->open();
     $this->objectManager->create('Mage\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     // Clear cart
     $checkoutCart->open();
     $checkoutCart->getCartBlock()->clearShoppingCart();
     // Check display cross sell products
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $catalogProductView->getViewBlock()->addToCart($product);
     $catalogProductView->getMessagesBlock()->waitSuccessMessage();
     $checkoutCart->open();
     $errors = [];
     foreach ($promotedProducts as $promotedProduct) {
         if (!$checkoutCart->getCrosssellBlock()->getItemBlock($promotedProduct)->isVisible()) {
             $errors[] = "Product '{$promotedProduct->getName()}' is absent in cross-sell section.";
         }
     }
     \PHPUnit_Framework_Assert::assertEmpty($errors, implode(" ", $errors));
 }
开发者ID:MikeTayC,项目名称:magento.dev,代码行数:34,代码来源:AssertProductCrossSellsForCustomerSegment.php

示例5: assertCrossSellSectionAbsent

 /**
  * Check that crossSell section is absent.
  *
  * @param CheckoutCart $checkoutCart
  * @return void
  */
 protected function assertCrossSellSectionAbsent(CheckoutCart $checkoutCart)
 {
     \PHPUnit_Framework_Assert::assertFalse($checkoutCart->getCrosssellBlock()->isVisible());
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:10,代码来源:AssertCrossSellProducts.php


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