Problem:

The following error message occurs:


"Fatal error: Call to a member function getItemsCount() on a non-object in [...]/app/code/community/Netresearch/OPS/Model/Payment/Cc.php on line 261"


Solution:

This error only affects module versions before 16.04.13. The module should be updated.


If an update is not possible, the following change can be implemented instead:

  • Open the file app/code/community/Netresearch/OPS/Model/Payment/Cc.php
  • Search for the function "isAvailable" (around line 259)
  • Change that function as follows:
public function isAvailable($quote = null)
{
    if (!is_null($quote) && !$quote->getItemsCount() > 0 && $this->getDataHelper()->isAdminSession()) {
        /* Disable payment method in backend as long as there are no items in quote to
        *  avoid problems with alias creation in EE1.12 & EE1.13
        */
        return false;
    }

    return parent::isAvailable($quote);
}