Jump to content

Modulo PayPal Crea un nuevo cliente y cambia direcciones de envio


Recommended Posts

Buenas tardes:
Estoy teniendo un problema con el módulo PayPal México.
1. Hago login con un algun usuario cliente de mi tienda.
2. Selecciono un producto.
3. Voy a pagarlo.
4. Selecciono PayPal como forma de pago.
5. Me redirecciona a una pagina para loguearme como usuario paypal.
6. Ingreso los datos de Paypal.
7. Me devuelve a mi tienda pero los datos de usuario que ingrese en el punto 1 se pierden.
8. Aparecen los datos de usuario y direccion de la cuenta de PayPal.

 

Ya intenté modificando el archivo standard.tpl

<input type="hidden" name="address_override" value="1" />

por

<input type="hidden" name="address_override" value="0" />

 

Pero o no tomá el cambio o no basta esa solución.

 

Espero alguien pueda ayudarme

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Hola al final pude corregir este problema editando el archivo: modules/paypalmx/controllers/front/expresscheckout.php

Comentando todo este código:

                        /* Checks if a customer already exists for this e-mail address */
                        /*
                        if (Validate::isEmail($result['EMAIL']))
                        {
                                $customer = new Customer();
                                $customer->getByEmail($result['EMAIL']);
                        }
                        */

                        /* If the customer does not exist yet, create a new one */
                        /*
                        if (!Validate::isLoadedObject($customer))
                        {
                                $customer = new Customer();
                                $customer->email = $result['EMAIL'];
                                $customer->firstname = $result['FIRSTNAME'];
                                $customer->lastname = $result['LASTNAME'];
                                $customer->passwd = Tools::encrypt(Tools::passwdGen());
                                $customer->add();
                        }
                        */
                        /* Look for an existing PayPal address for this customer */
                        /*
                        $addresses = $customer->getAddresses((int)Configuration::get('PS_LANG_DEFAULT'));
                        foreach ($addresses as $address)
                                if ($address['alias'] == 'PayPal')
                                {
                                        $id_address = (int)$address['id_address'];
                                        break;
                                }
                        */
                        /* Create or update a PayPal address for this customer */
                        /*
                        $address = new Address(isset($id_address) ? (int)$id_address : 0);
                        $address->id_customer = (int)$customer->id;
                        $address->id_country = (int)Country::getByIso($result['PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE']);
                        $address->id_state = (int)State::getIdByIso($result['PAYMENTREQUEST_0_SHIPTOSTATE'], (int)$address->id_country);
                        $address->alias = 'PayPal';
                        $address->lastname = Tools::substr($result['PAYMENTREQUEST_0_SHIPTONAME'], 0, strpos($result['PAYMENTREQUEST_0_SHIPTONAME'], ' '));
                        $address->firstname = Tools::substr($result['PAYMENTREQUEST_0_SHIPTONAME'], strpos($result['PAYMENTREQUEST_0_SHIPTONAME'], ' '), Tools::strlen($
result['PAYMENTREQUEST_0_SHIPTONAME']) - Tools::strlen($address->lastname));
                        $address->address1 = $result['PAYMENTREQUEST_0_SHIPTOSTREET'];
                        if ($result['PAYMENTREQUEST_0_SHIPTOSTREET2'] != '')
                                $address->address2 = $result['PAYMENTREQUEST_0_SHIPTOSTREET2'];
                        $address->city = $result['PAYMENTREQUEST_0_SHIPTOCITY'];
                        $address->postcode = $result['PAYMENTREQUEST_0_SHIPTOZIP'];
                        $address->save();
                        */
                        /* Update the customer cookie to simulate a logged-in session */
                        /*
                        $this->context->cookie->id_customer = (int)$customer->id;
                        $this->context->cookie->customer_lastname = $customer->lastname;
                        $this->context->cookie->customer_firstname = $customer->firstname;
                        $this->context->cookie->passwd = $customer->passwd;
                        $this->context->cookie->email = $customer->email;
                        $this->context->cookie->is_guest = $customer->isGuest();
                        $this->context->cookie->logged = 1;
                        */
                        /* Update the cart billing and delivery addresses */
                        /*
                        $this->context->cart->id_address_delivery = (int)$address->id;
                        $this->context->cart->id_address_invoice = (int)$address->id;
                        $this->context->cart->secure_key = $customer->secure_key;
                        $this->context->cart->update();
                        */

Saludos.

  • Like 2
Link to comment
Share on other sites

  • nadie locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...