Jump to content

Bug from ps_checkout with phone_mobile required


Adrien T

Recommended Posts

Hello,

i get the paypal express checkout option (button) on product page which the paypal express create address,

the address is created without a phone mobile number but the phone_mobile is required.

So, when the customer try to order he is blocked to the address step on order page (reload without errors on click on "Continue")

I add the below code on the end of "function handleRequest" on /classes/checkout/CheckoutAdressesStep.php

and it works, but when i try to override this i get the error : "Call to a member function loadAddressById() on null"

 

if (Customer::customerHasAddress($this->getCheckoutSession()->getCustomer()->id, $this->getCheckoutSession()->getIdAddressDelivery())){
            $id_address= $this->getCheckoutSession()->getIdAddressDelivery();
            $invoice_adress= new Address($id_address);
            echo $invoice_adress->id;
            var_dump($invoice_adress);
            if(empty($invoice_adress->phone_mobile)){
                $this->show_delivery_address_form = true;
                $this->form_has_continue_button = true;
                $this->setCurrent(true);
                $this->setComplete(false);
                $this->getCheckoutProcess()->invalidateAllStepsAfterCurrent();
                $this->addressForm->loadAddressById($id_address);
            }
        }

Could you help me to correct this feature, customers are in a loop at the adress step.

Thanks by Advance.

Adrien.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...