1

I want to call the minimum order value for a specific payment method within a block and have not been able to find a question that has asked this. The closest bit of code I could find was something like below that finds min value for free shipping:

private $scopeConfig;

public function __construct(
    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
) {
    $this->scopeConfig = $scopeConfig;
}

public function getFreeShippingValue()
{
    return $this->scopeConfig->getValue('carriers/freeshipping/free_shipping_subtotal', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
}

I however want the minimum order value and am unsure how to find the path for payment method configurations. I want something like below however and to know how to figure out the paths so guessing and asking questions on here are not required in future:

public function getMinLeasingValue()
{
    return $this->scopeConfig->getValue('paymentmethods/banktransfer/min_order_value', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
} 
2

You can find path in the etc/adminhtml/system.xml file of corresponding module. For the offline-payments it is:

magento/module-offline-payments/etc/adminhtml/system.xml

For the check money order it would be:

$this->scopeConfig->getValue('payment/checkmo/min_order_total', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

For the purchase order:

$this->scopeConfig->getValue('payment/purchaseorder/min_order_total', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

For the bank transfer payment:

$this->scopeConfig->getValue('payment/banktransfer/min_order_total', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

For the Cash on Delivery:

$this->scopeConfig->getValue('payment/cashondelivery/min_order_total', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
| improve this answer | |
  • Awesome i think its also the same to look in the core_config_data table as my research since asking the question seems so suggest. I will give this all a go. – harri Jun 7 '17 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.