No auto-selection of payment method in 2.0.8 or 2.0.8a?

Started by z-analysts, July 02, 2012, 17:13:55 PM

Previous topic - Next topic

z-analysts

I have one payment method and one shipment method. The shipment method IS auto-selected by not the payment method! It used to work in 2.0.6! What changed? How do I fix?

Thank you!


mattcowan

This has something to do with the function CheckAutomaticSelectedPayment in components/com_virtuemart/helpers/cart.php...it seems that $virtuemart_paymentmethod_id has not been set somewhere and instead of returning true, the function is returning false.

This is not the right way to do it, but for a temporary solution you can set the function to return true and hard code the payment id inside the function like so.:


//...
} else {
$this->virtuemart_paymentmethod_id = 1; //or whatever your paymentmethod_id is...
$this->automaticSelectedPayment=true;
$this->setCartIntoSession();
return true;
}
} else {
return false;
}//...


Still looking for where this is originally going wrong myself.

carsten888

Thank you very much. That makes it work for now. :D

I was struggling a bit as to which code to change to what, so here is for others:

VM 2.0.8c
components/com_virtuemart/helpers/cart.php
line: 1135

$this->automaticSelectedPayment=false;
$this->setCartIntoSession();
return false;

change to
$this->virtuemart_paymentmethod_id = 1;//payment id as in VM admin page > shop > payment methods (column 'id').
$this->automaticSelectedPayment=true;
$this->setCartIntoSession();
return true;


I'm still puzzeled as to why on my localhost (with a copy of the online database) the autoselection works fine without this hack ???

Milbo

There exists already some threads about this and it is a lot easier just to disable the klarna plugin. and or use version c
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

alatak

Hello,

You have to disabled the klarna plugin via the Joomla plugin manager.
Installing the c version will not help, because the installer is not removing or disabling an already installed plugin.