VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: Nick-DE on December 05, 2013, 09:14:54 AM

Title: Payment based on Billing-Adress and not on Delivery-Adress
Post by: Nick-DE on December 05, 2013, 09:14:54 AM
hi,

is there an option in vm 2.0.24b for payment by billing-adress and not by delivery-adress? if a customer has to different contries in billing- an shipping-adress vm shows the payment-options based on delivery-adress (delivery-country) but i need it based on the billing-adress. is there a way to do this?

thanks and greetings
nick
Title: Re: Payment based on Billing-Adress and not on Delivery-Adress
Post by: alatak on December 05, 2013, 12:35:48 PM
Hello
It is a payment plugin problem. For some payment processor it is the Bill to address, some others the Ship To.
Which payment plugin are you using ?
Title: Re: Payment based on Billing-Adress and not on Delivery-Adress
Post by: Nick-DE on December 05, 2013, 14:36:17 PM
Hi,

got this problem with the standard payment and sepa direct mandate. i've got three payment-methods:

invoice = only in germany
sepa direct mandate = only in germany
pay bevor livering = all other countrys

in the payments i selected the countrys for wich the payment is avaible.

if a customer had an billing-adress e.g. in france and no delivering-adress so the correct payment "pay bevor livering" could only selected.

if a customer had an billing-adress e.g. in france and a delivery-adress in germany so only the payments "invoice" and "sepa direct mandate" are avaible. but i need here only "pay bevor livering" because the payment should only be based on bill-adress and not at the delivery-adress.

i think that the payment by joomla/vm is based on the billing-adress if there is no delivery-adress. if there is a delivery-adress the payment is based on the delivery-adress - but i need always payment is based only on billing-adress.

you got an idea how i can do this?

greetings
nick

Title: Re: Payment based on Billing-Adress and not on Delivery-Adress
Post by: GJC Web Design on December 05, 2013, 22:21:05 PM
For the VM standard plugin it's line 216 in plugins\vmpayment\standard\standard.php

change
$address = (($cart->ST == 0) ? $cart->BT : $cart->ST);

to

$address =  $cart->BT;

what is the SEPA one? Commercial plugin? will probably use the same snippet - most do

Title: Re: Payment based on Billing-Adress and not on Delivery-Adress
Post by: Nick-DE on December 06, 2013, 08:14:00 AM
Hi,

many thanks :-). works perfect :-). you're right: sepa uses the same snippet.

sepa direct mandate is a comercial plugin for payment-method sepa (i don't know if this only given in germany): http://extensions.virtuemart.net/payments/sepa-direct-debit-mandate-detail (http://extensions.virtuemart.net/payments/sepa-direct-debit-mandate-detail). it's supported by alatak (also posted to this thread) with great support.

thanks again.

greetings
nick
Title: Re: Payment based on Billing-Adress and not on Delivery-Adress
Post by: GJC Web Design on December 06, 2013, 11:23:57 AM
I use a slightly different snippet in my plugins - the std. one

$address = (($cart->ST == 0) ? $cart->BT : $cart->ST);

ignores if they set a shipping address but then tick the "Use for the shipto same as billto address"

I use

if($cart->STsameAsBT == 0){
$address = (($cart->ST == 0 ) ? $cart->BT : $cart->ST);
}else{
$address = $cart->BT;
}


won't affect you but might be interesting for alatak

cheers

John