コード例 #1
0
 public function testGetStore()
 {
     $storeId = 1;
     $storeMock = $this->getMockBuilder('Magento\\Store\\Model\\Store')->disableOriginalConstructor()->getMock();
     $this->storeManagerMock->expects($this->once())->method('getStore')->with($storeId)->will($this->returnValue($storeMock));
     $this->quote->setStoreId($storeId);
     $result = $this->quote->getStore();
     $this->assertInstanceOf('Magento\\Store\\Model\\Store', $result);
 }
コード例 #2
0
ファイル: CanUseForCurrency.php プロジェクト: aiesh/magento2
 /**
  * Check whether payment method is applicable to quote
  * Purposed to allow use in controllers some logic that was implemented in blocks only before
  *
  * @param PaymentMethodChecksInterface $paymentMethod
  * @param \Magento\Sales\Model\Quote $quote
  * @return bool
  */
 public function isApplicable(PaymentMethodChecksInterface $paymentMethod, Quote $quote)
 {
     return $paymentMethod->canUseForCurrency($quote->getStore()->getBaseCurrencyCode());
 }
コード例 #3
0
ファイル: Review.php プロジェクト: zhangjiachao/magento2
 /**
  * Format price base on store convert price method
  *
  * @param float $price
  * @return string
  */
 protected function _formatPrice($price)
 {
     return $this->priceCurrency->convertAndFormat($price, true, PriceCurrencyInterface::DEFAULT_PRECISION, $this->_quote->getStore());
 }
コード例 #4
0
ファイル: Review.php プロジェクト: aiesh/magento2
 /**
  * Format price base on store convert price method
  *
  * @param float $price
  * @return string
  */
 protected function _formatPrice($price)
 {
     return $this->_quote->getStore()->convertPrice($price, true);
 }