當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CheckoutCart::getTotalsBlock方法代碼示例

本文整理匯總了PHP中mage\checkout\test\page\CheckoutCart::getTotalsBlock方法的典型用法代碼示例。如果您正苦於以下問題:PHP CheckoutCart::getTotalsBlock方法的具體用法?PHP CheckoutCart::getTotalsBlock怎麽用?PHP CheckoutCart::getTotalsBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mage\checkout\test\page\CheckoutCart的用法示例。


在下文中一共展示了CheckoutCart::getTotalsBlock方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getCartPrice

 /**
  * Get cart prices.
  *
  * @param CatalogProductSimple $product
  * @param array $actualPrices
  * @return array
  */
 protected function getCartPrice(CatalogProductSimple $product, array $actualPrices)
 {
     $actualPrices['cart_item_price_incl_tax'] = $this->checkoutCart->getCartBlock()->getCartItem($product)->getCartItemTypePrice('cart_item_price_incl_tax');
     $actualPrices['cart_item_subtotal_incl_tax'] = $this->checkoutCart->getCartBlock()->getCartItem($product)->getCartItemTypePrice('cart_item_subtotal_incl_tax');
     $actualPrices['grand_total'] = $this->checkoutCart->getTotalsBlock()->getData('grand_total_incl_tax');
     return $actualPrices;
 }
開發者ID:hientruong90,項目名稱:ee_14_installer,代碼行數:14,代碼來源:AbstractAssertTaxWithCrossBorderApplying.php

示例2: processAssert

 /**
  * Assert that grand total is equal to expected.
  *
  * @param CheckoutCart $checkoutCart
  * @param Cart $cart
  * @param Customer|null $customer
  * @return void
  */
 public function processAssert(CheckoutCart $checkoutCart, Cart $cart, Customer $customer = null)
 {
     if ($customer !== null) {
         $this->login($customer);
     }
     $checkoutCart->open();
     \PHPUnit_Framework_Assert::assertEquals(number_format($cart->getGrandTotal(), 2), $checkoutCart->getTotalsBlock()->getData('grand_total'));
 }
開發者ID:chucky515,項目名稱:Magento-CE-Mirror,代碼行數:16,代碼來源:AssertGrandTotalInShoppingCart.php

示例3: getTotalPrice

 /**
  * Get grand total.
  *
  * @return array
  */
 protected function getTotalPrice()
 {
     $prices = [];
     foreach ($this->expectedPrices['total'] as $key => $type) {
         $prices[$key] = $this->checkoutCart->getTotalsBlock()->getData($key);
     }
     return $prices;
 }
開發者ID:cewolf2002,項目名稱:magento,代碼行數:13,代碼來源:AssertFptApplied.php

示例4: getTotals

 /**
  * Get totals from total block in shopping cart.
  *
  * @return array
  */
 protected function getTotals()
 {
     $totals = [];
     $totals['subtotal'] = $this->checkoutCart->getTotalsBlock()->getData('subtotal');
     $totals['grandTotal'] = $this->checkoutCart->getTotalsBlock()->getData('grand_total');
     if ($this->checkoutCart->getTotalsBlock()->isVisibleShippingPriceBlock()) {
         $shippingPrice = $this->checkoutCart->getTotalsBlock()->getData('shipping_price');
         $totals['grandTotal'] = number_format($totals['grandTotal'] - $shippingPrice, 2);
     }
     return $totals;
 }
開發者ID:cewolf2002,項目名稱:magento,代碼行數:16,代碼來源:AbstractCartPriceRuleApplying.php

示例5: processAssert

 /**
  * Assert that grand total is equal to expected.
  *
  * @param CheckoutCart $checkoutCart
  * @param Cart $cart
  * @return void
  */
 public function processAssert(CheckoutCart $checkoutCart, Cart $cart)
 {
     $checkoutCart->open();
     \PHPUnit_Framework_Assert::assertEquals(number_format($cart->getGrandTotal(), 2), $checkoutCart->getTotalsBlock()->getData('grand_total'));
 }
開發者ID:hientruong90,項目名稱:ee_14_installer,代碼行數:12,代碼來源:AssertGrandTotalInShoppingCart.php

示例6: getTotals

 /**
  * Get totals.
  *
  * @return array
  */
 protected function getTotals()
 {
     $totalsBlock = $this->checkoutCart->getTotalsBlock();
     return $this->getTypeBlockData($totalsBlock);
 }
開發者ID:hientruong90,項目名稱:ee_14_installer,代碼行數:10,代碼來源:AbstractAssertTaxRuleIsAppliedToAllPrices.php


注:本文中的mage\checkout\test\page\CheckoutCart::getTotalsBlock方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。