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


PHP CheckoutCart::getTotalsBlock方法代码示例

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


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

示例1: run

 /**
  * Apply coupon before one page checkout.
  *
  * @return void
  */
 public function run()
 {
     if ($this->salesRule !== null) {
         $this->checkoutCart->getDiscountCodesBlock()->applyCouponCode($this->salesRule->getCouponCode());
         $this->checkoutCart->getTotalsBlock()->waitForUpdatedTotals();
     }
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:12,代码来源:ApplySalesRuleOnFrontendStep.php

示例2: run

 /**
  * Checkout with Braintree PayPal from Shopping Cart.
  *
  * @return void
  */
 public function run()
 {
     $this->checkoutCart->open();
     $this->checkoutCart->getTotalsBlock()->waitForShippingPriceBlock();
     $this->checkoutCart->getTotalsBlock()->waitForUpdatedTotals();
     $currentWindow = $this->checkoutCart->getCartBlock()->braintreePaypalCheckout();
     $this->checkoutCart->getBraintreePaypalBlock()->process($currentWindow);
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:13,代码来源:CheckoutWithPaypalFromCartStep.php

示例3: processAssert

 /**
  * Assert that grand total is equal to expected
  *
  * @param CheckoutCart $checkoutCart
  * @param Cart $cart
  * @param boolean $requireReload
  * @return void
  */
 public function processAssert(CheckoutCart $checkoutCart, Cart $cart, $requireReload = true)
 {
     if ($requireReload) {
         $checkoutCart->open();
         $checkoutCart->getTotalsBlock()->waitForUpdatedTotals();
     }
     $fixtureGrandTotal = number_format($cart->getGrandTotal(), 2);
     $pageGrandTotal = $checkoutCart->getTotalsBlock()->getGrandTotal();
     \PHPUnit_Framework_Assert::assertEquals($fixtureGrandTotal, $pageGrandTotal, 'Grand total price in the shopping cart not equals to grand total price from fixture.');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:18,代码来源:AssertGrandTotalInShoppingCart.php

示例4: processAssert

 /**
  * Assert that shipping amount is equal to expected.
  *
  * @param CheckoutCart $checkoutCart
  * @param Cart $cart
  * @return void
  */
 public function processAssert(CheckoutCart $checkoutCart, Cart $cart)
 {
     $checkoutCart->open();
     $fixtureShippingAmount = number_format((double) $cart->getShippingAmount(), 2);
     $pageShippingAmount = $checkoutCart->getTotalsBlock()->getShippingPrice();
     \PHPUnit_Framework_Assert::assertEquals($fixtureShippingAmount, $pageShippingAmount, 'Shipping amount in the shopping cart not equals to shipping amount from fixture.');
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:14,代码来源:AssertShippingInShoppingCart.php

示例5: getCartPrice

 /**
  * Get cart prices
  *
  * @param CatalogProductSimple $product
  * @param array $actualPrices
  * @return array
  */
 protected function getCartPrice(CatalogProductSimple $product, $actualPrices)
 {
     $this->checkoutCart->open();
     $actualPrices['cart_item_price_incl_tax'] = $this->checkoutCart->getCartBlock()->getCartItem($product)->getPriceInclTax();
     $actualPrices['cart_item_subtotal_incl_tax'] = $this->checkoutCart->getCartBlock()->getCartItem($product)->getSubtotalPriceInclTax();
     $actualPrices['grand_total'] = $this->checkoutCart->getTotalsBlock()->getGrandTotalIncludingTax();
     return $actualPrices;
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:15,代码来源:AbstractAssertTaxWithCrossBorderApplying.php

示例6: processAssert

 /**
  * Assert that Catalog Price Rule is applied for product(s) in Shopping Cart
  * according to Priority(Priority/Stop Further Rules Processing).
  *
  * @param CheckoutCart $checkoutCartPage
  * @param array $products
  * @param array $cartPrice
  * @param array $productPrice
  * @param Customer $customer
  * @return void
  */
 public function processAssert(CheckoutCart $checkoutCartPage, array $products, array $cartPrice, array $productPrice, Customer $customer = null)
 {
     if ($customer !== null) {
         $this->objectManager->create('\\Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     }
     $this->objectManager->create('\\Magento\\Checkout\\Test\\TestStep\\AddProductsToTheCartStep', ['products' => $products])->run();
     $checkoutCartPage->open();
     foreach ($products as $key => $product) {
         $actualPrice = $checkoutCartPage->getCartBlock()->getCartItem($product)->getSubtotalPrice();
         \PHPUnit_Framework_Assert::assertEquals($productPrice[$key]['sub_total'], $actualPrice, 'Wrong product price is displayed.' . "\nExpected: " . $productPrice[$key]['sub_total'] . "\nActual: " . $actualPrice . "\n");
     }
     $actualPrices['sub_total'] = $checkoutCartPage->getTotalsBlock()->getSubtotal();
     $actualPrices['grand_total'] = $checkoutCartPage->getTotalsBlock()->getGrandTotal();
     $expectedPrices['sub_total'] = $cartPrice['sub_total'];
     $expectedPrices['grand_total'] = $cartPrice['grand_total'];
     \PHPUnit_Framework_Assert::assertEquals($expectedPrices, $actualPrices, 'Wrong total cart prices are displayed.');
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:28,代码来源:AssertCatalogPriceRuleAppliedShoppingCart.php

示例7: processAssert

 /**
  * Assert that tax amount is equal to expected.
  *
  * @param CheckoutCart $checkoutCart
  * @param Cart $cart
  * @param boolean $requireReload
  * @return void
  */
 public function processAssert(CheckoutCart $checkoutCart, Cart $cart, $requireReload = true)
 {
     if ($requireReload) {
         $checkoutCart->open();
     }
     $fixtureTaxAmount = number_format((double) $cart->getTaxAmount(), 2);
     $pageTaxAmount = $checkoutCart->getTotalsBlock()->getTax();
     \PHPUnit_Framework_Assert::assertEquals($fixtureTaxAmount, $pageTaxAmount, 'Tax amount in the shopping cart not equals to tax amount from fixture.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:17,代码来源:AssertTaxInShoppingCart.php

示例8: run

 /**
  * Estimate shipping and tax and process assertions for totals.
  *
  * @return void
  */
 public function run()
 {
     $this->checkoutCart->open();
     $this->checkoutCart->getCartBlock()->waitCartContainerLoading();
     /** @var \Magento\Checkout\Test\Fixture\Cart $cart */
     if ($this->cart !== null) {
         $cart = $this->fixtureFactory->createByCode('cart', ['data' => array_merge($this->cart->getData(), ['items' => ['products' => $this->products]])]);
         $this->checkoutCart->getShippingBlock()->fillEstimateShippingAndTax($this->address);
         if (!empty($this->shipping)) {
             $this->checkoutCart->getShippingBlock()->selectShippingMethod($this->shipping);
         }
         $this->checkoutCart->getTotalsBlock()->waitForUpdatedTotals();
         $this->assertEstimateShippingAndTax->processAssert($this->checkoutCart, $cart, false);
     }
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:20,代码来源:EstimateShippingAndTaxStep.php

示例9: getCartPrice

 /**
  * Get cart prices
  *
  * @param CatalogProductSimple $product
  * @param array $actualPrices
  * @return array
  */
 protected function getCartPrice(CatalogProductSimple $product, array $actualPrices)
 {
     $this->checkoutCart->open();
     $productItem = $this->checkoutCart->getCartBlock()->getCartItem($product);
     $productWeeeItem = $this->checkoutCart->getWeeeCartBlock()->getCartItem($product);
     $actualPrices['cart_item_price'] = $productItem->getPrice();
     $actualPrices['cart_item_fpt'] = $productWeeeItem->getPriceFptBlock()->getFpt();
     $actualPrices['cart_item_fpt_total'] = $productWeeeItem->getPriceFptBlock()->getFptTotal();
     $actualPrices['cart_item_subtotal'] = $productItem->getSubtotalPrice();
     $actualPrices['cart_item_subtotal_fpt'] = $productWeeeItem->getSubtotalFptBlock()->getFpt();
     $actualPrices['cart_item_subtotal_fpt_total'] = $productWeeeItem->getSubtotalFptBlock()->getFptTotal();
     $actualPrices['grand_total'] = $this->checkoutCart->getTotalsBlock()->getGrandTotal();
     $actualPrices['total_fpt'] = $this->checkoutCart->getWeeeTotalsBlock()->getFptBlock()->getTotalFpt();
     return $actualPrices;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:22,代码来源:AssertFptApplied.php

示例10: processAssert

 /**
  * Assert that discount is equal to expected.
  *
  * @param CheckoutCart $checkoutCart
  * @param Cart $cart
  * @return void
  */
 public function processAssert(CheckoutCart $checkoutCart, Cart $cart)
 {
     $checkoutCart->open();
     $checkoutCart->getTotalsBlock()->waitForUpdatedTotals();
     \PHPUnit_Framework_Assert::assertEquals(number_format($cart->getDiscount(), 2), $checkoutCart->getTotalsBlock()->getDiscount(), 'Discount amount in the shopping cart not equals to discount amount from fixture.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:13,代码来源:AssertDiscountInShoppingCart.php


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