Jump to content

Edit History

bacuri

bacuri

Hello,

 

I'm using paypal module (for 1.6 version). I've notice some strange behavior. Some orders payed by paypal have same same delivery and invoice address. But in cart originally where two different addresses. Why is that?

I found in express_checkout\payment.php code:

First module gets last address (randomly, becouse getAddresses gets address without order by)

$addresses = $customer->getAddresses($ppec->context->language->id);
        foreach ($addresses as $address) {
            if ($address['alias'] == 'Paypal_Address') {
                //If address has already been created
                $address = new Address($address['id_address']);
                break;
            }
        }

And then updates cart addresses to same address:

        if ($customer->id && $address->id) {
            $ppec->context->cart->id_customer = $customer->id;
            $ppec->context->cart->id_address_delivery = $address->id;
            $ppec->context->cart->id_address_invoice = $address->id;
            $ppec->context->cart->id_guest = $ppec->context->cookie->id_guest;

Why is that? Addresses shouldn't be touched. Can I comment addresses update?

 

bacuri

bacuri

Hello,

 

I'm using paypal module (for 1.6 version). I've notice some strange behavior. Some orders payed by paypal have same same delivery and invoice address. But in cart originally where two different addresses. Why is that?

I found in express_checkout\payment.php code:

First module gets first address (randomly, becouse getAddresses gets address without order by)

$addresses = $customer->getAddresses($ppec->context->language->id);
        foreach ($addresses as $address) {
            if ($address['alias'] == 'Paypal_Address') {
                //If address has already been created
                $address = new Address($address['id_address']);
                break;
            }
        }

And then updatess cart addresses to same address:

        if ($customer->id && $address->id) {
            $ppec->context->cart->id_customer = $customer->id;
            $ppec->context->cart->id_address_delivery = $address->id;
            $ppec->context->cart->id_address_invoice = $address->id;
            $ppec->context->cart->id_guest = $ppec->context->cookie->id_guest;

Why is that? Addresses shouldn't be touched. Can I comment addresses update?

 

×
×
  • Create New...