![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/Ecombricks/InventoryPaypal/Block/Express/Review/ |
<?php /** * Copyright © eComBricks. All rights reserved. * See LICENSE.txt for license details. */ namespace Ecombricks\InventoryPaypal\Block\Express\Review; /** * Paypal express review block source trait */ trait SourceTrait { /** * Get source code * * @param string $sourceCode * @return string */ public function getSourceName($sourceCode) { return $this->sourceManagement->getSourceName($sourceCode); } /** * Get source carrier name * * @param string $sourceCode * @param string $carrierCode * @return string */ public function getSourceCarrierName($sourceCode, $carrierCode) { $configSourceCode = $this->_scopeConfig->getSourceCode(); $this->_scopeConfig->setSourceCode($sourceCode); $carrierTitle = $this->_scopeConfig->getValue('carriers/'.$carrierCode.'/title', \Magento\Store\Model\ScopeInterface::SCOPE_STORE); $this->_scopeConfig->setSourceCode($configSourceCode); if ($carrierTitle) { return $carrierTitle; } return $carrierCode; } /** * Before to HTML * * @return $this */ protected function _beforeToHtml() { $payment = $this->_quote->getPayment(); $this->setPaymentMethodTitle($payment->getMethodInstance()->getTitle()); $this->setShippingRateRequired(true); if ($this->_quote->getIsVirtual()) { $this->setShippingRateRequired(false); } else { $this->_address = $this->_quote->getShippingAddress(); $canEditShippingAddress = $this->_quote->getMayEditShippingAddress() && $payment->getAdditionalInformation(\Magento\Paypal\Model\Express\Checkout::PAYMENT_INFO_BUTTON) == 1; $this ->setShippingMethodSubmitUrl($this->getUrl("{$this->_controllerPath}/saveShippingMethod", ['_secure' => true])) ->setCanEditShippingAddress($canEditShippingAddress) ->setCanEditShippingMethod($this->_quote->getMayEditShippingMethod()); } $this ->setEditUrl($this->getUrl("{$this->_controllerPath}/edit")) ->setPlaceOrderUrl($this->getUrl("{$this->_controllerPath}/placeOrder", ['_secure' => true])); return \Magento\Framework\View\Element\Template::_beforeToHtml(); } }