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


PHP Data::getAmount方法代码示例

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


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

示例1: updateBundleProductOptions

 /**
  * Process bundle options selection for prepare view json
  *
  * @param   \Magento\Framework\Event\Observer $observer
  * @return  $this
  */
 public function updateBundleProductOptions(\Magento\Framework\Event\Observer $observer)
 {
     if (!$this->_weeeData->isEnabled()) {
         return $this;
     }
     $response = $observer->getEvent()->getResponseObject();
     $selection = $observer->getEvent()->getSelection();
     $options = $response->getAdditionalOptions();
     $_product = $this->_registry->registry('current_product');
     $typeDynamic = \Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Attributes\Extend::DYNAMIC;
     if (!$_product || $_product->getPriceType() != $typeDynamic) {
         return $this;
     }
     $amount = $this->_weeeData->getAmount($selection);
     $attributes = $this->_weeeData->getProductWeeeAttributes($_product, null, null, null, $this->_weeeData->isTaxable());
     $amountInclTaxes = $this->_weeeData->getAmountInclTaxes($attributes);
     $taxes = $amountInclTaxes - $amount;
     $options['plusDisposition'] = $amount;
     $options['plusDispositionTax'] = $taxes < 0 ? 0 : $taxes;
     // Exclude Weee amount from excluding tax amount
     if (!$this->_weeeData->typeOfDisplay(array(0, 1, 4))) {
         $options['exclDisposition'] = true;
     }
     $response->setAdditionalOptions($options);
     return $this;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:32,代码来源:Observer.php

示例2: testGetAmount

 public function testGetAmount()
 {
     $this->assertEquals('11.26', $this->_helperData->getAmount($this->_product));
 }
开发者ID:vasiljok,项目名称:magento2,代码行数:4,代码来源:DataTest.php

示例3: getAmount

 /**
  * Obtain amount
  *
  * @param SaleableInterface $saleableItem
  * @return float
  */
 protected function getAmount(SaleableInterface $saleableItem)
 {
     return $this->weeeHelper->getAmount($saleableItem);
 }
开发者ID:aiesh,项目名称:magento2,代码行数:10,代码来源:Adjustment.php

示例4: getWeeeTaxAmount

 /**
  * Get weee amount
  *
  * @return float
  */
 protected function getWeeeTaxAmount()
 {
     $product = $this->getSaleableItem();
     return $this->weeeHelper->getAmount($product);
 }
开发者ID:vasiljok,项目名称:magento2,代码行数:10,代码来源:Adjustment.php

示例5: testGetAmount

 public function testGetAmount()
 {
     $this->product->expects($this->any())->method('hasData')->will($this->returnValue(false));
     $this->product->expects($this->any())->method('getData')->will($this->returnValue(11.26));
     $this->assertEquals('11.26', $this->helperData->getAmount($this->product));
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:6,代码来源:DataTest.php

示例6: getAmount

 /**
  * Obtain amount
  *
  * @param SaleableInterface $saleableItem
  * @return float
  */
 protected function getAmount(SaleableInterface $saleableItem)
 {
     $weeeAmount = $this->weeeHelper->getAmount($saleableItem);
     $weeeAmount = $this->priceCurrency->convertAndRound($weeeAmount);
     return $weeeAmount;
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:12,代码来源:Adjustment.php


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