Nadat een eerder probleem in php is opgelost met betrekking tot ons winkelmandje, komt een volgend probleem naar voren.

In de laatste stap van het bestellen moet je je bestelling bevestigen. Als je dit hebt gedaan komt de volgende regel in het scherm te staan:

Notice: Undefined property: ps_payment::$payment_code in /home/hoekst25/domains/kinderspulenzo.nl/public_html/administrator/components/com_virtuemart/classes/ps_checkout.php on line 1220

De bestelling wordt wel geplaatst en kan ik terug vinden in de backend van onze site.

Regel 1220 van ps_checkout.php vermeld:

<?php
if( $enable_processor == "Y" || stristr($_PAYMENT->payment_code, '_API' ) !== false ) {
?>

Kan iemand mij helpen de foutmelding op te lossen?

Met vriendelijke groet,

Rene Hoekstra

Voor de duidelijkheid de regels voor regel 1220:

<?php

// Export the order_id so the checkout complete page can get it
$d["order_id"] = $order_id;

/*
* Let the shipping module know which shipping method
* was selected. This way it can save any information
* it might need later to print a shipping label.
*/
if( is_callable( array($this->_SHIPPING, 'save_rate_info') )) {

}

// Now as everything else has been done, we can update
// the Order Status if the Payment Method is
// "Use Payment Processor", because:
// Payment Processors return false on any error
// Only completed payments return true!
$update_order = false;
if( $order_total == 0.00 ) { // code moved out of $_PAYMENT check as no payment will be needed when $order_total=0.0



} elseif (isset($_PAYMENT)) {
if( $enable_processor == "Y" || stristr($_PAYMENT->payment_code, '_API' ) !== false ) {
}

?>


<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
/**
*
* @version $Id: ps_payment.php 1095 2007-12-19 20:19:16Z soeren_nb $
* @package VirtueMart
* @subpackage payment
* @copyright Copyright (C) 2004-2007 soeren - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/


/**
*
* The ps_payment class, containing the default payment processing code
* for payment methods that have no own class
*
*/
class ps_payment {

var $classname = "ps_payment";
/**
* Show all configuration parameters for this payment method
* @returns boolean False when the Payment method has no configration
*/
function show_configuration() {
/* ... */
}

function has_configuration() {
// return false if there's no configuration
return false;
}

/**
* Returns the "is_writeable" status of the configuration file
* @param void
* @returns boolean True when the configuration file is writeable, false when not
*/
function configfile_writeable() {
return is_writeable( CLASSPATH."payment/".$this->classname.".cfg.php" );
}

/**
* Returns the "is_readable" status of the configuration file
* @param void
* @returns boolean True when the configuration file is writeable, false when not
*/
function configfile_readable() {
return is_readable( CLASSPATH."payment/".$this->classname.".cfg.php" );
}

/**
* Writes the configuration file for this payment method
* @param array An array of objects
* @returns boolean True when writing was successful
*/
function write_configuration( &$d ) {
/* ... */
}

/**************************************************************************
** name: process_payment()
** returns:
***************************************************************************/
function process_payment($order_number, $order_total, &$d) {
return true;
}

}<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
/**
*
* @version $Id: ps_payment.php 1095 2007-12-19 20:19:16Z soeren_nb $
* @package VirtueMart
* @subpackage payment
* @copyright Copyright (C) 2004-2007 soeren - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/


/**
*
* The ps_payment class, containing the default payment processing code
* for payment methods that have no own class
*
*/
class ps_payment {

var $classname = "ps_payment";
/**
* Show all configuration parameters for this payment method
* @returns boolean False when the Payment method has no configration
*/
function show_configuration() {
/* ... */
}

function has_configuration() {
// return false if there's no configuration
return false;
}

/**
* Returns the "is_writeable" status of the configuration file
* @param void
* @returns boolean True when the configuration file is writeable, false when not
*/
function configfile_writeable() {
return is_writeable( CLASSPATH."payment/".$this->classname.".cfg.php" );
}

/**
* Returns the "is_readable" status of the configuration file
* @param void
* @returns boolean True when the configuration file is writeable, false when not
*/
function configfile_readable() {
return is_readable( CLASSPATH."payment/".$this->classname.".cfg.php" );
}

/**
* Writes the configuration file for this payment method
* @param array An array of objects
* @returns boolean True when writing was successful
*/
function write_configuration( &$d ) {
/* ... */
}

/**************************************************************************
** name: process_payment()
** returns:
***************************************************************************/
function process_payment($order_number, $order_total, &$d) {
return true;
}

}[/url]


[size=xsmall]Toevoeging op 22/05/2012 12:49:11:[/size]

Dit is dus de complete code van ps_payment
@Rene,

Zoals ik al in een eerdere post aangaf, voeg var $payment_code = ""; toe aan de ps_payment class, op beide plaatsen! Tenzij je per ongelijk 2x gepaste hebt. En aan de code te zien wel!

Doe het dus zo en het probleem is opgelost.

<?php
class ps_payment {

    var $classname = "ps_payment";
    var $payment_code = "";
    /**
    * Show all configuration parameters for this payment method
    * @returns boolean False when the Payment method has no configration
    */
?>

@ Chris NVT

ik heb net de code ingevoerd en een testbestelling geplaatst, geen foutmelding meer.:-)

Oh ja, ik wel eerst de errorreporting uitgezet.;-)

Ik ben nog het een en ander aan het testen, waarschijnlijk dat ik mij nog een keer meld met een klein probleempje.

Voor nu eerst ontzettend bedankt voor jullie medewerking. TOP!!!!!
@Rene,

Mooi, dan is dat 'probleem' getackelt ;)

Succes!

Reageren