Visto che sicuramente qualcuno ha avuto il mio stesso problema, ecco la soluzione.
Lo stato dell'ordine non cambia in automatico dopo il pagamento con paypal?
Aprire il file notify.php contenuto qui:
/administrator/components/com_virtuemart
Cercate questa frase: If the payment_status is not Completed... do nothing but mail
Subito dopo cancellare tutto fino a
// ..If UNVerified - It's 'Suspicious'
e inserire il codice in rosso.
//----------------------------------------------------------------------
// If the payment_status is not Completed... do nothing but mail
//----------------------------------------------------------------------
// UPDATE THE ORDER STATUS to 'INVALID'
//----------------------------------------------------------------------
//----------------------------------------------------------------------
if(eregi ("Completed", $payment_status)) {
require_once($mosConfig_absolute_path. '/includes/sef.php');
require_once( CLASSPATH . 'vmAbstractObject.class.php');
require_once ( CLASSPATH . 'class_currency_display.php' );
require_once ( CLASSPATH . 'ps_checkout.php' );
$default_vendor = 1;
if( $my->id ) {
$db->query( 'SELECT `vendor_id` FROM `#__{vm}_auth_user_vendor` WHERE `user_id` ='.$my->id );
$db->next_record();
if( $db->f( 'vendor_id' ) ) {
$default_vendor = $db->f( 'vendor_id' );
}
}
$q = "SELECT vendor_currency_display_style
FROM (`#__{vm}_vendor`, `#__{vm}_country`)
WHERE `vendor_id`=$default_vendor
AND (vendor_country=country_2_code OR vendor_country=country_3_code);";
$db->query($q);
$db->next_record();
$vendor_currency_display_style = $db->f("vendor_currency_display_style");
$currency_display = vendor_currency_display_style( $vendor_currency_display_style );
$GLOBALS['CURRENCY_DISPLAY'] =& new CurrencyDisplay($currency_display["id"], $currency_display["symbol"], $currency_display["nbdecimal"], $currency_display["sdecimal"], $currency_display["thousands"], $currency_display["positive"], $currency_display["negative"]);
$ps_checkout = new ps_checkout;
$ps_checkout->email_receipt($order_id);
}
}
}
//----------------------------------------------------------------
// ..If UNVerified - It's 'Suspicious' and needs investigating!
// Send an email to yourself so you investigate it.
//----------------------------------------------------------------
Volete che venga inviata soltanto la mail quando lo stato dell'ordine è "Confirmed" eliminando l'invio della mail con lo stato "Pending" ?
- Aprire ps_checkout.php dentro /administrator/components/com_virtuemart/classes
- Cercare la riga:
// Mail receipt to the shopper
Commentare la riga successiva
// vmMail( $from_email, $mosConfig_fromname, $shopper_email, $shopper_subject, $msg, "" );
Attenzione, più giù c'è un richiamo da commentare.. esattamente alla riga 2160:
// $shopper_mail = vmMail( $from_email, $mosConfig_fromname, $shopper_email, $shopper_subject, $shopper_mail_Body, $shopper_mail_AltBody, true, null, null, $EmbeddedImages);
Testato e funzionante.
Saluti.