PAYONE-GmbH / magento-1

PAYONE Payment Extension for Magento 1
22 stars 40 forks source link

Credit Rating: 'incrementCreditratingSampleCounter' produces unnecessary DB queries! #473

Closed pgrudina closed 2 years ago

pgrudina commented 2 years ago

When Credit rating disabled there is a method 'setCreditratingSampleCounter' that still doing 'saveConfig' and produces unnecessary DB queries on every order place after.

It could simply be improved if you check if Credit Rating is enabled:

public function setCreditratingSampleCounter($count, $storeId) { $creditRating = $this->getConfigProtect($storeId)->getCreditrating(); if ($creditRating->isEnabled()) { Mage::getConfig()->saveConfig(self::CONFIG_KEY_CREDITRATING_SAMPLE_COUNTER, $count, 'stores', $storeId); } }

hreinberger commented 2 years ago

thx, we'll look into this!

janteuber commented 2 years ago

Hello, We solved that issue with https://github.com/PAYONE-GmbH/magento-1/pull/474 I merged it today.