Problem with _sendOrderByEmail

Hello,

I am trying to make a script for payment by credit card on oxid 4.6 community.

At the last step (sending mail and showing the order to the customer) I got a problem when I do this on my method of my extended class :


class CB_Order extends CB_Order_parent {

  ....

  if ($iSuccess === 'CBOK' && $oOrder->load(oxSession::getVar('sess_challenge'))) {
     $oBasket = $this->getBasket();
     $sPaymentId = $oBasket->getPaymentId();
     $oUser = $this->getUser();
     $iSuccess = $oOrder->sendCBOrderByEmail($oUser, $oBasket, $sPaymentId);
  }
}


class CB_oxOrder extends CB_oxOrder_parent {

  protected function _sendOrderByEmail($oUser = null, $oBasket = null, $oPayment = null)
  {
    if ($this->oxorder__oxpaymenttype->value == 'CB') {
      return 1;
    } else {
      return parent::_sendOrderByEmail($oUser, $oBasket, $oPayment);
    }
  }
  
  public function sendCBOrderByEmail($oUser = null, $oBasket = null, $oPayment = null) {
    return parent::_sendOrderByEmail($oUser, $oBasket, $oPayment);
  }
}


[B]Error :[/B]
Fatal error: Call to a member function getRawValue() on a non-object in /home/www/1fc6c569d186b2320707ad0d7cd003ac/web/tmp/f3d2e0fe0e56e9558123e564bd1407d9^%%3E^3E2^3E2C254F%%order_cust.tpl.php on line 241

[B]Code of error line 241 :[/B]


<?php $_from = $this->_tpl_vars['basket']->getProductVats(); if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['VATitem']):
?>

I have followed this post to make the script :
http://devzone.zend.com/1529/accepting-credit-card-payments-with-oxid-eshop-ce-and-alertpay/

Someone can help me please ?

The getRawValue() call is probably the result of something in the TPL that looks like

object->oxtable__oxfield–>value

Except it is being done on something that isn’t actually an object. Probably either a syntax error or just a bug in the code.

When you debug, you can step into those tmp files (in your case f3d2e0fe0e56e9558123e564bd1407d9^%%3E^3E2^3E2C254F %%order_cust.tpl.php) to pinpoint the issue. That file is just a php representation of the order_cust.tpl file.