當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。