本文整理汇总了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;
}
示例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'));
}
示例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;
}
示例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;
}
示例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'));
}
示例6: getTotals
/**
* Get totals.
*
* @return array
*/
protected function getTotals()
{
$totalsBlock = $this->checkoutCart->getTotalsBlock();
return $this->getTypeBlockData($totalsBlock);
}